@333eco/heartbank-api 0.0.0-stage → 0.2.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.
@@ -0,0 +1,58 @@
1
+ import { type ClientOptions } from "./runtime.js";
2
+ /** Verify: Check anything we say, from the public logs, free forever, with no account and no key. */
3
+ export declare class VerifyClient {
4
+ private readonly o;
5
+ constructor(o?: ClientOptions);
6
+ /** The latest signed checkpoint: the log's size and root. @see https://developers.333.eco/verify#checkpoint */
7
+ checkpoint(input?: {
8
+ log?: "origin" | "ledger";
9
+ }): Promise<string>;
10
+ /** Every earlier checkpoint, locked (written once, never replaced). @see https://developers.333.eco/verify#checkpointat */
11
+ checkpointAt(input: {
12
+ log?: "origin" | "ledger";
13
+ size: number;
14
+ }): Promise<string>;
15
+ /** A tile of the Merkle tree. @see https://developers.333.eco/verify#tile */
16
+ tile(input: {
17
+ log?: "origin" | "ledger";
18
+ level: number;
19
+ index: string;
20
+ }): Promise<Uint8Array>;
21
+ /** A bundle of the log's entries. @see https://developers.333.eco/verify#entries */
22
+ entries(input: {
23
+ log?: "origin" | "ledger";
24
+ index: string;
25
+ }): Promise<Uint8Array>;
26
+ /** Which checkpoints carry which clock. @see https://developers.333.eco/verify#stampsindex */
27
+ stampsIndex(input?: {
28
+ log?: "origin" | "ledger";
29
+ }): Promise<{
30
+ tsa: Array<number>;
31
+ ots: Array<number>;
32
+ }>;
33
+ /** A timestamp authority's token (RFC 3161) over a checkpoint. @see https://developers.333.eco/verify#timestamptoken */
34
+ timestampToken(input: {
35
+ log?: "origin" | "ledger";
36
+ size: number;
37
+ authority: "aped-gr" | "accv-es" | "freetsa-de";
38
+ }): Promise<Uint8Array>;
39
+ /** An OpenTimestamps proof over a checkpoint, reaching Bitcoin. @see https://developers.333.eco/verify#bitcoinproof */
40
+ bitcoinProof(input: {
41
+ log?: "origin" | "ledger";
42
+ size: number;
43
+ }): Promise<Uint8Array>;
44
+ /** The ledger only: the zero-sum proof over entries from…to. @see https://developers.333.eco/verify#zerosumproof */
45
+ zeroSumProof(input: {
46
+ from: number;
47
+ to: number;
48
+ }): Promise<{
49
+ v: number;
50
+ from: number;
51
+ to: number;
52
+ genesis: string;
53
+ origin?: string;
54
+ circuit: string;
55
+ K: number;
56
+ windows: Array<Record<string, unknown>>;
57
+ }>;
58
+ }
package/dist/verify.js ADDED
@@ -0,0 +1,113 @@
1
+ // Generated by scripts/gen-client.mjs from openapi/verify.json. ⛔ Do not edit: change the description and run npm run client.
2
+ import { send } from "./runtime.js";
3
+ /** Verify: Check anything we say, from the public logs, free forever, with no account and no key. */
4
+ export class VerifyClient {
5
+ o;
6
+ constructor(o = {}) {
7
+ this.o = o;
8
+ }
9
+ /** The latest signed checkpoint: the log's size and root. @see https://developers.333.eco/verify#checkpoint */
10
+ checkpoint(input) {
11
+ return send(this.o, {
12
+ method: "GET",
13
+ base: "https://log.333.eco/{log}".replace(/\{(\w+)\}/g, (_, k) => String({ log: input?.log ?? "origin" }[k])),
14
+ path: "/checkpoint",
15
+ pathParams: undefined,
16
+ query: undefined,
17
+ headers: undefined,
18
+ security: "none",
19
+ accept: "text",
20
+ });
21
+ }
22
+ /** Every earlier checkpoint, locked (written once, never replaced). @see https://developers.333.eco/verify#checkpointat */
23
+ checkpointAt(input) {
24
+ return send(this.o, {
25
+ method: "GET",
26
+ base: "https://log.333.eco/{log}".replace(/\{(\w+)\}/g, (_, k) => String({ log: input?.log ?? "origin" }[k])),
27
+ path: "/checkpoints/{size}",
28
+ pathParams: { size: input.size },
29
+ query: undefined,
30
+ headers: undefined,
31
+ security: "none",
32
+ accept: "text",
33
+ });
34
+ }
35
+ /** A tile of the Merkle tree. @see https://developers.333.eco/verify#tile */
36
+ tile(input) {
37
+ return send(this.o, {
38
+ method: "GET",
39
+ base: "https://log.333.eco/{log}".replace(/\{(\w+)\}/g, (_, k) => String({ log: input?.log ?? "origin" }[k])),
40
+ path: "/tile/{level}/{index}",
41
+ pathParams: { level: input.level, index: input.index },
42
+ query: undefined,
43
+ headers: undefined,
44
+ security: "none",
45
+ accept: "bytes",
46
+ });
47
+ }
48
+ /** A bundle of the log's entries. @see https://developers.333.eco/verify#entries */
49
+ entries(input) {
50
+ return send(this.o, {
51
+ method: "GET",
52
+ base: "https://log.333.eco/{log}".replace(/\{(\w+)\}/g, (_, k) => String({ log: input?.log ?? "origin" }[k])),
53
+ path: "/tile/entries/{index}",
54
+ pathParams: { index: input.index },
55
+ query: undefined,
56
+ headers: undefined,
57
+ security: "none",
58
+ accept: "bytes",
59
+ });
60
+ }
61
+ /** Which checkpoints carry which clock. @see https://developers.333.eco/verify#stampsindex */
62
+ stampsIndex(input) {
63
+ return send(this.o, {
64
+ method: "GET",
65
+ base: "https://log.333.eco/{log}".replace(/\{(\w+)\}/g, (_, k) => String({ log: input?.log ?? "origin" }[k])),
66
+ path: "/stamps/index.json",
67
+ pathParams: undefined,
68
+ query: undefined,
69
+ headers: undefined,
70
+ security: "none",
71
+ accept: "json",
72
+ });
73
+ }
74
+ /** A timestamp authority's token (RFC 3161) over a checkpoint. @see https://developers.333.eco/verify#timestamptoken */
75
+ timestampToken(input) {
76
+ return send(this.o, {
77
+ method: "GET",
78
+ base: "https://log.333.eco/{log}".replace(/\{(\w+)\}/g, (_, k) => String({ log: input?.log ?? "origin" }[k])),
79
+ path: "/stamps/{size}.{authority}.tsr",
80
+ pathParams: { size: input.size, authority: input.authority },
81
+ query: undefined,
82
+ headers: undefined,
83
+ security: "none",
84
+ accept: "bytes",
85
+ });
86
+ }
87
+ /** An OpenTimestamps proof over a checkpoint, reaching Bitcoin. @see https://developers.333.eco/verify#bitcoinproof */
88
+ bitcoinProof(input) {
89
+ return send(this.o, {
90
+ method: "GET",
91
+ base: "https://log.333.eco/{log}".replace(/\{(\w+)\}/g, (_, k) => String({ log: input?.log ?? "origin" }[k])),
92
+ path: "/stamps/{size}.ots",
93
+ pathParams: { size: input.size },
94
+ query: undefined,
95
+ headers: undefined,
96
+ security: "none",
97
+ accept: "bytes",
98
+ });
99
+ }
100
+ /** The ledger only: the zero-sum proof over entries from…to. @see https://developers.333.eco/verify#zerosumproof */
101
+ zeroSumProof(input) {
102
+ return send(this.o, {
103
+ method: "GET",
104
+ base: "https://log.333.eco/ledger",
105
+ path: "/proof/{from}-{to}.json",
106
+ pathParams: { from: input.from, to: input.to },
107
+ query: undefined,
108
+ headers: undefined,
109
+ security: "none",
110
+ accept: "json",
111
+ });
112
+ }
113
+ }
package/package.json CHANGED
@@ -1,6 +1,28 @@
1
1
  {
2
2
  "name": "@333eco/heartbank-api",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.2.0",
4
+ "description": "The typed client for every HeartBank® API (Log in, Sign, Confirm and Thank with HeartBank®, Lookup and Verify), generated from developers.333.eco's OpenAPI descriptions. For your server: it never holds a key.",
5
+ "type": "module",
6
+ "main": "dist/index.js",
7
+ "types": "dist/index.d.ts",
8
+ "files": [
9
+ "dist",
10
+ "README.md",
11
+ "LICENSE",
12
+ "LICENSE-CC0",
13
+ "LICENSE-APACHE"
14
+ ],
15
+ "x-publishing": "Name and license approved by the founder 2026-11-11 (\"CC0-1.0 OR Apache-2.0\": each user picks one). The first publish: approved the same day.",
16
+ "license": "CC0-1.0 OR Apache-2.0",
17
+ "engines": {
18
+ "node": ">=18"
19
+ },
20
+ "homepage": "https://developers.333.eco",
21
+ "keywords": [
22
+ "heartbank",
23
+ "passkey",
24
+ "openid-connect",
25
+ "provenance",
26
+ "gratitude"
27
+ ]
28
+ }