@toon-protocol/townhouse 0.14.0 → 0.14.4

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.
@@ -0,0 +1,43 @@
1
+ import { createRequire } from 'module'; const require = createRequire(import.meta.url);
2
+
3
+ // src/constants.ts
4
+ var CONTAINER_PREFIX = "townhouse-";
5
+ var NODE_BTP_PORT = 3e3;
6
+ var DEFAULT_CONNECTOR_IMAGE = (
7
+ // v3.9.2 — fixes Mina settlement-side proof encoding (#90). The settlement
8
+ // executor's `JSON.parse(proof)` failed when the proof arrived base64-encoded
9
+ // instead of as a JSON string; 3.9.2 normalizes the encoding so Mina claims
10
+ // verify through to on-chain settle. Builds on 3.9.1's #88 fix
11
+ // (SettlementExecutor now resolves the settlement chain for dynamic anonymous
12
+ // HS peers) and 3.9.1's blockchain-typed inbound claim validation
13
+ // (validateClaimMessage switches on claim.blockchain → validateEVMClaim /
14
+ // validateSolanaClaim / validateMinaClaim). validateSolanaClaim accepts
15
+ // { blockchain:'solana', programId, channelAccount (base58), nonce,
16
+ // transferredAmount, signature, signerPublicKey (base58), cluster? }. No
17
+ // breaking changes to the SDK/admin contract within 3.x (verified >=3.3.2
18
+ // through 3.9.2 — see packages/sdk/CONNECTOR_MIGRATION.md). Digest resolved
19
+ // via `docker buildx imagetools inspect` for tag 3.9.2 (manifest-index
20
+ // digest). To bump: see CONNECTOR_RELEASE_CONTRACT.md.
21
+ "ghcr.io/toon-protocol/connector@sha256:9f55d55db02a5c6a4c5b0989cd30005e30c53d3119d00698facc3cb2d6d20ff0"
22
+ );
23
+ var ACCOUNT_INDEX_TOWN = 0;
24
+ var ACCOUNT_INDEX_MILL = 1;
25
+ var ACCOUNT_INDEX_DVM = 2;
26
+ var ACCOUNT_INDEX_APEX = 3;
27
+ var TOWN_HEALTH_PORT = 3100;
28
+ var MILL_HEALTH_PORT = 3200;
29
+ var DVM_HEALTH_PORT = 3400;
30
+
31
+ export {
32
+ CONTAINER_PREFIX,
33
+ NODE_BTP_PORT,
34
+ DEFAULT_CONNECTOR_IMAGE,
35
+ ACCOUNT_INDEX_TOWN,
36
+ ACCOUNT_INDEX_MILL,
37
+ ACCOUNT_INDEX_DVM,
38
+ ACCOUNT_INDEX_APEX,
39
+ TOWN_HEALTH_PORT,
40
+ MILL_HEALTH_PORT,
41
+ DVM_HEALTH_PORT
42
+ };
43
+ //# sourceMappingURL=chunk-LUIOG6QL.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/constants.ts"],"sourcesContent":["/**\n * Shared constants for Townhouse package.\n *\n * Single source of truth for values used across multiple modules\n * (orchestrator, config-generator, CLI).\n */\n\n/** Container name prefix for all Townhouse-managed Docker containers */\nexport const CONTAINER_PREFIX = 'townhouse-';\n\n/** Internal BTP port exposed by node containers (Docker-internal only) */\nexport const NODE_BTP_PORT = 3000;\n\n/**\n * Default connector Docker image — digest-pinned per CONNECTOR_RELEASE_CONTRACT.md.\n *\n * To bump: capture a new digest by running the Story 45.1 publish workflow\n * against the desired connector tag, copy the resulting image-manifest.json\n * connector entry's digest, and update this constant + the contract canary\n * fixture. See packages/sdk/CONNECTOR_RELEASE_CONTRACT.md for the full bump\n * checklist + breaking-changes history.\n *\n * To read the human-readable tag for log output, consult dist/image-manifest.json:\n * manifest.images.connector.tag\n */\nexport const DEFAULT_CONNECTOR_IMAGE =\n // v3.9.2 — fixes Mina settlement-side proof encoding (#90). The settlement\n // executor's `JSON.parse(proof)` failed when the proof arrived base64-encoded\n // instead of as a JSON string; 3.9.2 normalizes the encoding so Mina claims\n // verify through to on-chain settle. Builds on 3.9.1's #88 fix\n // (SettlementExecutor now resolves the settlement chain for dynamic anonymous\n // HS peers) and 3.9.1's blockchain-typed inbound claim validation\n // (validateClaimMessage switches on claim.blockchain → validateEVMClaim /\n // validateSolanaClaim / validateMinaClaim). validateSolanaClaim accepts\n // { blockchain:'solana', programId, channelAccount (base58), nonce,\n // transferredAmount, signature, signerPublicKey (base58), cluster? }. No\n // breaking changes to the SDK/admin contract within 3.x (verified >=3.3.2\n // through 3.9.2 — see packages/sdk/CONNECTOR_MIGRATION.md). Digest resolved\n // via `docker buildx imagetools inspect` for tag 3.9.2 (manifest-index\n // digest). To bump: see CONNECTOR_RELEASE_CONTRACT.md.\n 'ghcr.io/toon-protocol/connector@sha256:9f55d55db02a5c6a4c5b0989cd30005e30c53d3119d00698facc3cb2d6d20ff0';\n\n/**\n * HD wallet account indices per node type (Story 21.4, D21-008).\n * BIP-44 paths: m/44'/{coin}'/ACCOUNT'/0/0\n */\nexport const ACCOUNT_INDEX_TOWN = 0;\nexport const ACCOUNT_INDEX_MILL = 1;\nexport const ACCOUNT_INDEX_DVM = 2;\n/**\n * Apex (connector) settlement account. The apex is the parent connector\n * (`g.townhouse`) that signs settlement claims; its key is derived from the\n * operator mnemonic at this index so the operator never has to supply a raw\n * settlement key. Index 3 continues the town/mill/dvm sequence (and matches the\n * dev convention where the apex is Anvil account[3], 0x90F79bf6…).\n */\nexport const ACCOUNT_INDEX_APEX = 3;\n\n/** BLS health port exposed by each node container type (internal Docker port). */\nexport const TOWN_HEALTH_PORT = 3100;\nexport const MILL_HEALTH_PORT = 3200;\nexport const DVM_HEALTH_PORT = 3400;\n"],"mappings":";;;AAQO,IAAM,mBAAmB;AAGzB,IAAM,gBAAgB;AActB,IAAM;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAeX;AAAA;AAMK,IAAM,qBAAqB;AAC3B,IAAM,qBAAqB;AAC3B,IAAM,oBAAoB;AAQ1B,IAAM,qBAAqB;AAG3B,IAAM,mBAAmB;AACzB,IAAM,mBAAmB;AACzB,IAAM,kBAAkB;","names":[]}
@@ -35,7 +35,7 @@ import {
35
35
  MILL_HEALTH_PORT,
36
36
  NODE_BTP_PORT,
37
37
  TOWN_HEALTH_PORT
38
- } from "./chunk-BLNEL3QS.js";
38
+ } from "./chunk-LUIOG6QL.js";
39
39
  import {
40
40
  __commonJS,
41
41
  __require,
@@ -6498,13 +6498,51 @@ function validateConfig(raw) {
6498
6498
  );
6499
6499
  }
