@inversealtruism/cairn-sdk 0.3.2 → 0.4.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@inversealtruism/cairn-sdk",
3
- "version": "0.3.2",
3
+ "version": "0.4.1",
4
4
  "description": "The Compute Substrate dApp kit — one cohesive toolkit to connect the Cairn Wallet, read the chain/board, publish self-certifying content, and resolve registries. Composes the published csd-* primitives.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -58,43 +58,24 @@
58
58
  "LICENSE",
59
59
  "README.md"
60
60
  ],
61
- "scripts": {
62
- "build": "tsup src/index.ts src/connect.ts src/board.ts src/indexer.ts src/content.ts src/registry.ts src/chain.ts src/controller.ts src/react.ts --format esm,cjs --dts --clean",
63
- "test": "node test/run.mjs",
64
- "test:live": "node examples/read-only.mjs",
65
- "build:example": "node scripts/build-example.mjs",
66
- "clean": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\"",
67
- "test:e2e:read": "node test/e2e/e2e-read.mjs",
68
- "test:e2e:wallet": "xvfb-run -a node test/e2e/e2e-wallet-connect.mjs",
69
- "test:e2e:write": "node test/e2e/e2e-write.mjs",
70
- "test:e2e": "node test/e2e/e2e-read.mjs && xvfb-run -a node test/e2e/e2e-wallet-connect.mjs",
71
- "test:all": "pnpm test && pnpm test:e2e",
72
- "prepublishOnly": "npm run build && npm test"
73
- },
74
61
  "dependencies": {
75
- "@inversealtruism/cairnx-core": "0.1.38",
62
+ "@inversealtruism/cairnx-core": "0.1.41",
76
63
  "@inversealtruism/csd-client": "0.1.15",
77
- "@inversealtruism/csd-codec": "0.1.15",
64
+ "@inversealtruism/csd-codec": "0.1.16",
78
65
  "@inversealtruism/csd-crypto": "0.1.15",
79
- "@inversealtruism/csd-light": "0.1.18",
80
- "@inversealtruism/csd-registry": "0.1.16",
66
+ "@inversealtruism/csd-light": "0.1.19",
67
+ "@inversealtruism/csd-registry": "0.1.17",
81
68
  "@inversealtruism/csd-tx": "0.1.17"
82
69
  },
83
70
  "devDependencies": {
71
+ "@inversealtruism/csd-siwc": "0.1.16",
84
72
  "esbuild": "^0.27.0",
85
73
  "playwright-core": "^1.49.0",
86
74
  "tsup": "^8.5.1",
87
75
  "tsx": "^4.19.2",
88
- "typescript": "^5.6.0",
89
- "@inversealtruism/csd-siwc": "0.1.15"
76
+ "typescript": "^5.6.0"
90
77
  },
91
78
  "sideEffects": false,
92
- "packageManager": "pnpm@10.32.1",
93
- "pnpm": {
94
- "onlyBuiltDependencies": [
95
- "esbuild"
96
- ]
97
- },
98
79
  "license": "MIT",
99
80
  "publishConfig": {
100
81
  "access": "public"
@@ -112,5 +93,17 @@
112
93
  "dapp",
113
94
  "sdk",
114
95
  "blockchain"
115
- ]
116
- }
96
+ ],
97
+ "scripts": {
98
+ "build": "tsup src/index.ts src/connect.ts src/board.ts src/indexer.ts src/content.ts src/registry.ts src/chain.ts src/controller.ts src/react.ts --format esm,cjs --dts --clean",
99
+ "test": "node test/run.mjs",
100
+ "test:live": "node examples/read-only.mjs",
101
+ "build:example": "node scripts/build-example.mjs",
102
+ "clean": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\"",
103
+ "test:e2e:read": "node test/e2e/e2e-read.mjs",
104
+ "test:e2e:wallet": "xvfb-run -a node test/e2e/e2e-wallet-connect.mjs",
105
+ "test:e2e:write": "node test/e2e/e2e-write.mjs",
106
+ "test:e2e": "node test/e2e/e2e-read.mjs && xvfb-run -a node test/e2e/e2e-wallet-connect.mjs",
107
+ "test:all": "pnpm test && pnpm test:e2e"
108
+ }
109
+ }
@@ -1,69 +0,0 @@
1
- // src/registry.ts
2
- import {
3
- discoverPeers,
4
- discoverGateways,
5
- resolveName,
6
- reverseName,
7
- fromRecords
8
- } from "@inversealtruism/csd-registry";
9
- import {
10
- fromRecords as fromRecords2,
11
- verifyPeer as verifyPeer2,
12
- verifyGateway as verifyGateway2,
13
- verifyIdentitySig as verifyIdentitySig2,
14
- DOMAINS as DOMAINS2,
15
- buildPeerRecord,
16
- buildGatewayRecord,
17
- buildIdentityCommit,
18
- buildIdentityReveal,
19
- epochOf
20
- } from "@inversealtruism/csd-registry";
21
- var RegistryClient = class {
22
- src;
23
- constructor(opts) {
24
- this.src = { baseUrl: opts.baseUrl.replace(/\/+$/, ""), fetch: opts.fetch };
25
- }
26
- /** Discover ranked content/pin gateways (GET /registry/gateways). */
27
- gateways() {
28
- return discoverGateways(this.src);
29
- }
30
- /** Discover ranked libp2p peers (GET /registry/peers). */
31
- peers() {
32
- return discoverPeers(this.src);
33
- }
34
- /**
35
- * Resolve a handle → identity (GET /identity/:handle). Returns null if unresolved.
36
- *
37
- * ⚠ TRUST (CAIRN-SDK-RESOLVE-VERIFIED-FOOTGUN): the returned `verified` flag is the INDEXER's assertion,
38
- * NOT a client-side proof. A hostile/compromised indexer (or a MITM of the read proxy) can return
39
- * `verified:true` for a wrong address. Do NOT use this directly as a payee/login target without either (a)
40
- * recomputing from raw records via `fromRecords.name(...)`, or (b) cross-checking a second independent
41
- * source (the wallet's namespv union cure). Treat `verified` here as a hint, not a guarantee.
42
- */
43
- resolveName(handle) {
44
- return resolveName(this.src, handle);
45
- }
46
- /** Reverse-resolve an address → identity (GET /address/:addr/identity).
47
- * ⚠ Same indexer-trust caveat as resolveName — `verified` is the indexer's claim, not a client proof. */
48
- reverseName(address) {
49
- return reverseName(this.src, address);
50
- }
51
- /** The deterministic, client-side resolvers (recompute from raw ChainRecord[]). */
52
- get fromRecords() {
53
- return fromRecords;
54
- }
55
- };
56
-
57
- export {
58
- RegistryClient,
59
- fromRecords2 as fromRecords,
60
- verifyPeer2 as verifyPeer,
61
- verifyGateway2 as verifyGateway,
62
- verifyIdentitySig2 as verifyIdentitySig,
63
- DOMAINS2 as DOMAINS,
64
- buildPeerRecord,
65
- buildGatewayRecord,
66
- buildIdentityCommit,
67
- buildIdentityReveal,
68
- epochOf
69
- };