@inversealtruism/cairn-cli 0.3.6 → 0.3.7

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.
@@ -10,15 +10,15 @@
10
10
  // • exact human↔base-unit amount math as STRING/BigInt arithmetic — floats never touch
11
11
  // token amounts (no "1.1 * 1e8 = 110000000.00000001" class of bug, no silent truncation).
12
12
  import { sha256Hex } from "./item.js";
13
- import { canonicalJson } from "@inversealtruism/csd-codec";
14
- export const CAIRNX_DOMAIN = "cairnx:v1";
15
- export const CAIRNX_ANCHOR_FEE = 25_000_000; // 0.25 CSD the consensus min Propose fee that anchors a record
16
- export const MAX_AMOUNT = (1n << 96n) - 1n; // CONVENTION.md: token amounts are 96-bit
17
- const MAX_RECORD_BYTES = 512; // consensus MAX_URI_BYTES the record must fit in `uri`
18
- // Validation shapes (mirrors CONVENTION.md §4 — kept in sync by the byte-exact fixtures).
19
- export const TICKER_RE = /^[A-Z][A-Z0-9]{2,11}$/;
20
- export const NAME_RE = /^[a-z0-9](?:[a-z0-9-]{0,30}[a-z0-9])?$/; // a claimable .csd name
21
- const ADDR_RE = /^0x[0-9a-f]{40}$/; // records carry LOWERCASE addresses
13
+ import { canonicalJson, MIN_FEE_PROPOSE } from "@inversealtruism/csd-codec";
14
+ // Consensus shapes/constants are IMPORTED from cairnx-core, not hand-declared (shared-core de-dup,
15
+ // cairn docs/Plans/46): they validate a record BEFORE the CLI spends the anchor fee, so a drifted regex /
16
+ // limit would build a record the resolver no-ops (a lost fee). One source = the published convention.
17
+ import { DOMAIN, TICKER_RE, NAME_RE, ADDR_RE, MAX_AMOUNT, MAX_RECORD_BYTES } from "@inversealtruism/cairnx-core";
18
+ export const CAIRNX_DOMAIN = DOMAIN; // "cairnx:v1"
19
+ export const CAIRNX_ANCHOR_FEE = MIN_FEE_PROPOSE; // 0.25 CSD — the consensus min Propose fee that anchors a record
20
+ // re-export the §4 shapes the CLI's public surface exposed (now single-sourced from cairnx-core)
21
+ export { TICKER_RE, NAME_RE, MAX_AMOUNT };
22
22
  export function buildTransferRecord(p) {
23
23
  const to = String(p.to).toLowerCase();
24
24
  if (!TICKER_RE.test(p.ticker))
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inversealtruism/cairn-cli",
3
- "version": "0.3.6",
3
+ "version": "0.3.7",
4
4
  "description": "CLI for Compute Substrate / Cairn — browse the board/wall/network, and send CSD, propose, attest, and place stones non-custodially by driving your own installed `csd` wallet (cairn never holds your key; works node-less via the Cairn proxy).",
5
5
  "type": "module",
6
6
  "bin": {
@@ -41,6 +41,7 @@
41
41
  "typescript": "^5.7.2"
42
42
  },
43
43
  "dependencies": {
44
+ "@inversealtruism/cairnx-core": "0.1.20",
44
45
  "@inversealtruism/csd-codec": "0.1.14",
45
46
  "@inversealtruism/csd-registry": "0.1.14"
46
47
  }