@interfold/sdk 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,64 @@
1
+ interface ContractAddresses {
2
+ interfold: `0x${string}`;
3
+ ciphernodeRegistry: `0x${string}`;
4
+ feeToken: `0x${string}`;
5
+ }
6
+ declare enum CommitteeSize {
7
+ Micro = 0,
8
+ Small = 1,
9
+ Medium = 2,
10
+ Large = 3
11
+ }
12
+ interface E3 {
13
+ seed: bigint;
14
+ committeeSize: number;
15
+ requestBlock: bigint;
16
+ inputWindow: readonly [bigint, bigint];
17
+ encryptionSchemeId: string;
18
+ e3Program: string;
19
+ paramSet: number;
20
+ decryptionVerifier: string;
21
+ committeePublicKey: string;
22
+ ciphertextOutput: string;
23
+ plaintextOutput: string;
24
+ }
25
+ interface RequestParams {
26
+ gasLimit?: bigint;
27
+ }
28
+ interface E3RequestParams extends RequestParams {
29
+ committeeSize: number;
30
+ inputWindow: readonly [bigint, bigint];
31
+ e3Program: `0x${string}`;
32
+ paramSet: number;
33
+ computeProviderParams: `0x${string}`;
34
+ customParams?: `0x${string}`;
35
+ /** When true, ciphernodes generate wrapper/fold proofs for DKG proof aggregation.
36
+ * When false, proof aggregation is skipped for faster computation. Defaults to true. */
37
+ proofAggregationEnabled?: boolean;
38
+ }
39
+ declare enum E3Stage {
40
+ None = 0,
41
+ Requested = 1,
42
+ CommitteeFinalized = 2,
43
+ KeyPublished = 3,
44
+ CiphertextReady = 4,
45
+ Complete = 5,
46
+ Failed = 6
47
+ }
48
+ declare enum FailureReason {
49
+ None = 0,
50
+ CommitteeFormationTimeout = 1,
51
+ InsufficientCommitteeMembers = 2,
52
+ DKGTimeout = 3,
53
+ DKGInvalidShares = 4,
54
+ NoInputsReceived = 5,
55
+ ComputeTimeout = 6,
56
+ ComputeProviderExpired = 7,
57
+ ComputeProviderFailed = 8,
58
+ RequesterCancelled = 9,
59
+ DecryptionTimeout = 10,
60
+ DecryptionInvalidShares = 11,
61
+ VerificationFailed = 12
62
+ }
63
+
64
+ export { type ContractAddresses as C, type E3 as E, FailureReason as F, type E3RequestParams as a, E3Stage as b, CommitteeSize as c };
package/package.json ADDED
@@ -0,0 +1,73 @@
1
+ {
2
+ "name": "@interfold/sdk",
3
+ "version": "0.2.0",
4
+ "type": "module",
5
+ "exports": {
6
+ ".": {
7
+ "types": "./dist/index.d.ts",
8
+ "import": "./dist/index.js",
9
+ "require": "./dist/index.cjs",
10
+ "default": "./dist/index.js"
11
+ },
12
+ "./crypto": {
13
+ "types": "./dist/crypto/index.d.ts",
14
+ "import": "./dist/crypto/index.js",
15
+ "require": "./dist/crypto/index.cjs"
16
+ },
17
+ "./contracts": {
18
+ "types": "./dist/contracts/index.d.ts",
19
+ "import": "./dist/contracts/index.js",
20
+ "require": "./dist/contracts/index.cjs"
21
+ },
22
+ "./events": {
23
+ "types": "./dist/events/index.d.ts",
24
+ "import": "./dist/events/index.js",
25
+ "require": "./dist/events/index.cjs"
26
+ }
27
+ },
28
+ "main": "./dist/index.cjs",
29
+ "module": "./dist/index.js",
30
+ "types": "./dist/index.d.ts",
31
+ "files": [
32
+ "dist"
33
+ ],
34
+ "publishConfig": {
35
+ "access": "public"
36
+ },
37
+ "repository": {
38
+ "type": "git",
39
+ "url": "https://github.com/gnosisguild/interfold.git",
40
+ "directory": "packages/interfold-sdk"
41
+ },
42
+ "devDependencies": {
43
+ "concurrently": "^9.1.2",
44
+ "tsup": "^8.5.0",
45
+ "typescript": "5.8.3",
46
+ "vite": "^6.2.0",
47
+ "vite-plugin-dts": "^4.5.3",
48
+ "@interfold/config": "0.2.0"
49
+ },
50
+ "dependencies": {
51
+ "@aztec/bb.js": "3.0.0-nightly.20260102",
52
+ "@noir-lang/noir_js": "1.0.0-beta.16",
53
+ "comlink": "^4.4.2",
54
+ "viem": "2.30.6",
55
+ "vite-plugin-top-level-await": "^1.5.0",
56
+ "vite-plugin-wasm": "^3.4.1",
57
+ "vitest": "^1.6.1",
58
+ "web-worker": "^1.5.0",
59
+ "@interfold/wasm": "0.2.0",
60
+ "@interfold/contracts": "0.2.0"
61
+ },
62
+ "scripts": {
63
+ "compile:circuits": "bash scripts/compile-circuits.sh",
64
+ "prebuild": "pnpm -C ../interfold-contracts build && pnpm -C ../../ wasm:build && pnpm compile:circuits",
65
+ "build": "tsup",
66
+ "dev": "tsup --watch",
67
+ "clean": "rm -rf dist",
68
+ "test": "vitest --run",
69
+ "pretest": "pnpm compile:circuits",
70
+ "prerelease": "pnpm clean && pnpm build",
71
+ "release": "pnpm publish --access=public"
72
+ }
73
+ }