@caatinga/core 2.4.5 → 3.0.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.
@@ -50,6 +50,7 @@ declare const CaatingaErrorCode: {
50
50
  readonly TEMPLATE_INCOMPATIBLE: "CAATINGA_TEMPLATE_INCOMPATIBLE";
51
51
  readonly ZK_VERIFICATION_FAILED: "CAATINGA_ZK_VERIFICATION_FAILED";
52
52
  readonly DOCTOR_PARTIAL_DEPLOY: "CAATINGA_DOCTOR_PARTIAL_DEPLOY";
53
+ readonly MULTI_AUTH_REQUIRED: "CAATINGA_MULTI_AUTH_REQUIRED";
53
54
  };
54
55
  type CaatingaErrorCodeValue = typeof CaatingaErrorCode[keyof typeof CaatingaErrorCode];
55
56
 
@@ -50,6 +50,7 @@ declare const CaatingaErrorCode: {
50
50
  readonly TEMPLATE_INCOMPATIBLE: "CAATINGA_TEMPLATE_INCOMPATIBLE";
51
51
  readonly ZK_VERIFICATION_FAILED: "CAATINGA_ZK_VERIFICATION_FAILED";
52
52
  readonly DOCTOR_PARTIAL_DEPLOY: "CAATINGA_DOCTOR_PARTIAL_DEPLOY";
53
+ readonly MULTI_AUTH_REQUIRED: "CAATINGA_MULTI_AUTH_REQUIRED";
53
54
  };
54
55
  type CaatingaErrorCodeValue = typeof CaatingaErrorCode[keyof typeof CaatingaErrorCode];
55
56
 
package/dist/browser.cjs CHANGED
@@ -78,7 +78,8 @@ var CaatingaErrorCode = {
78
78
  TEMPLATE_MANIFEST_NOT_FOUND: "CAATINGA_TEMPLATE_MANIFEST_NOT_FOUND",
79
79
  TEMPLATE_INCOMPATIBLE: "CAATINGA_TEMPLATE_INCOMPATIBLE",
80
80
  ZK_VERIFICATION_FAILED: "CAATINGA_ZK_VERIFICATION_FAILED",
81
- DOCTOR_PARTIAL_DEPLOY: "CAATINGA_DOCTOR_PARTIAL_DEPLOY"
81
+ DOCTOR_PARTIAL_DEPLOY: "CAATINGA_DOCTOR_PARTIAL_DEPLOY",
82
+ MULTI_AUTH_REQUIRED: "CAATINGA_MULTI_AUTH_REQUIRED"
82
83
  };
83
84
 
84
85
  // src/errors/CaatingaError.ts
@@ -1,4 +1,4 @@
1
- export { C as CaatingaArtifacts, a as CaatingaError, b as CaatingaErrorCode, c as ContractArtifact, f as formatCaatingaError, t as toCaatingaError } from './artifact.schema-DYPk6NgV.cjs';
1
+ export { C as CaatingaArtifacts, a as CaatingaError, b as CaatingaErrorCode, c as ContractArtifact, f as formatCaatingaError, t as toCaatingaError } from './artifact.schema-CGCFfl0g.cjs';
2
2
  import 'zod';
3
3
 
4
4
  declare function assertSorobanSymbol(value: string, paramName?: string): void;
package/dist/browser.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { C as CaatingaArtifacts, a as CaatingaError, b as CaatingaErrorCode, c as ContractArtifact, f as formatCaatingaError, t as toCaatingaError } from './artifact.schema-DYPk6NgV.js';
1
+ export { C as CaatingaArtifacts, a as CaatingaError, b as CaatingaErrorCode, c as ContractArtifact, f as formatCaatingaError, t as toCaatingaError } from './artifact.schema-CGCFfl0g.js';
2
2
  import 'zod';
3
3
 
4
4
  declare function assertSorobanSymbol(value: string, paramName?: string): void;
