veilix-sdk 0.0.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.
@@ -0,0 +1,46 @@
1
+ /** npm package name (used to load the standalone circuits module). */
2
+ declare const PACKAGE_NAME: string;
3
+ /** Withdraw circuit artifact filenames (published under `veilix-sdk/circuits/`). */
4
+ declare const WITHDRAW_CIRCUIT_WASM = "withdraw.wasm";
5
+ declare const WITHDRAW_CIRCUIT_ZKEY = "withdraw.zkey";
6
+ /**
7
+ * Pinned SHA-256 hashes for the published withdraw circuit artifacts.
8
+ * These are verified in-browser before passing artifacts to snarkjs.
9
+ */
10
+ declare const WITHDRAW_CIRCUIT_SHA256: {
11
+ readonly wasm: "2565a8dd94b0b3cb9ec6d415933ab05ed5d32ac07165b71be6bcf31615fc0330";
12
+ readonly zkey: "64a4d915099f6fe6bfa06e151c254843be8773c7991c742260019dc5184e5d82";
13
+ };
14
+ /** Optional self-hosted path convention (opt-in via `circuitPathsBase`). */
15
+ declare const SELF_HOSTED_CIRCUIT_BASE = "/circuits/";
16
+ type CircuitPaths = {
17
+ wasm: string;
18
+ zkey: string;
19
+ };
20
+ /** Resolve circuit URLs when the caller knows the package `dist/` root. */
21
+ declare function resolveCircuitPathsFromBase(base: string): CircuitPaths;
22
+ /**
23
+ * Base URL for circuit files on jsDelivr.
24
+ *
25
+ * Pinned to {@link CIRCUIT_CDN_PACKAGE}@{@link CIRCUIT_CDN_VERSION} (not the
26
+ * current SDK version) so the bytes always match {@link WITHDRAW_CIRCUIT_SHA256}.
27
+ * This URL is independent of the consuming app's origin/domain.
28
+ */
29
+ declare function resolveNpmCdnCircuitBase(): string;
30
+ /** Trusted jsDelivr fallback paths for pinned withdraw circuit artifacts. */
31
+ declare function resolveNpmCdnCircuitPaths(): CircuitPaths;
32
+ /**
33
+ * Browser circuit URLs.
34
+ *
35
+ * - Local dev (Vite): `/node_modules/<pkg>/dist/circuits/` — Vite serves node_modules.
36
+ * - Production: pinned, domain-independent jsDelivr CDN (verified by SHA-256 before use).
37
+ *
38
+ * The production default does not depend on the app's own origin/domain, so it
39
+ * works on any deployed host with no copy step. Artifacts are always integrity
40
+ * checked before proving (see {@link WITHDRAW_CIRCUIT_SHA256}). To self-host
41
+ * instead, pass {@link VeilixSdkInitOptions.circuitPathsBase} (e.g. `"/circuits/"`);
42
+ * it is verified too and falls back to the CDN if unavailable.
43
+ */
44
+ declare function resolveBrowserCircuitPaths(baseOverride?: string): CircuitPaths | null;
45
+
46
+ export { type CircuitPaths as C, PACKAGE_NAME as P, SELF_HOSTED_CIRCUIT_BASE as S, WITHDRAW_CIRCUIT_SHA256 as W, WITHDRAW_CIRCUIT_WASM as a, WITHDRAW_CIRCUIT_ZKEY as b, resolveCircuitPathsFromBase as c, resolveNpmCdnCircuitBase as d, resolveNpmCdnCircuitPaths as e, resolveBrowserCircuitPaths as r };
@@ -0,0 +1,46 @@
1
+ /** npm package name (used to load the standalone circuits module). */
2
+ declare const PACKAGE_NAME: string;
3
+ /** Withdraw circuit artifact filenames (published under `veilix-sdk/circuits/`). */
4
+ declare const WITHDRAW_CIRCUIT_WASM = "withdraw.wasm";
5
+ declare const WITHDRAW_CIRCUIT_ZKEY = "withdraw.zkey";
6
+ /**
7
+ * Pinned SHA-256 hashes for the published withdraw circuit artifacts.
8
+ * These are verified in-browser before passing artifacts to snarkjs.
9
+ */
10
+ declare const WITHDRAW_CIRCUIT_SHA256: {
11
+ readonly wasm: "2565a8dd94b0b3cb9ec6d415933ab05ed5d32ac07165b71be6bcf31615fc0330";
12
+ readonly zkey: "64a4d915099f6fe6bfa06e151c254843be8773c7991c742260019dc5184e5d82";
13
+ };
14
+ /** Optional self-hosted path convention (opt-in via `circuitPathsBase`). */
15
+ declare const SELF_HOSTED_CIRCUIT_BASE = "/circuits/";
16
+ type CircuitPaths = {
17
+ wasm: string;
18
+ zkey: string;
19
+ };
20
+ /** Resolve circuit URLs when the caller knows the package `dist/` root. */
21
+ declare function resolveCircuitPathsFromBase(base: string): CircuitPaths;
22
+ /**
23
+ * Base URL for circuit files on jsDelivr.
24
+ *
25
+ * Pinned to {@link CIRCUIT_CDN_PACKAGE}@{@link CIRCUIT_CDN_VERSION} (not the
26
+ * current SDK version) so the bytes always match {@link WITHDRAW_CIRCUIT_SHA256}.
27
+ * This URL is independent of the consuming app's origin/domain.
28
+ */
29
+ declare function resolveNpmCdnCircuitBase(): string;
30
+ /** Trusted jsDelivr fallback paths for pinned withdraw circuit artifacts. */
31
+ declare function resolveNpmCdnCircuitPaths(): CircuitPaths;
32
+ /**
33
+ * Browser circuit URLs.
34
+ *
35
+ * - Local dev (Vite): `/node_modules/<pkg>/dist/circuits/` — Vite serves node_modules.
36
+ * - Production: pinned, domain-independent jsDelivr CDN (verified by SHA-256 before use).
37
+ *
38
+ * The production default does not depend on the app's own origin/domain, so it
39
+ * works on any deployed host with no copy step. Artifacts are always integrity
40
+ * checked before proving (see {@link WITHDRAW_CIRCUIT_SHA256}). To self-host
41
+ * instead, pass {@link VeilixSdkInitOptions.circuitPathsBase} (e.g. `"/circuits/"`);
42
+ * it is verified too and falls back to the CDN if unavailable.
43
+ */
44
+ declare function resolveBrowserCircuitPaths(baseOverride?: string): CircuitPaths | null;
45
+
46
+ export { type CircuitPaths as C, PACKAGE_NAME as P, SELF_HOSTED_CIRCUIT_BASE as S, WITHDRAW_CIRCUIT_SHA256 as W, WITHDRAW_CIRCUIT_WASM as a, WITHDRAW_CIRCUIT_ZKEY as b, resolveCircuitPathsFromBase as c, resolveNpmCdnCircuitBase as d, resolveNpmCdnCircuitPaths as e, resolveBrowserCircuitPaths as r };