@cardanowall/sdk-ts 0.1.0 → 0.3.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/README.md +14 -14
- package/dist/client/index.cjs +1621 -1538
- package/dist/client/index.cjs.map +1 -1
- package/dist/client/index.d.cts +52 -52
- package/dist/client/index.d.ts +52 -52
- package/dist/client/index.js +1620 -1537
- package/dist/client/index.js.map +1 -1
- package/dist/conformance/cli.cjs +2367 -2106
- package/dist/conformance/cli.cjs.map +1 -1
- package/dist/conformance/cli.js +2367 -2106
- package/dist/conformance/cli.js.map +1 -1
- package/dist/identity/index.cjs +219 -104
- package/dist/identity/index.cjs.map +1 -1
- package/dist/identity/index.d.cts +1 -1
- package/dist/identity/index.d.ts +1 -1
- package/dist/identity/index.js +219 -104
- package/dist/identity/index.js.map +1 -1
- package/dist/ids/index.cjs.map +1 -1
- package/dist/ids/index.js.map +1 -1
- package/dist/index.cjs +2808 -2530
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2805 -2527
- package/dist/index.js.map +1 -1
- package/dist/merkle/index.cjs +1 -1
- package/dist/merkle/index.cjs.map +1 -1
- package/dist/merkle/index.js +1 -1
- package/dist/merkle/index.js.map +1 -1
- package/dist/{types-BQMtbRCb.d.cts → types-DGsZTMuZ.d.cts} +6 -6
- package/dist/{types-BQMtbRCb.d.ts → types-DGsZTMuZ.d.ts} +6 -6
- package/dist/verifier/index.cjs +2368 -2107
- package/dist/verifier/index.cjs.map +1 -1
- package/dist/verifier/index.d.cts +3 -3
- package/dist/verifier/index.d.ts +3 -3
- package/dist/verifier/index.js +2369 -2108
- package/dist/verifier/index.js.map +1 -1
- package/package.json +8 -8
package/README.md
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
# @cardanowall/sdk-ts — the TypeScript SDK for
|
|
1
|
+
# @cardanowall/sdk-ts — the TypeScript SDK for Label 309 Proof-of-Existence
|
|
2
2
|
|
|
3
|
-
The browser + Node TypeScript SDK for [
|
|
3
|
+
The browser + Node TypeScript SDK for [Label 309](https://cips.cardano.org/) Proof-of-Existence on Cardano: a **standalone verifier** (three roles), a **gateway-agnostic HTTP client**, **off-host signing** helpers, and **seed-derived identity** helpers.
|
|
4
4
|
|
|
5
5
|
## What it is
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Label 309 anchors a content hash on Cardano under metadata label 309 so that anyone can later prove "this content existed on or before block time T" — without trusting any server, domain, or issuer identity. This package is the high-level TypeScript surface over that standard:
|
|
8
8
|
|
|
9
|
-
- **Verify** any
|
|
10
|
-
- **Publish, read, and decrypt** records against **any**
|
|
9
|
+
- **Verify** any Label 309 transaction from chain metadata alone — no issuer server in the trust path.
|
|
10
|
+
- **Publish, read, and decrypt** records against **any** Label 309 gateway (you supply the base URL and an opaque key).
|
|
11
11
|
- **Sign** records off-host (AWS KMS, GCP HSM, YubiHSM, air-gapped) — the private key never touches the SDK.
|
|
12
12
|
- **Derive identity** keypairs, recipient strings, signers, and sealed-PoE decryption from a single 32-byte seed.
|
|
13
13
|
|
|
@@ -44,7 +44,7 @@ const report = await verifyTx({
|
|
|
44
44
|
|
|
45
45
|
console.log(report.verdict); // 'valid' | 'pending' | 'failed'
|
|
46
46
|
console.log(report.exit_code); // 0 valid · 1 integrity fail · 2 network fail · 3 pending
|
|
47
|
-
console.log(report.record); // the decoded
|
|
47
|
+
console.log(report.record); // the decoded Label 309 PoeRecord
|
|
48
48
|
```
|
|
49
49
|
|
|
50
50
|
To decrypt a sealed PoE addressed to you, run at the **recipient-sealed** profile and supply your X25519 private key per item index:
|
|
@@ -68,11 +68,11 @@ When you already hold the metadata bytes from an indexer mirror, skip the chain
|
|
|
68
68
|
`baseUrl` is **required** — the client binds to no particular deployment. `apiKey`, when present, is an **opaque** bearer token forwarded verbatim as `Authorization: Bearer <apiKey>`; the SDK never parses or assumes its format. Omit it for anonymous read-only use.
|
|
69
69
|
|
|
70
70
|
```ts
|
|
71
|
-
import {
|
|
71
|
+
import { Label309Client } from '@cardanowall/sdk-ts';
|
|
72
72
|
|
|
73
|
-
const client = new
|
|
74
|
-
baseUrl: 'https://gateway.example.com', // any
|
|
75
|
-
apiKey: process.env.
|
|
73
|
+
const client = new Label309Client({
|
|
74
|
+
baseUrl: 'https://gateway.example.com', // any Label 309 gateway
|
|
75
|
+
apiKey: process.env.LABEL309_API_KEY, // opaque; omit for anonymous reads
|
|
76
76
|
});
|
|
77
77
|
|
|
78
78
|
// Read surface — no auth required for public records.
|
|
@@ -158,11 +158,11 @@ Everything is reachable from the package root; submodule entry points (`/verifie
|
|
|
158
158
|
|
|
159
159
|
**Client** (`/client`)
|
|
160
160
|
|
|
161
|
-
- `
|
|
161
|
+
- `Label309Client({ baseUrl, apiKey?, fetch? })` — `baseUrl` required, key opaque.
|
|
162
162
|
- `client.poe.{quote, publishContent, publishPrehashed, publishSealed, publishMerkle, uploads, publish, publishBatch}`.
|
|
163
163
|
- `client.records.{get, verify}`, `client.inbox.{list, get}`, `client.account.balance()`.
|
|
164
164
|
- Off-host signing: `prepareSigStructure`, `assembleCoseSign1`, plus the CIP-8 hashed-mode pair `prepareSigStructureHashed` / `assembleCoseSign1Hashed`.
|
|
165
|
-
- Typed errors extending `
|
|
165
|
+
- Typed errors extending `Label309HttpError`: `InsufficientFundsError`, `QuoteExpiredError`, `QuoteAlreadyConsumedError`, `FxStaleError`, `RateLimitedError`, `UnauthorizedError`, `ValidationFailedError`, `MalformedCborError`, `InvalidClientConfigError`, and more.
|
|
166
166
|
|
|
167
167
|
**Identity** (`/identity`)
|
|
168
168
|
|
|
@@ -197,12 +197,12 @@ The verifier, the structural validator, the sealed-PoE construction, the off-hos
|
|
|
197
197
|
|
|
198
198
|
## Standard & service independence
|
|
199
199
|
|
|
200
|
-
A
|
|
200
|
+
A Label 309 proof verifies from three inputs only: the **transaction metadata**, optionally the **content bytes**, and a **public blockchain explorer**. No issuer server sits in the trust path. `verifyTx` reaches only the gateway chains you pass it, routes every outbound request through a single auditable egress point (every call lands in `VerifyReport.http_calls`), and enforces a deny-host policy — so the standalone verifier can be pointed at any infrastructure and still produce a trustworthy verdict.
|
|
201
201
|
|
|
202
202
|
## Relation to the other packages
|
|
203
203
|
|
|
204
204
|
- **`@cardanowall/crypto-core`** — closed-catalogue cryptographic primitives (hash, KDF, signature, KEM, AEAD, CBOR, COSE, sealed-PoE, Merkle, recipient encoding, seed derivation). The building blocks this SDK is built on.
|
|
205
|
-
- **`@cardanowall/poe-standard`** — the
|
|
205
|
+
- **`@cardanowall/poe-standard`** — the Label 309 wire-format library: record schema, canonical-CBOR encoder, pure structural validator, error-code catalogue.
|
|
206
206
|
- **`@cardanowall/sdk-py`** — the Python SDK: a byte-identical parity twin of this package, validated against the same canonical-CBOR vectors.
|
|
207
207
|
- **`cardanowall`** (Rust crate) — the Rust SDK: the byte-parity twin in Rust, blocking HTTP, secure-by-default egress. The `cardanowall` CLI is built on it.
|
|
208
208
|
|