package/dist/browser.js CHANGED
@@ -48,7 +48,8 @@ var CaatingaErrorCode = {
48
48
  TEMPLATE_MANIFEST_NOT_FOUND: "CAATINGA_TEMPLATE_MANIFEST_NOT_FOUND",
49
49
  TEMPLATE_INCOMPATIBLE: "CAATINGA_TEMPLATE_INCOMPATIBLE",
50
50
  ZK_VERIFICATION_FAILED: "CAATINGA_ZK_VERIFICATION_FAILED",
51
- DOCTOR_PARTIAL_DEPLOY: "CAATINGA_DOCTOR_PARTIAL_DEPLOY"
51
+ DOCTOR_PARTIAL_DEPLOY: "CAATINGA_DOCTOR_PARTIAL_DEPLOY",
52
+ MULTI_AUTH_REQUIRED: "CAATINGA_MULTI_AUTH_REQUIRED"
52
53
  };
53
54
 
54
55
  // src/errors/CaatingaError.ts
package/dist/index.cjs CHANGED
@@ -137,7 +137,8 @@ var CaatingaErrorCode = {
137
137
  TEMPLATE_MANIFEST_NOT_FOUND: "CAATINGA_TEMPLATE_MANIFEST_NOT_FOUND",
138
138
  TEMPLATE_INCOMPATIBLE: "CAATINGA_TEMPLATE_INCOMPATIBLE",
139
139
  ZK_VERIFICATION_FAILED: "CAATINGA_ZK_VERIFICATION_FAILED",
140
- DOCTOR_PARTIAL_DEPLOY: "CAATINGA_DOCTOR_PARTIAL_DEPLOY"
140
+ DOCTOR_PARTIAL_DEPLOY: "CAATINGA_DOCTOR_PARTIAL_DEPLOY",
141
+ MULTI_AUTH_REQUIRED: "CAATINGA_MULTI_AUTH_REQUIRED"
141
142
  };
142
143
 
143
144
  // src/errors/CaatingaError.ts
