@interfold/sdk 0.2.0 → 0.2.2

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.
@@ -3,12 +3,14 @@ interface ContractAddresses {
3
3
  ciphernodeRegistry: `0x${string}`;
4
4
  feeToken: `0x${string}`;
5
5
  }
6
+ /** On-chain `IInterfold.CommitteeSize`: Minimum (N=3), Micro (N=9), Small (N=19). */
6
7
  declare enum CommitteeSize {
7
- Micro = 0,
8
- Small = 1,
9
- Medium = 2,
10
- Large = 3
8
+ Minimum = 0,
9
+ Micro = 1,
10
+ Small = 2
11
11
  }
12
+ /** Fail fast on out-of-range committee sizes before they hit the contract. */
13
+ declare function validateCommitteeSize(value: number | CommitteeSize): CommitteeSize;
12
14
  interface E3 {
13
15
  seed: bigint;
14
16
  committeeSize: number;
@@ -61,4 +63,4 @@ declare enum FailureReason {
61
63
  VerificationFailed = 12
62
64
  }
63
65
 
64
- export { type ContractAddresses as C, type E3 as E, FailureReason as F, type E3RequestParams as a, E3Stage as b, CommitteeSize as c };
66
+ export { type ContractAddresses as C, type E3 as E, FailureReason as F, type E3RequestParams as a, E3Stage as b, CommitteeSize as c, validateCommitteeSize as v };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@interfold/sdk",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -39,35 +39,35 @@
39
39
  "url": "https://github.com/gnosisguild/interfold.git",
40
40
  "directory": "packages/interfold-sdk"
41
41
  },
42
+ "scripts": {
43
+ "compile:circuits": "bash scripts/compile-circuits.sh",
44
+ "prebuild": "pnpm -C ../interfold-contracts build && pnpm -C ../../ wasm:build && pnpm compile:circuits",
45
+ "build": "tsup",
46
+ "dev": "tsup --watch",
47
+ "clean": "rm -rf dist",
48
+ "test": "vitest --run",
49
+ "pretest": "pnpm compile:circuits",
50
+ "prerelease": "pnpm clean && pnpm build",
51
+ "release": "pnpm publish --access=public"
52
+ },
42
53
  "devDependencies": {
54
+ "@interfold/config": "^0.2.2",
43
55
  "concurrently": "^9.1.2",
44
56
  "tsup": "^8.5.0",
45
57
  "typescript": "5.8.3",
46
58
  "vite": "^6.2.0",
47
- "vite-plugin-dts": "^4.5.3",
48
- "@interfold/config": "0.2.0"
59
+ "vite-plugin-dts": "^4.5.3"
49
60
  },
50
61
  "dependencies": {
51
62
  "@aztec/bb.js": "3.0.0-nightly.20260102",
52
63
  "@noir-lang/noir_js": "1.0.0-beta.16",
64
+ "@interfold/wasm": "^0.2.2",
65
+ "@interfold/contracts": "^0.2.2",
53
66
  "comlink": "^4.4.2",
54
67
  "viem": "2.30.6",
55
68
  "vite-plugin-top-level-await": "^1.5.0",
56
69
  "vite-plugin-wasm": "^3.4.1",
57
70
  "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"
71
+ "web-worker": "^1.5.0"
72
72
  }
