@caatinga/core 3.0.1 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1967,8 +1967,8 @@ async function createProjectFromTemplate(options) {
1967
1967
  await (0, import_promises8.mkdir)(targetDir, { recursive: true });
1968
1968
  await (0, import_promises8.cp)(templateDir, targetDir, {
1969
1969
  recursive: true,
1970
- force: mergeIntoExisting,
1971
- errorOnExist: !mergeIntoExisting,
1970
+ force: true,
1971
+ errorOnExist: false,
1972
1972
  filter: (source) => shouldCopyTemplateEntry(templateDir, source, options.filter)
1973
1973
  });
1974
1974
  await replaceTemplateVariables(targetDir, options.projectName);
@@ -2120,7 +2120,8 @@ function packageJsonSource(projectName) {
2120
2120
  "zk:prove": "caatinga zk prove main",
2121
2121
  build: "caatinga build verifier",
2122
2122
  deploy: "caatinga deploy verifier --network testnet --source ${CAATINGA_SOURCE:-alice}",
2123
- doctor: "caatinga doctor --network testnet"
2123
+ doctor: "caatinga doctor --network testnet",
2124
+ test: "cargo test --manifest-path contracts/verifier/Cargo.toml"
2124
2125
  },
2125
2126
  devDependencies: {
2126
2127
  "@caatinga/cli": `^${CAATINGA_CORE_VERSION}`,
@@ -2141,12 +2142,23 @@ Minimal Caatinga ZK project.
2141
2142
 
2142
2143
  \`\`\`bash
2143
2144
  npm install
2145
+ npm test
2144
2146
  npx caatinga zk build main
2145
2147
  npx caatinga build verifier
2146
2148
  npx caatinga deploy verifier --network testnet --source <identity>
2147
2149
  npx caatinga zk prove main
2148
2150
  \`\`\`
2149
2151
 
2152
+ ## Tests
2153
+
2154
+ Run the Rust verifier contract tests from the project root:
2155
+
2156
+ \`\`\`bash
2157
+ npm test
2158
+ # or directly:
2159
+ cargo test --manifest-path contracts/verifier/Cargo.toml
2160
+ \`\`\`
2161
+
2150
2162
  Replace \`circuits/main.circom\` with your circuit. Keep the entry point named \`main\`.
2151
2163
  `;
2152
2164
  }
@@ -2246,6 +2258,7 @@ function packageJsonSource2(projectName) {
2246
2258
  build: "caatinga build app",
2247
2259
  deploy: "caatinga deploy app --network testnet --source ${CAATINGA_SOURCE:-alice}",
2248
2260
  doctor: "caatinga doctor --network testnet",
2261
+ test: "cargo test --manifest-path contracts/app/Cargo.toml",
2249
2262
  "read:hello": "caatinga read app.hello --network testnet --source ${CAATINGA_SOURCE:-alice}",
2250
2263
  "read:version": "caatinga read app.version --network testnet --source ${CAATINGA_SOURCE:-alice}"
2251
2264
  },
@@ -2268,6 +2281,7 @@ Minimal Caatinga project with a Soroban contract stub (no frontend template).
2268
2281
 
2269
2282
  \`\`\`bash
2270
2283
  npm install
2284
+ npm test
2271
2285
  npx caatinga doctor
2272
2286
  npx caatinga build app
2273
2287
  npx caatinga deploy app --network testnet --source <identity>
@@ -2275,6 +2289,16 @@ npx caatinga read app.version --network testnet
2275
2289
  npx caatinga read app.hello --network testnet
2276
2290
  \`\`\`
2277
2291
 
2292
+ ## Tests
2293
+
2294
+ Run the Rust contract tests from the project root:
2295
+
2296
+ \`\`\`bash
2297
+ npm test
2298
+ # or directly:
2299
+ cargo test --manifest-path contracts/app/Cargo.toml
2300
+ \`\`\`
2301
+
2278
2302
  ## Contract
2279
2303
 
2280
2304
  - \`hello()\` \u2014 read-only; returns Soroban Symbol \`hello\`
package/dist/index.js CHANGED
@@ -1876,8 +1876,8 @@ async function createProjectFromTemplate(options) {
1876
1876
  await mkdir3(targetDir, { recursive: true });
1877
1877
  await cp(templateDir, targetDir, {
1878
1878
  recursive: true,
1879
- force: mergeIntoExisting,
1880
- errorOnExist: !mergeIntoExisting,
1879
+ force: true,
1880
+ errorOnExist: false,
1881
1881
  filter: (source) => shouldCopyTemplateEntry(templateDir, source, options.filter)
1882
1882
  });
1883
1883
  await replaceTemplateVariables(targetDir, options.projectName);
@@ -2028,7 +2028,8 @@ function packageJsonSource(projectName) {
2028
2028
  "zk:prove": "caatinga zk prove main",
2029
2029
  build: "caatinga build verifier",
2030
2030
  deploy: "caatinga deploy verifier --network testnet --source ${CAATINGA_SOURCE:-alice}",
2031
- doctor: "caatinga doctor --network testnet"
2031
+ doctor: "caatinga doctor --network testnet",
2032
+ test: "cargo test --manifest-path contracts/verifier/Cargo.toml"
2032
2033
  },
2033
2034
  devDependencies: {
2034
2035
  "@caatinga/cli": `^${CAATINGA_CORE_VERSION}`,
@@ -2049,12 +2050,23 @@ Minimal Caatinga ZK project.
2049
2050
 
2050
2051
  \`\`\`bash
2051
2052
  npm install
2053
+ npm test
2052
2054
  npx caatinga zk build main
2053
2055
  npx caatinga build verifier
2054
2056
  npx caatinga deploy verifier --network testnet --source <identity>
2055
2057
  npx caatinga zk prove main
2056
2058
  \`\`\`
2057
2059
 
2060
+ ## Tests
2061
+
2062
+ Run the Rust verifier contract tests from the project root:
2063
+
2064
+ \`\`\`bash
2065
+ npm test
2066
+ # or directly:
2067
+ cargo test --manifest-path contracts/verifier/Cargo.toml
2068
+ \`\`\`
2069
+
2058
2070
  Replace \`circuits/main.circom\` with your circuit. Keep the entry point named \`main\`.
2059
2071
  `;
2060
2072
  }
