@palliora.org/chainsdk 0.4.0 → 0.5.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.
package/AGENTS.md ADDED
@@ -0,0 +1,61 @@
1
+ # palliora-sdk
2
+
3
+ TypeScript SDK (`@palliora.org/chainsdk`) for the Palliora chain. This is the only
4
+ repository an application developer writes code against.
5
+
6
+ ## Read this first
7
+
8
+ **[CHAIN-RULES.md](CHAIN-RULES.md)** — the behavioural rules of the chain: fees, contract
9
+ types, guardian groups, result submission, error causes. The README tells you which
10
+ function to call; CHAIN-RULES.md tells you what the chain does with it and why a
11
+ well-formed call still gets rejected. Read it before writing compute code. It also ships
12
+ in the npm package, so it is present in `node_modules/@palliora.org/chainsdk/`.
13
+
14
+ Do not infer chain semantics from TypeScript signatures alone — the fee floor, the
15
+ guardian rate thresholds and the two-transaction group protocol are invisible from them.
16
+
17
+ ## Layout
18
+
19
+ | Path | Contents |
20
+ |---|---|
21
+ | `src/config.ts` | `init()` and the accessors every other module reads configuration through |
22
+ | `src/chain/` | API singleton, `signAndSend`, type registrations (`spec.ts`), block/extrinsic helpers |
23
+ | `src/compute/` | `compute.agreement` wrappers, fee estimation (`fees.ts`), inference and data contracts |
24
+ | `src/guardian/` | Guardian list, join, and group creation/reconstruction |
25
+ | `src/da/` | Data availability: submit, upload, register |
26
+ | `src/storage/` | Off-chain artifact storage: provider router and S3 pre-signed upload flow |
27
+ | `src/stake/`, `src/token/`, `src/validator/`, `src/account/` | Staking, transfers, validator and identity operations |
28
+ | `src/crypto/` | Hybrid and threshold encryption helpers |
29
+ | `src/costEstimation/` | Client for the offchain cost-estimation / rate-quote oracle |
30
+ | `scripts/` | Manual end-to-end test scripts against a live chain — useful as worked examples, but not all are current |
31
+ | `demos/sealed-bid-auction/` | Complete worked application: guardian group, encrypted inputs, compute, result |
32
+
33
+ ## Facts that are easy to get wrong
34
+
35
+ - The SDK reads no environment variables. Everything comes from `init()`, and each
36
+ accessor throws when its value was never supplied — there are no fallback defaults.
37
+ Nothing works until a host calls `init()`; `getApi()` throws rather than returning
38
+ `undefined` when it has not.
39
+ - `src/chain/spec.ts` is the manual type registry. When a chain type changes, it must be
40
+ updated by hand — it is the most likely thing to be stale. See CHAIN-RULES.md §6.
41
+ - Amounts in `Fee` are *human* PALI strings; everything read from the chain is atomic.
42
+ - `getGuardianParticipants()` disconnects the shared API in its `finally` block.
43
+
44
+ ## Working here
45
+
46
+ ```bash
47
+ pnpm install
48
+ pnpm build # tsup
49
+ pnpm lint # eslint
50
+ npx tsc --noEmit # typecheck
51
+ ```
52
+
53
+ There is no test suite. `scripts/*.mjs` are run manually against a chain and are the
54
+ closest thing to integration coverage.
55
+
56
+ ## Related repositories
57
+
58
+ - [`palliora`](https://github.com/palliora-org/palliora) — the chain. Authoritative for
59
+ every rule in CHAIN-RULES.md.
60
+ - `compute-core` — orchestrator and result relay. Node-operator infrastructure; executes
61
+ the jobs this SDK requests and submits their results.