73
- }
73
+ }
package/LICENSE.md DELETED
@@ -1,134 +0,0 @@
1
- GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007
2
-
3
- Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/> Everyone is permitted to copy
4
- and distribute verbatim copies of this license document, but changing it is not allowed.
5
-
6
- This version of the GNU Lesser General Public License incorporates the terms and conditions of
7
- version 3 of the GNU General Public License, supplemented by the additional permissions listed
8
- below.
9
-
10
- 0. Additional Definitions.
11
-
12
- As used herein, "this License" refers to version 3 of the GNU Lesser General Public License, and the
13
- "GNU GPL" refers to version 3 of the GNU General Public License.
14
-
15
- "The Library" refers to a covered work governed by this License, other than an Application or a
16
- Combined Work as defined below.
17
-
18
- An "Application" is any work that makes use of an interface provided by the Library, but which is
19
- not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed
20
- a mode of using an interface provided by the Library.
21
-
22
- A "Combined Work" is a work produced by combining or linking an Application with the Library. The
23
- particular version of the Library with which the Combined Work was made is also called the "Linked
24
- Version".
25
-
26
- The "Minimal Corresponding Source" for a Combined Work means the Corresponding Source for the
27
- Combined Work, excluding any source code for portions of the Combined Work that, considered in
28
- isolation, are based on the Application, and not on the Linked Version.
29
-
30
- The "Corresponding Application Code" for a Combined Work means the object code and/or source code
31
- for the Application, including any data and utility programs needed for reproducing the Combined
32
- Work from the Application, but excluding the System Libraries of the Combined Work.
33
-
34
- 1. Exception to Section 3 of the GNU GPL.
35
-
36
- You may convey a covered work under sections 3 and 4 of this License without being bound by section
37
- 3 of the GNU GPL.
38
-
39
- 2. Conveying Modified Versions.
40
-
41
- If you modify a copy of the Library, and, in your modifications, a facility refers to a function or
42
- data to be supplied by an Application that uses the facility (other than as an argument passed when
43
- the facility is invoked), then you may convey a copy of the modified version:
44
-
45
- a) under this License, provided that you make a good faith effort to ensure that, in the event an
46
- Application does not supply the function or data, the facility still operates, and performs whatever
47
- part of its purpose remains meaningful, or
48
-
49
- b) under the GNU GPL, with none of the additional permissions of this License applicable to that
50
- copy.
51
-
52
- 3. Object Code Incorporating Material from Library Header Files.
53
-
54
- The object code form of an Application may incorporate material from a header file that is part of
55
- the Library. You may convey such object code under terms of your choice, provided that, if the
56
- incorporated material is not limited to numerical parameters, data structure layouts and accessors,
57
- or small macros, inline functions and templates (ten or fewer lines in length), you do both of the
58
- following:
59
-
60
- a) Give prominent notice with each copy of the object code that the Library is used in it and that
61
- the Library and its use are covered by this License.
62
-
63
- b) Accompany the object code with a copy of the GNU GPL and this license document.
64
-
65
- 4. Combined Works.
66
-
67
- You may convey a Combined Work under terms of your choice that, taken together, effectively do not
68
- restrict modification of the portions of the Library contained in the Combined Work and reverse
69
- engineering for debugging such modifications, if you also do each of the following:
70
-
71
- a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that
72
- the Library and its use are covered by this License.
73
-
74
- b) Accompany the Combined Work with a copy of the GNU GPL and this license document.
75
-
76
- c) For a Combined Work that displays copyright notices during execution, include the copyright
77
- notice for the Library among these notices, as well as a reference directing the user to the copies
78
- of the GNU GPL and this license document.
79
-
80
- d) Do one of the following:
81
-
82
- 0) Convey the Minimal Corresponding Source under the terms of this
83
- License, and the Corresponding Application Code in a form
84
- suitable for, and under terms that permit, the user to
85
- recombine or relink the Application with a modified version of
86
- the Linked Version to produce a modified Combined Work, in the
87
- manner specified by section 6 of the GNU GPL for conveying
88
- Corresponding Source.
89
-
90
- 1) Use a suitable shared library mechanism for linking with the
91
- Library. A suitable mechanism is one that (a) uses at run time
92
- a copy of the Library already present on the user's computer
93
- system, and (b) will operate properly with a modified version
94
- of the Library that is interface-compatible with the Linked
95
- Version.
96
-
97
- e) Provide Installation Information, but only if you would otherwise be required to provide such
98
- information under section 6 of the GNU GPL, and only to the extent that such information is
99
- necessary to install and execute a modified version of the Combined Work produced by recombining or
100
- relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the
101
- Installation Information must accompany the Minimal Corresponding Source and Corresponding
102
- Application Code. If you use option 4d1, you must provide the Installation Information in the manner
103
- specified by section 6 of the GNU GPL for conveying Corresponding Source.)
104
-
105
- 5. Combined Libraries.
106
-
107
- You may place library facilities that are a work based on the Library side by side in a single
108
- library together with other library facilities that are not Applications and are not covered by this
109
- License, and convey such a combined library under terms of your choice, if you do both of the
110
- following:
111
-
112
- a) Accompany the combined library with a copy of the same work based on the Library, uncombined with
113
- any other library facilities, conveyed under the terms of this License.
114
-
115
- b) Give prominent notice with the combined library that part of it is a work based on the Library,
116
- and explaining where to find the accompanying uncombined form of the same work.
117
-
118
- 6. Revised Versions of the GNU Lesser General Public License.
119
-
120
- The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General
121
- Public License from time to time. Such new versions will be similar in spirit to the present
122
- version, but may differ in detail to address new problems or concerns.
123
-
124
- Each version is given a distinguishing version number. If the Library as you received it specifies
125
- that a certain numbered version of the GNU Lesser General Public License "or any later version"
126
- applies to it, you have the option of following the terms and conditions either of that published
127
- version or of any later version published by the Free Software Foundation. If the Library as you
128
- received it does not specify a version number of the GNU Lesser General Public License, you may
129
- choose any version of the GNU Lesser General Public License ever published by the Free Software
130
- Foundation.
131
-
132
- If the Library as you received it specifies that a proxy can decide whether future versions of the
133
- GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any
134
- version is permanent authorization for you to choose that version for the Library.