@inversealtruism/cairn-cli 0.3.6 → 0.3.9

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/README.md CHANGED
@@ -82,8 +82,7 @@ Fees and amounts are in **CSD** (e.g. `--amount 1.5`, `--fee 0.05`). Minimums: 0
82
82
 
83
83
  CairnX is the token / DeFi layer that lives entirely in `cairnx:v1` records on-chain
84
84
  (traded at [cairn-substrate.com/trade](https://cairn-substrate.com/trade)). Reads hit the
85
- CairnX state API (`CAIRNX_API` → local service → public gateway); the one write
86
- `token-send` — anchors a canonical transfer record signed by your own `csd` wallet.
85
+ CairnX state API (`CAIRNX_API` → local service → public gateway); the one write, `token-send`, anchors a canonical transfer record signed by your own `csd` wallet.
87
86
 
88
87
  ```bash
89
88
  cairn tokens [address] # token balances (locked shown) + owned .csd names
@@ -124,7 +123,7 @@ signs, and `--dry-run` shows the exact canonical record + hash without signing).
124
123
  state API. `token-send` builds the canonical transfer record locally (`sha256(uri)` is the
125
124
  on-chain commitment, byte-exact-tested against the resolver's own builder), checks your
126
125
  balance, prints the record + the 0.25 CSD anchor cost, then has `csd` sign the anchoring
127
- Propose the same no-key-in-process path as `propose`/`send`.
126
+ Propose, the same no-key-in-process path as `propose`/`send`.
128
127
  - **registry commands** (`gateway register`, `peer announce`, `identity claim`) are the one
129
128
  exception: they sign a registry *binding* with `@inversealtruism/csd-registry`, so cairn-cli reads
130
129
  your private key from `csd wallet config` and signs **in-process** (the key is never networked - only
@@ -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.9",
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.24",
44
45
  "@inversealtruism/csd-codec": "0.1.14",
45
46
  "@inversealtruism/csd-registry": "0.1.14"
46
47
  }