@caatinga/core 2.3.1 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{browser-Cq4ZofIq.d.cts → artifact.schema-BH5K-IiZ.d.cts} +2 -1
- package/dist/{browser-Cq4ZofIq.d.ts → artifact.schema-BH5K-IiZ.d.ts} +2 -1
- package/dist/browser.cjs +20 -0
- package/dist/browser.d.cts +5 -1
- package/dist/browser.d.ts +5 -1
- package/dist/browser.js +19 -0
- package/dist/index.cjs +322 -42
- package/dist/index.d.cts +35 -5
- package/dist/index.d.ts +35 -5
- package/dist/index.js +314 -42
- package/package.json +1 -1
- package/scaffolds/soroban-contract-stub/Cargo.toml +24 -0
- package/scaffolds/soroban-contract-stub/src/lib.rs +42 -0
|
@@ -2,6 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
|
|
3
3
|
declare const CaatingaErrorCode: {
|
|
4
4
|
readonly CONFIG_NOT_FOUND: "CAATINGA_CONFIG_NOT_FOUND";
|
|
5
|
+
readonly DEPENDENCIES_NOT_INSTALLED: "CAATINGA_DEPENDENCIES_NOT_INSTALLED";
|
|
5
6
|
readonly INVALID_CONFIG: "CAATINGA_INVALID_CONFIG";
|
|
6
7
|
readonly COMMAND_FAILED: "CAATINGA_COMMAND_FAILED";
|
|
7
8
|
readonly UNEXPECTED_ERROR: "CAATINGA_UNEXPECTED_ERROR";
|
|
@@ -179,4 +180,4 @@ declare const CaatingaArtifactsSchema: z.ZodObject<{
|
|
|
179
180
|
type ContractArtifact = z.infer<typeof ContractArtifactSchema>;
|
|
180
181
|
type CaatingaArtifacts = z.infer<typeof CaatingaArtifactsSchema>;
|
|
181
182
|
|
|
182
|
-
export { type CaatingaArtifacts as C,
|
|
183
|
+
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 };
|
|
@@ -2,6 +2,7 @@ import { z } from 'zod';
|
|
|
2
2
|
|
|
3
3
|
declare const CaatingaErrorCode: {
|
|
4
4
|
readonly CONFIG_NOT_FOUND: "CAATINGA_CONFIG_NOT_FOUND";
|
|
5
|
+
readonly DEPENDENCIES_NOT_INSTALLED: "CAATINGA_DEPENDENCIES_NOT_INSTALLED";
|
|
5
6
|
readonly INVALID_CONFIG: "CAATINGA_INVALID_CONFIG";
|
|
6
7
|
readonly COMMAND_FAILED: "CAATINGA_COMMAND_FAILED";
|
|
7
8
|
readonly UNEXPECTED_ERROR: "CAATINGA_UNEXPECTED_ERROR";
|
|
@@ -179,4 +180,4 @@ declare const CaatingaArtifactsSchema: z.ZodObject<{
|
|
|
179
180
|
type ContractArtifact = z.infer<typeof ContractArtifactSchema>;
|
|
180
181
|
type CaatingaArtifacts = z.infer<typeof CaatingaArtifactsSchema>;
|
|
181
182
|
|
|
182
|
-
export { type CaatingaArtifacts as C,
|
|
183
|
+
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 };
|
package/dist/browser.cjs
CHANGED
|
@@ -22,6 +22,7 @@ var browser_exports = {};
|
|
|
22
22
|
__export(browser_exports, {
|
|
23
23
|
CaatingaError: () => CaatingaError,
|
|
24
24
|
CaatingaErrorCode: () => CaatingaErrorCode,
|
|
25
|
+
assertSorobanSymbol: () => assertSorobanSymbol,
|
|
25
26
|
formatCaatingaError: () => formatCaatingaError,
|
|
26
27
|
toCaatingaError: () => toCaatingaError
|
|
27
28
|
});
|
|
@@ -30,6 +31,7 @@ module.exports = __toCommonJS(browser_exports);
|
|
|
30
31
|
// src/errors/CaatingaErrorCode.ts
|
|
31
32
|
var CaatingaErrorCode = {
|
|
32
33
|
CONFIG_NOT_FOUND: "CAATINGA_CONFIG_NOT_FOUND",
|
|
34
|
+
DEPENDENCIES_NOT_INSTALLED: "CAATINGA_DEPENDENCIES_NOT_INSTALLED",
|
|
33
35
|
INVALID_CONFIG: "CAATINGA_INVALID_CONFIG",
|
|
34
36
|
COMMAND_FAILED: "CAATINGA_COMMAND_FAILED",
|
|
35
37
|
UNEXPECTED_ERROR: "CAATINGA_UNEXPECTED_ERROR",
|
|
@@ -132,10 +134,28 @@ function formatCause(cause) {
|
|
|
132
134
|
return String(cause);
|
|
133
135
|
}
|
|
134
136
|
}
|
|
137
|
+
|
|
138
|
+
// src/soroban/assert-soroban-symbol.ts
|
|
139
|
+
var SOROBAN_SYMBOL_PATTERN = /^[A-Za-z0-9_]{1,32}$/;
|
|
140
|
+
function assertSorobanSymbol(value, paramName = "symbol") {
|
|
141
|
+
if (SOROBAN_SYMBOL_PATTERN.test(value)) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
throw new CaatingaError(
|
|
145
|
+
`Invalid Soroban Symbol for "${paramName}".`,
|
|
146
|
+
CaatingaErrorCode.INVOKE_FAILED,
|
|
147
|
+
[
|
|
148
|
+
"Soroban Symbol values may only contain ASCII letters, digits, and underscores (max 32 chars).",
|
|
149
|
+
`Received: ${JSON.stringify(value)}`,
|
|
150
|
+
"See docs/soroban-types.md for examples."
|
|
151
|
+
].join("\n")
|
|
152
|
+
);
|
|
153
|
+
}
|
|
135
154
|
// Annotate the CommonJS export names for ESM import in node:
|
|
136
155
|
0 && (module.exports = {
|
|
137
156
|
CaatingaError,
|
|
138
157
|
CaatingaErrorCode,
|
|
158
|
+
assertSorobanSymbol,
|
|
139
159
|
formatCaatingaError,
|
|
140
160
|
toCaatingaError
|
|
141
161
|
});
|
package/dist/browser.d.cts
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
export { C as CaatingaArtifacts,
|
|
1
|
+
export { C as CaatingaArtifacts, a as CaatingaError, b as CaatingaErrorCode, c as ContractArtifact, f as formatCaatingaError, t as toCaatingaError } from './artifact.schema-BH5K-IiZ.cjs';
|
|
2
2
|
import 'zod';
|
|
3
|
+
|
|
4
|
+
declare function assertSorobanSymbol(value: string, paramName?: string): void;
|
|
5
|
+
|
|
6
|
+
export { assertSorobanSymbol };
|
package/dist/browser.d.ts
CHANGED
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
export { C as CaatingaArtifacts,
|
|
1
|
+
export { C as CaatingaArtifacts, a as CaatingaError, b as CaatingaErrorCode, c as ContractArtifact, f as formatCaatingaError, t as toCaatingaError } from './artifact.schema-BH5K-IiZ.js';
|
|
2
2
|
import 'zod';
|
|
3
|
+
|
|
4
|
+
declare function assertSorobanSymbol(value: string, paramName?: string): void;
|
|
5
|
+
|
|
6
|
+
export { assertSorobanSymbol };
|
package/dist/browser.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
// src/errors/CaatingaErrorCode.ts
|
|
2
2
|
var CaatingaErrorCode = {
|
|
3
3
|
CONFIG_NOT_FOUND: "CAATINGA_CONFIG_NOT_FOUND",
|
|
4
|
+
DEPENDENCIES_NOT_INSTALLED: "CAATINGA_DEPENDENCIES_NOT_INSTALLED",
|
|
4
5
|
INVALID_CONFIG: "CAATINGA_INVALID_CONFIG",
|
|
5
6
|
COMMAND_FAILED: "CAATINGA_COMMAND_FAILED",
|
|
6
7
|
UNEXPECTED_ERROR: "CAATINGA_UNEXPECTED_ERROR",
|
|
@@ -103,9 +104,27 @@ function formatCause(cause) {
|
|
|
103
104
|
return String(cause);
|
|
104
105
|
}
|
|
105
106
|
}
|
|
107
|
+
|
|
108
|
+
// src/soroban/assert-soroban-symbol.ts
|
|
109
|
+
var SOROBAN_SYMBOL_PATTERN = /^[A-Za-z0-9_]{1,32}$/;
|
|
110
|
+
function assertSorobanSymbol(value, paramName = "symbol") {
|
|
111
|
+
if (SOROBAN_SYMBOL_PATTERN.test(value)) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
throw new CaatingaError(
|
|
115
|
+
`Invalid Soroban Symbol for "${paramName}".`,
|
|
116
|
+
CaatingaErrorCode.INVOKE_FAILED,
|
|
117
|
+
[
|
|
118
|
+
"Soroban Symbol values may only contain ASCII letters, digits, and underscores (max 32 chars).",
|
|
119
|
+
`Received: ${JSON.stringify(value)}`,
|
|
120
|
+
"See docs/soroban-types.md for examples."
|
|
121
|
+
].join("\n")
|
|
122
|
+
);
|
|
123
|
+
}
|
|
106
124
|
export {
|
|
107
125
|
CaatingaError,
|
|
108
126
|
CaatingaErrorCode,
|
|
127
|
+
assertSorobanSymbol,
|
|
109
128
|
formatCaatingaError,
|
|
110
129
|
toCaatingaError
|
|
111
130
|
};
|