6500
6500
  }
6501
+ let settlementOptions;
6502
+ if (entry["settlementOptions"] !== void 0) {
6503
+ const soPath = `${path}.settlementOptions`;
6504
+ assertObject(entry["settlementOptions"], soPath);
6505
+ const so = entry["settlementOptions"];
6506
+ settlementOptions = {};
6507
+ if (so["threshold"] !== void 0) {
6508
+ assertString(so["threshold"], `${soPath}.threshold`);
6509
+ if (!/^\d+$/.test(so["threshold"])) {
6510
+ throw new ConfigValidationError(
6511
+ `${soPath}.threshold must be a non-negative integer string (token base units)`
6512
+ );
6513
+ }
6514
+ settlementOptions.threshold = so["threshold"];
6515
+ }
6516
+ if (so["settlementTimeoutSecs"] !== void 0) {
6517
+ assertNumber(
6518
+ so["settlementTimeoutSecs"],
6519
+ `${soPath}.settlementTimeoutSecs`
6520
+ );
6521
+ settlementOptions.settlementTimeoutSecs = so["settlementTimeoutSecs"];
6522
+ }
6523
+ if (so["initialDepositMultiplier"] !== void 0) {
6524
+ assertNumber(
6525
+ so["initialDepositMultiplier"],
6526
+ `${soPath}.initialDepositMultiplier`
6527
+ );
6528
+ settlementOptions.initialDepositMultiplier = so["initialDepositMultiplier"];
6529
+ }
6530
+ if (so["pollingIntervalMs"] !== void 0) {
6531
+ assertNumber(
6532
+ so["pollingIntervalMs"],
6533
+ `${soPath}.pollingIntervalMs`
6534
+ );
6535
+ settlementOptions.pollingIntervalMs = so["pollingIntervalMs"];
6536
+ }
6537
+ }
6501
6538
  return {
6502
6539
  chainType: "evm",
6503
6540
  chainId: entry["chainId"],
6504
6541
  rpcUrl: entry["rpcUrl"],
6505
6542
  registryAddress: entry["registryAddress"],
6506
6543
  tokenAddress: entry["tokenAddress"],
6507
- ...entry["keyId"] !== void 0 ? { keyId: entry["keyId"] } : {}
6544
+ ...entry["keyId"] !== void 0 ? { keyId: entry["keyId"] } : {},
6545
+ ...settlementOptions !== void 0 ? { settlementOptions } : {}
6508
6546
  };
6509
6547
  }
6510
6548
  if (chainType === "solana") {
@@ -6814,7 +6852,14 @@ var ConnectorConfigGenerator = class {
6814
6852
  rpcUrl: p.rpcUrl,
6815
6853
  registryAddress: p.registryAddress,
6816
6854
  tokenAddress: p.tokenAddress,
6817
- ...p.keyId !== void 0 ? { keyId: p.keyId } : {}
6855
+ ...p.keyId !== void 0 ? { keyId: p.keyId } : {},
6856
+ // The connector reads its GLOBAL settlement threshold from the
6857
+ // first EVM chainProvider carrying `settlementOptions`. Pass it
6858
+ // through so operators can lower the threshold below the
6859
+ // per-publish fee and have single paid publishes settle on-chain
6860
+ // (including for Solana/Mina dynamic peers — one defaultThreshold
6861
+ // governs all chains). See EvmChainProvider.settlementOptions.
6862
+ ...p.settlementOptions !== void 0 ? { settlementOptions: p.settlementOptions } : {}
6818
6863
  };
6819
6864
  }
6820
6865
  if (p.chainType === "solana") {
@@ -23003,4 +23048,4 @@ export {
23003
23048
  @scure/bip32/index.js:
23004
23049
  (*! scure-bip32 - MIT License (c) 2022 Patricio Palladino, Paul Miller (paulmillr.com) *)
23005
23050
  */
23006
- //# sourceMappingURL=chunk-UBFITLPQ.js.map
23051
+ //# sourceMappingURL=chunk-SU5NBQ2B.js.map