@@ -1608,9 +1609,19 @@ async function deployContractGraph(options) {
1608
1609
  // src/contracts/generate-bindings.ts
1609
1610
  var import_promises7 = require("fs/promises");
1610
1611
  var import_node_path10 = __toESM(require("path"), 1);
1612
+
1613
+ // src/contracts/build-generate-network-args.ts
1614
+ function buildGenerateNetworkArgs(network) {
1615
+ if (WELL_KNOWN_NETWORKS[network.name]) {
1616
+ return ["--network", network.name, "--rpc-url", network.config.rpcUrl];
1617
+ }
1618
+ return ["--rpc-url", network.config.rpcUrl];
1619
+ }
1620
+
1621
+ // src/contracts/generate-bindings.ts
1611
1622
  function toBindingImportPath(bindingsOutput, contractName) {
1612
1623
  const normalized = bindingsOutput.replace(/^\.\//, "").split(import_node_path10.default.sep).join("/");
1613
- return `./${import_node_path10.default.posix.join(normalized, contractName, "src", "index.js")}`;
1624
+ return `./${import_node_path10.default.posix.join(normalized, contractName)}`;
1614
1625
  }
1615
1626
  async function removeLegacyBindingStub(cwd, bindingsOutput, contractName) {
1616
1627
  const legacyPath = import_node_path10.default.resolve(cwd, bindingsOutput, `${contractName}.ts`);
@@ -1641,19 +1652,20 @@ async function generateBindings(options) {
1641
1652
  "Run caatinga deploy for this contract and network before generating bindings."
1642
1653
  );
1643
1654
  }
1644
- await checkBinary("stellar", "Install Stellar CLI before running caatinga generate.");
1645
1655
  const outputDir = import_node_path10.default.resolve(cwd, options.config.frontend.bindingsOutput, options.contractName);
1646
1656
  await (0, import_promises7.mkdir)(outputDir, { recursive: true });
1647
- const result = await runCommand("stellar", [
1648
- "contract",
1649
- "bindings",
1650
- "typescript",
1657
+ const result = await runCommand("npx", [
1658
+ "--yes",
1659
+ "@stellar/stellar-sdk",
1660
+ "generate",
1651
1661
  "--contract-id",
1652
1662
  contractArtifact.contractId,
1653
1663
  "--output-dir",
1654
1664
  outputDir,
1665
+ "--contract-name",
1666
+ options.contractName,
1655
1667
  "--overwrite",
1656
- ...buildStellarNetworkArgs(network)
1668
+ ...buildGenerateNetworkArgs(network)
1657
1669
  ], {
1658
1670
  cwd,
1659
1671
  failureCode: CaatingaErrorCode.BINDINGS_FAILED
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-DYPk6NgV.cjs';
2
- export { e as CaatingaArtifactsSchema, b as CaatingaErrorCode, f as formatCaatingaError, t as toCaatingaError } from './artifact.schema-DYPk6NgV.cjs';
1
+ import { C as CaatingaArtifacts, c as ContractArtifact, d as CaatingaErrorCodeValue, a as CaatingaError } from './artifact.schema-CGCFfl0g.cjs';
2
+ export { e as CaatingaArtifactsSchema, b as CaatingaErrorCode, f as formatCaatingaError, t as toCaatingaError } from './artifact.schema-CGCFfl0g.cjs';
3
3
  import { z } from 'zod';
4
4
 
5
5
  declare const CAATINGA_CORE_VERSION: string;
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-DYPk6NgV.js';
2
- export { e as CaatingaArtifactsSchema, b as CaatingaErrorCode, f as formatCaatingaError, t as toCaatingaError } from './artifact.schema-DYPk6NgV.js';
1
+ import { C as CaatingaArtifacts, c as ContractArtifact, d as CaatingaErrorCodeValue, a as CaatingaError } from './artifact.schema-CGCFfl0g.js';
2
+ export { e as CaatingaArtifactsSchema, b as CaatingaErrorCode, f as formatCaatingaError, t as toCaatingaError } from './artifact.schema-CGCFfl0g.js';
3
3
  import { z } from 'zod';
4
4
 
5
5
  declare const CAATINGA_CORE_VERSION: string;
package/dist/index.js CHANGED
@@ -48,7 +48,8 @@ var CaatingaErrorCode = {
48
48
  TEMPLATE_MANIFEST_NOT_FOUND: "CAATINGA_TEMPLATE_MANIFEST_NOT_FOUND",
49
49
  TEMPLATE_INCOMPATIBLE: "CAATINGA_TEMPLATE_INCOMPATIBLE",
50
50
  ZK_VERIFICATION_FAILED: "CAATINGA_ZK_VERIFICATION_FAILED",
51
- DOCTOR_PARTIAL_DEPLOY: "CAATINGA_DOCTOR_PARTIAL_DEPLOY"
51
+ DOCTOR_PARTIAL_DEPLOY: "CAATINGA_DOCTOR_PARTIAL_DEPLOY",
52
+ MULTI_AUTH_REQUIRED: "CAATINGA_MULTI_AUTH_REQUIRED"
52
53
  };
53
54
 
54
55
  // src/errors/CaatingaError.ts
@@ -1517,9 +1518,19 @@ async function deployContractGraph(options) {
1517
1518
  // src/contracts/generate-bindings.ts
1518
1519
  import { access as access3, mkdir as mkdir2, unlink } from "fs/promises";
1519
1520
  import path10 from "path";
1521
+
1522
+ // src/contracts/build-generate-network-args.ts
1523
+ function buildGenerateNetworkArgs(network) {
1524
+ if (WELL_KNOWN_NETWORKS[network.name]) {
1525
+ return ["--network", network.name, "--rpc-url", network.config.rpcUrl];
1526
+ }
1527
+ return ["--rpc-url", network.config.rpcUrl];
1528
+ }
1529
+
1530
+ // src/contracts/generate-bindings.ts
1520
1531
  function toBindingImportPath(bindingsOutput, contractName) {
1521
1532
  const normalized = bindingsOutput.replace(/^\.\//, "").split(path10.sep).join("/");
1522
- return `./${path10.posix.join(normalized, contractName, "src", "index.js")}`;
1533
+ return `./${path10.posix.join(normalized, contractName)}`;
1523
1534
  }
1524
1535
  async function removeLegacyBindingStub(cwd, bindingsOutput, contractName) {
1525
1536
  const legacyPath = path10.resolve(cwd, bindingsOutput, `${contractName}.ts`);
@@ -1550,19 +1561,20 @@ async function generateBindings(options) {
1550
1561
  "Run caatinga deploy for this contract and network before generating bindings."
1551
1562
  );
1552
1563
  }
1553
- await checkBinary("stellar", "Install Stellar CLI before running caatinga generate.");
1554
1564
  const outputDir = path10.resolve(cwd, options.config.frontend.bindingsOutput, options.contractName);
1555
1565
  await mkdir2(outputDir, { recursive: true });
1556
- const result = await runCommand("stellar", [
1557
- "contract",
1558
- "bindings",
1559
- "typescript",
1566
+ const result = await runCommand("npx", [
1567
+ "--yes",
1568
+ "@stellar/stellar-sdk",
1569
+ "generate",
1560
1570
  "--contract-id",
1561
1571
  contractArtifact.contractId,
1562
1572
  "--output-dir",
1563
1573
  outputDir,
1574
+ "--contract-name",
1575
+ options.contractName,
1564
1576
  "--overwrite",
1565
- ...buildStellarNetworkArgs(network)
1577
+ ...buildGenerateNetworkArgs(network)
1566
1578
  ], {
1567
1579
  cwd,
1568
1580
  failureCode: CaatingaErrorCode.BINDINGS_FAILED
@@ -90,7 +90,8 @@ var CaatingaErrorCode = {
90
90
  TEMPLATE_MANIFEST_NOT_FOUND: "CAATINGA_TEMPLATE_MANIFEST_NOT_FOUND",
91
91
  TEMPLATE_INCOMPATIBLE: "CAATINGA_TEMPLATE_INCOMPATIBLE",
92
92
  ZK_VERIFICATION_FAILED: "CAATINGA_ZK_VERIFICATION_FAILED",
93
- DOCTOR_PARTIAL_DEPLOY: "CAATINGA_DOCTOR_PARTIAL_DEPLOY"
93
+ DOCTOR_PARTIAL_DEPLOY: "CAATINGA_DOCTOR_PARTIAL_DEPLOY",
94
+ MULTI_AUTH_REQUIRED: "CAATINGA_MULTI_AUTH_REQUIRED"
94
95
  };
95
96
 
96
97
  // src/errors/CaatingaError.ts
@@ -53,7 +53,8 @@ var CaatingaErrorCode = {
53
53
  TEMPLATE_MANIFEST_NOT_FOUND: "CAATINGA_TEMPLATE_MANIFEST_NOT_FOUND",
54
54
  TEMPLATE_INCOMPATIBLE: "CAATINGA_TEMPLATE_INCOMPATIBLE",
55
55
  ZK_VERIFICATION_FAILED: "CAATINGA_ZK_VERIFICATION_FAILED",
56
- DOCTOR_PARTIAL_DEPLOY: "CAATINGA_DOCTOR_PARTIAL_DEPLOY"
56
+ DOCTOR_PARTIAL_DEPLOY: "CAATINGA_DOCTOR_PARTIAL_DEPLOY",
57
+ MULTI_AUTH_REQUIRED: "CAATINGA_MULTI_AUTH_REQUIRED"
57
58
  };
58
59
 
59
60
  // src/errors/CaatingaError.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caatinga/core",
3
- "version": "2.4.5",
3
+ "version": "3.0.0",
4
4
  "description": "Core config, artifacts, command orchestration, and error primitives for Caatinga/Soroban toolkit",
5
5
  "keywords": [
6
6
  "stellar",
@@ -20,7 +20,7 @@
20
20
  "author": "Caatinga contributors",
21
21
  "license": "MIT",
22
22
  "engines": {
23
- "node": ">=20"
23
+ "node": ">=22"
24
24
  },
25
25
  "type": "module",
26
26
  "main": "./dist/index.cjs",