@@ -2153,6 +2165,7 @@ function packageJsonSource2(projectName) {
2153
2165
  build: "caatinga build app",
2154
2166
  deploy: "caatinga deploy app --network testnet --source ${CAATINGA_SOURCE:-alice}",
2155
2167
  doctor: "caatinga doctor --network testnet",
2168
+ test: "cargo test --manifest-path contracts/app/Cargo.toml",
2156
2169
  "read:hello": "caatinga read app.hello --network testnet --source ${CAATINGA_SOURCE:-alice}",
2157
2170
  "read:version": "caatinga read app.version --network testnet --source ${CAATINGA_SOURCE:-alice}"
2158
2171
  },
@@ -2175,6 +2188,7 @@ Minimal Caatinga project with a Soroban contract stub (no frontend template).
2175
2188
 
2176
2189
  \`\`\`bash
2177
2190
  npm install
2191
+ npm test
2178
2192
  npx caatinga doctor
2179
2193
  npx caatinga build app
2180
2194
  npx caatinga deploy app --network testnet --source <identity>
@@ -2182,6 +2196,16 @@ npx caatinga read app.version --network testnet
2182
2196
  npx caatinga read app.hello --network testnet
2183
2197
  \`\`\`
2184
2198
 
2199
+ ## Tests
2200
+
2201
+ Run the Rust contract tests from the project root:
2202
+
2203
+ \`\`\`bash
2204
+ npm test
2205
+ # or directly:
2206
+ cargo test --manifest-path contracts/app/Cargo.toml
2207
+ \`\`\`
2208
+
2185
2209
  ## Contract
2186
2210
 
2187
2211
  - \`hello()\` \u2014 read-only; returns Soroban Symbol \`hello\`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caatinga/core",
3
- "version": "3.0.1",
3
+ "version": "3.1.0",
4
4
  "description": "Core config, artifacts, command orchestration, and error primitives for Caatinga/Soroban toolkit",
5
5
  "keywords": [
6
6
  "stellar",
@@ -1,185 +0,0 @@
1
- import { z } from 'zod';
2
-
3
- declare const CaatingaErrorCode: {
4
- readonly CONFIG_NOT_FOUND: "CAATINGA_CONFIG_NOT_FOUND";
5
- readonly DEPENDENCIES_NOT_INSTALLED: "CAATINGA_DEPENDENCIES_NOT_INSTALLED";
6
- readonly INVALID_CONFIG: "CAATINGA_INVALID_CONFIG";
7
- readonly COMMAND_FAILED: "CAATINGA_COMMAND_FAILED";
8
- readonly UNEXPECTED_ERROR: "CAATINGA_UNEXPECTED_ERROR";
9
- readonly STELLAR_CLI_NOT_FOUND: "CAATINGA_STELLAR_CLI_NOT_FOUND";
10
- readonly STELLAR_CLI_VERSION_PARSE_FAILED: "CAATINGA_STELLAR_CLI_VERSION_PARSE_FAILED";
11
- readonly UNSUPPORTED_CLI_VERSION: "CAATINGA_UNSUPPORTED_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 DEPENDENCY_CONTRACT_NOT_FOUND: "CAATINGA_DEPENDENCY_CONTRACT_NOT_FOUND";
28
- readonly DEPLOY_ARG_PLACEHOLDER_INVALID: "CAATINGA_DEPLOY_ARG_PLACEHOLDER_INVALID";
29
- readonly DEPLOY_ARG_PLACEHOLDER_UNRESOLVED: "CAATINGA_DEPLOY_ARG_PLACEHOLDER_UNRESOLVED";
30
- readonly BINDING_CLIENT_NOT_FOUND: "CAATINGA_BINDING_CLIENT_NOT_FOUND";
31
- readonly BINDING_METHOD_NOT_FOUND: "CAATINGA_BINDING_METHOD_NOT_FOUND";
32
- readonly PLACEHOLDER_BINDING: "CAATINGA_PLACEHOLDER_BINDING";
33
- readonly XDR_BUILD_FAILED: "CAATINGA_XDR_BUILD_FAILED";
34
- readonly XDR_PREPARE_FAILED: "CAATINGA_XDR_PREPARE_FAILED";
35
- readonly XDR_SIGN_FAILED: "CAATINGA_XDR_SIGN_FAILED";
36
- readonly XDR_SUBMIT_FAILED: "CAATINGA_XDR_SUBMIT_FAILED";
37
- readonly XDR_RESULT_FAILED: "CAATINGA_XDR_RESULT_FAILED";
38
- readonly READ_RESULT_MISSING: "CAATINGA_READ_RESULT_MISSING";
39
- readonly WALLET_NOT_CONNECTED: "CAATINGA_WALLET_NOT_CONNECTED";
40
- readonly WALLET_TIMEOUT: "CAATINGA_WALLET_TIMEOUT";
41
- readonly SOURCE_ACCOUNT_REQUIRED: "CAATINGA_SOURCE_ACCOUNT_REQUIRED";
42
- readonly SOURCE_IS_SECRET_KEY: "CAATINGA_SOURCE_IS_SECRET_KEY";
43
- readonly SOURCE_IS_SEED_PHRASE: "CAATINGA_SOURCE_IS_SEED_PHRASE";
44
- readonly SOURCE_IS_PUBLIC_KEY: "CAATINGA_SOURCE_IS_PUBLIC_KEY";
45
- readonly UNSAFE_SOURCE_ACCOUNT: "CAATINGA_UNSAFE_SOURCE_ACCOUNT";
46
- readonly INVOKE_TARGET_INVALID: "CAATINGA_INVOKE_TARGET_INVALID";
47
- readonly TEMPLATE_NOT_FOUND: "CAATINGA_TEMPLATE_NOT_FOUND";
48
- readonly INVALID_TEMPLATE_MANIFEST: "CAATINGA_INVALID_TEMPLATE_MANIFEST";
49
- readonly TEMPLATE_MANIFEST_NOT_FOUND: "CAATINGA_TEMPLATE_MANIFEST_NOT_FOUND";
50
- readonly TEMPLATE_INCOMPATIBLE: "CAATINGA_TEMPLATE_INCOMPATIBLE";
51
- readonly ZK_VERIFICATION_FAILED: "CAATINGA_ZK_VERIFICATION_FAILED";
52
- readonly DOCTOR_PARTIAL_DEPLOY: "CAATINGA_DOCTOR_PARTIAL_DEPLOY";
53
- readonly MULTI_AUTH_REQUIRED: "CAATINGA_MULTI_AUTH_REQUIRED";
54
- };
55
- type CaatingaErrorCodeValue = typeof CaatingaErrorCode[keyof typeof CaatingaErrorCode];
56
-
57
- declare class CaatingaError extends Error {
58
- readonly code: CaatingaErrorCodeValue;
59
- readonly hint?: string | undefined;
60
- readonly cause?: unknown | undefined;
61
- constructor(message: string, code: CaatingaErrorCodeValue, hint?: string | undefined, cause?: unknown | undefined);
62
- }
63
- declare function toCaatingaError(error: unknown): CaatingaError;
64
-
65
- /**
66
- * Render an error for display. For a {@link CaatingaError} this surfaces the
67
- * code, message, and hint, plus the underlying `cause` (when present) so the
68
- * real reason — e.g. a wallet rejection or an XDR parse error — is never hidden
69
- * behind a generic hint. Falls back to the plain message for other errors.
70
- */
71
- declare function formatCaatingaError(error: unknown): string;
72
-
73
- declare const ContractArtifactSchema: z.ZodObject<{
74
- contractId: z.ZodString;
75
- wasmHash: z.ZodString;
76
- deployedAt: z.ZodString;
77
- sourcePath: z.ZodString;
78
- wasmPath: z.ZodString;
79
- dependencies: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
80
- resolvedDeployArgs: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
81
- }, "strip", z.ZodTypeAny, {
82
- contractId: string;
83
- wasmHash: string;
84
- deployedAt: string;
85
- sourcePath: string;
86
- wasmPath: string;
87
- dependencies: string[];
88
- resolvedDeployArgs: Record<string, string | number | boolean>;
89
- }, {
90
- contractId: string;
91
- wasmHash: string;
92
- deployedAt: string;
93
- sourcePath: string;
94
- wasmPath: string;
95
- dependencies?: string[] | undefined;
96
- resolvedDeployArgs?: Record<string, string | number | boolean> | undefined;
97
- }>;
98
- declare const CaatingaArtifactsSchema: z.ZodObject<{
99
- project: z.ZodString;
100
- version: z.ZodLiteral<1>;
101
- networks: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
102
- contracts: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
103
- contractId: z.ZodString;
104
- wasmHash: z.ZodString;
105
- deployedAt: z.ZodString;
106
- sourcePath: z.ZodString;
107
- wasmPath: z.ZodString;
108
- dependencies: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
109
- resolvedDeployArgs: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
110
- }, "strip", z.ZodTypeAny, {
111
- contractId: string;
112
- wasmHash: string;
113
- deployedAt: string;
114
- sourcePath: string;
115
- wasmPath: string;
116
- dependencies: string[];
117
- resolvedDeployArgs: Record<string, string | number | boolean>;
118
- }, {
119
- contractId: string;
120
- wasmHash: string;
121
- deployedAt: string;
122
- sourcePath: string;
123
- wasmPath: string;
124
- dependencies?: string[] | undefined;
125
- resolvedDeployArgs?: Record<string, string | number | boolean> | undefined;
126
- }>>>;
127
- dependencyGraph: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
128
- }, "strip", z.ZodTypeAny, {
129
- contracts: Record<string, {
130
- contractId: string;
131
- wasmHash: string;
132
- deployedAt: string;
133
- sourcePath: string;
134
- wasmPath: string;
135
- dependencies: string[];
136
- resolvedDeployArgs: Record<string, string | number | boolean>;
137
- }>;
138
- dependencyGraph: Record<string, string[]>;
139
- }, {
140
- contracts?: Record<string, {
141
- contractId: string;
142
- wasmHash: string;
143
- deployedAt: string;
144
- sourcePath: string;
145
- wasmPath: string;
146
- dependencies?: string[] | undefined;
147
- resolvedDeployArgs?: Record<string, string | number | boolean> | undefined;
148
- }> | undefined;
149
- dependencyGraph?: Record<string, string[]> | undefined;
150
- }>>>;
151
- }, "strip", z.ZodTypeAny, {
152
- project: string;
153
- version: 1;
154
- networks: Record<string, {
155
- contracts: Record<string, {
156
- contractId: string;
157
- wasmHash: string;
158
- deployedAt: string;
159
- sourcePath: string;
160
- wasmPath: string;
161
- dependencies: string[];
162
- resolvedDeployArgs: Record<string, string | number | boolean>;
163
- }>;
164
- dependencyGraph: Record<string, string[]>;
165
- }>;
166
- }, {
167
- project: string;
168
- version: 1;
169
- networks?: Record<string, {
170
- contracts?: Record<string, {
171
- contractId: string;
172
- wasmHash: string;
173
- deployedAt: string;
174
- sourcePath: string;
175
- wasmPath: string;
176
- dependencies?: string[] | undefined;
177
- resolvedDeployArgs?: Record<string, string | number | boolean> | undefined;
178
- }> | undefined;
179
- dependencyGraph?: Record<string, string[]> | undefined;
180
- }> | undefined;
181
- }>;
182
- type ContractArtifact = z.infer<typeof ContractArtifactSchema>;
183
- type CaatingaArtifacts = z.infer<typeof CaatingaArtifactsSchema>;
184
-
185
- export { type CaatingaArtifacts as C, CaatingaError as a, CaatingaErrorCode as b, type ContractArtifact as c, type CaatingaErrorCodeValue as d, CaatingaArtifactsSchema as e, formatCaatingaError as f, toCaatingaError as t };
@@ -1,185 +0,0 @@
1
- import { z } from 'zod';
2
-
3
- declare const CaatingaErrorCode: {
4
- readonly CONFIG_NOT_FOUND: "CAATINGA_CONFIG_NOT_FOUND";
5
- readonly DEPENDENCIES_NOT_INSTALLED: "CAATINGA_DEPENDENCIES_NOT_INSTALLED";
6
- readonly INVALID_CONFIG: "CAATINGA_INVALID_CONFIG";
7
- readonly COMMAND_FAILED: "CAATINGA_COMMAND_FAILED";
8
- readonly UNEXPECTED_ERROR: "CAATINGA_UNEXPECTED_ERROR";
9
- readonly STELLAR_CLI_NOT_FOUND: "CAATINGA_STELLAR_CLI_NOT_FOUND";
10
- readonly STELLAR_CLI_VERSION_PARSE_FAILED: "CAATINGA_STELLAR_CLI_VERSION_PARSE_FAILED";
11
- readonly UNSUPPORTED_CLI_VERSION: "CAATINGA_UNSUPPORTED_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 DEPENDENCY_CONTRACT_NOT_FOUND: "CAATINGA_DEPENDENCY_CONTRACT_NOT_FOUND";
28
- readonly DEPLOY_ARG_PLACEHOLDER_INVALID: "CAATINGA_DEPLOY_ARG_PLACEHOLDER_INVALID";
29
- readonly DEPLOY_ARG_PLACEHOLDER_UNRESOLVED: "CAATINGA_DEPLOY_ARG_PLACEHOLDER_UNRESOLVED";
30
- readonly BINDING_CLIENT_NOT_FOUND: "CAATINGA_BINDING_CLIENT_NOT_FOUND";
31
- readonly BINDING_METHOD_NOT_FOUND: "CAATINGA_BINDING_METHOD_NOT_FOUND";
32
- readonly PLACEHOLDER_BINDING: "CAATINGA_PLACEHOLDER_BINDING";
33
- readonly XDR_BUILD_FAILED: "CAATINGA_XDR_BUILD_FAILED";
34
- readonly XDR_PREPARE_FAILED: "CAATINGA_XDR_PREPARE_FAILED";
35
- readonly XDR_SIGN_FAILED: "CAATINGA_XDR_SIGN_FAILED";
36
- readonly XDR_SUBMIT_FAILED: "CAATINGA_XDR_SUBMIT_FAILED";
37
- readonly XDR_RESULT_FAILED: "CAATINGA_XDR_RESULT_FAILED";
38
- readonly READ_RESULT_MISSING: "CAATINGA_READ_RESULT_MISSING";
39
- readonly WALLET_NOT_CONNECTED: "CAATINGA_WALLET_NOT_CONNECTED";
40
- readonly WALLET_TIMEOUT: "CAATINGA_WALLET_TIMEOUT";
41
- readonly SOURCE_ACCOUNT_REQUIRED: "CAATINGA_SOURCE_ACCOUNT_REQUIRED";
42
- readonly SOURCE_IS_SECRET_KEY: "CAATINGA_SOURCE_IS_SECRET_KEY";
43
- readonly SOURCE_IS_SEED_PHRASE: "CAATINGA_SOURCE_IS_SEED_PHRASE";
44
- readonly SOURCE_IS_PUBLIC_KEY: "CAATINGA_SOURCE_IS_PUBLIC_KEY";
45
- readonly UNSAFE_SOURCE_ACCOUNT: "CAATINGA_UNSAFE_SOURCE_ACCOUNT";
46
- readonly INVOKE_TARGET_INVALID: "CAATINGA_INVOKE_TARGET_INVALID";
47
- readonly TEMPLATE_NOT_FOUND: "CAATINGA_TEMPLATE_NOT_FOUND";
48
- readonly INVALID_TEMPLATE_MANIFEST: "CAATINGA_INVALID_TEMPLATE_MANIFEST";
49
- readonly TEMPLATE_MANIFEST_NOT_FOUND: "CAATINGA_TEMPLATE_MANIFEST_NOT_FOUND";
50
- readonly TEMPLATE_INCOMPATIBLE: "CAATINGA_TEMPLATE_INCOMPATIBLE";
51
- readonly ZK_VERIFICATION_FAILED: "CAATINGA_ZK_VERIFICATION_FAILED";
52
- readonly DOCTOR_PARTIAL_DEPLOY: "CAATINGA_DOCTOR_PARTIAL_DEPLOY";
53
- readonly MULTI_AUTH_REQUIRED: "CAATINGA_MULTI_AUTH_REQUIRED";
54
- };
55
- type CaatingaErrorCodeValue = typeof CaatingaErrorCode[keyof typeof CaatingaErrorCode];
56
-
57
- declare class CaatingaError extends Error {
58
- readonly code: CaatingaErrorCodeValue;
59
- readonly hint?: string | undefined;
60
- readonly cause?: unknown | undefined;
61
- constructor(message: string, code: CaatingaErrorCodeValue, hint?: string | undefined, cause?: unknown | undefined);
62
- }
63
- declare function toCaatingaError(error: unknown): CaatingaError;
64
-
65
- /**
66
- * Render an error for display. For a {@link CaatingaError} this surfaces the
67
- * code, message, and hint, plus the underlying `cause` (when present) so the
68
- * real reason — e.g. a wallet rejection or an XDR parse error — is never hidden
69
- * behind a generic hint. Falls back to the plain message for other errors.
70
- */
71
- declare function formatCaatingaError(error: unknown): string;
72
-
73
- declare const ContractArtifactSchema: z.ZodObject<{
74
- contractId: z.ZodString;
75
- wasmHash: z.ZodString;
76
- deployedAt: z.ZodString;
77
- sourcePath: z.ZodString;
78
- wasmPath: z.ZodString;
79
- dependencies: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
80
- resolvedDeployArgs: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
81
- }, "strip", z.ZodTypeAny, {
82
- contractId: string;
83
- wasmHash: string;
84
- deployedAt: string;
85
- sourcePath: string;
86
- wasmPath: string;
87
- dependencies: string[];
88
- resolvedDeployArgs: Record<string, string | number | boolean>;
89
- }, {
90
- contractId: string;
91
- wasmHash: string;
92
- deployedAt: string;
93
- sourcePath: string;
94
- wasmPath: string;
95
- dependencies?: string[] | undefined;
96
- resolvedDeployArgs?: Record<string, string | number | boolean> | undefined;
97
- }>;
98
- declare const CaatingaArtifactsSchema: z.ZodObject<{
99
- project: z.ZodString;
100
- version: z.ZodLiteral<1>;
101
- networks: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
102
- contracts: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodObject<{
103
- contractId: z.ZodString;
104
- wasmHash: z.ZodString;
105
- deployedAt: z.ZodString;
106
- sourcePath: z.ZodString;
107
- wasmPath: z.ZodString;
108
- dependencies: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
109
- resolvedDeployArgs: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
110
- }, "strip", z.ZodTypeAny, {
111
- contractId: string;
112
- wasmHash: string;
113
- deployedAt: string;
114
- sourcePath: string;
115
- wasmPath: string;
116
- dependencies: string[];
117
- resolvedDeployArgs: Record<string, string | number | boolean>;
118
- }, {
119
- contractId: string;
120
- wasmHash: string;
121
- deployedAt: string;
122
- sourcePath: string;
123
- wasmPath: string;
124
- dependencies?: string[] | undefined;
125
- resolvedDeployArgs?: Record<string, string | number | boolean> | undefined;
126
- }>>>;
127
- dependencyGraph: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>>;
128
- }, "strip", z.ZodTypeAny, {
129
- contracts: Record<string, {
130
- contractId: string;
131
- wasmHash: string;
132
- deployedAt: string;
133
- sourcePath: string;
134
- wasmPath: string;
135
- dependencies: string[];
136
- resolvedDeployArgs: Record<string, string | number | boolean>;
137
- }>;
138
- dependencyGraph: Record<string, string[]>;
139
- }, {
140
- contracts?: Record<string, {
141
- contractId: string;
142
- wasmHash: string;
143
- deployedAt: string;
144
- sourcePath: string;
145
- wasmPath: string;
146
- dependencies?: string[] | undefined;
147
- resolvedDeployArgs?: Record<string, string | number | boolean> | undefined;
148
- }> | undefined;
149
- dependencyGraph?: Record<string, string[]> | undefined;
150
- }>>>;
151
- }, "strip", z.ZodTypeAny, {
152
- project: string;
153
- version: 1;
154
- networks: Record<string, {
155
- contracts: Record<string, {
156
- contractId: string;
157
- wasmHash: string;
158
- deployedAt: string;
159
- sourcePath: string;
160
- wasmPath: string;
161
- dependencies: string[];
162
- resolvedDeployArgs: Record<string, string | number | boolean>;
163
- }>;
164
- dependencyGraph: Record<string, string[]>;
165
- }>;
166
- }, {
167
- project: string;
168
- version: 1;
169
- networks?: Record<string, {
170
- contracts?: Record<string, {
171
- contractId: string;
172
- wasmHash: string;
173
- deployedAt: string;
174
- sourcePath: string;
175
- wasmPath: string;
176
- dependencies?: string[] | undefined;
177
- resolvedDeployArgs?: Record<string, string | number | boolean> | undefined;
178
- }> | undefined;
179
- dependencyGraph?: Record<string, string[]> | undefined;
180
- }> | undefined;
181
- }>;
182
- type ContractArtifact = z.infer<typeof ContractArtifactSchema>;
183
- type CaatingaArtifacts = z.infer<typeof CaatingaArtifactsSchema>;
184
-
185
- export { type CaatingaArtifacts as C, CaatingaError as a, CaatingaErrorCode as b, type ContractArtifact as c, type CaatingaErrorCodeValue as d, CaatingaArtifactsSchema as e, formatCaatingaError as f, toCaatingaError as t };