@sig-net/midnight 0.0.5 → 0.0.7
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 +8 -0
- package/dist/constants.d.ts +4 -16
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +4 -16
- package/dist/constants.js.map +1 -1
- package/dist/ecdsa-attestation.d.ts +79 -0
- package/dist/ecdsa-attestation.d.ts.map +1 -0
- package/dist/ecdsa-attestation.js +140 -0
- package/dist/ecdsa-attestation.js.map +1 -0
- package/dist/epsilon-derivation.d.ts +60 -0
- package/dist/epsilon-derivation.d.ts.map +1 -1
- package/dist/epsilon-derivation.js +106 -5
- package/dist/epsilon-derivation.js.map +1 -1
- package/dist/index.d.ts +9 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -7
- package/dist/index.js.map +1 -1
- package/dist/managed/compiler/contract-info.json +70 -95
- package/dist/managed/compiler/contract-manifest.json +8 -8
- package/dist/managed/contract/index.d.ts +38 -42
- package/dist/managed/contract/index.js +225 -478
- package/dist/managed/contract/index.js.map +2 -2
- package/dist/signature-requests-state-reader.d.ts +14 -13
- package/dist/signature-requests-state-reader.d.ts.map +1 -1
- package/dist/signature-requests-state-reader.js +31 -20
- package/dist/signature-requests-state-reader.js.map +1 -1
- package/dist/signature-response-verification.d.ts +5 -5
- package/dist/signature-response-verification.d.ts.map +1 -1
- package/dist/signature-response-verification.js +4 -4
- package/dist/signature-response-verification.js.map +1 -1
- package/dist/signet-contract-state-reader.d.ts +102 -109
- package/dist/signet-contract-state-reader.d.ts.map +1 -1
- package/dist/signet-contract-state-reader.js +125 -119
- package/dist/signet-contract-state-reader.js.map +1 -1
- package/dist/signet-request-feed.d.ts +4 -3
- package/dist/signet-request-feed.d.ts.map +1 -1
- package/dist/signet-request-feed.js +9 -8
- package/dist/signet-request-feed.js.map +1 -1
- package/dist/signet-request-resolver.d.ts +6 -4
- package/dist/signet-request-resolver.d.ts.map +1 -1
- package/dist/signet-request-resolver.js +8 -6
- package/dist/signet-request-resolver.js.map +1 -1
- package/dist/signet-request-response-reader.d.ts +21 -20
- package/dist/signet-request-response-reader.d.ts.map +1 -1
- package/dist/signet-request-response-reader.js +35 -23
- package/dist/signet-request-response-reader.js.map +1 -1
- package/dist/signet-requests.d.ts +93 -59
- package/dist/signet-requests.d.ts.map +1 -1
- package/dist/signet-requests.js +84 -67
- package/dist/signet-requests.js.map +1 -1
- package/package.json +2 -2
- package/src/Signet.compact +275 -413
- package/src/circuits.compact +24 -25
- package/dist/schnorr.d.ts +0 -100
- package/dist/schnorr.d.ts.map +0 -1
- package/dist/schnorr.js +0 -144
- package/dist/schnorr.js.map +0 -1
- package/src/Schnorr.compact +0 -63
|
@@ -1,104 +1,115 @@
|
|
|
1
1
|
import * as __compactRuntime from '@midnight-ntwrk/compact-runtime';
|
|
2
2
|
__compactRuntime.checkRuntimeVersion('0.18.0-rc.1');
|
|
3
3
|
|
|
4
|
-
const _descriptor_0 =
|
|
4
|
+
const _descriptor_0 = __compactRuntime.CompactTypeSecp256k1Point;
|
|
5
5
|
|
|
6
|
-
const _descriptor_1 = new __compactRuntime.CompactTypeBytes(
|
|
6
|
+
const _descriptor_1 = new __compactRuntime.CompactTypeBytes(32);
|
|
7
7
|
|
|
8
|
-
const _descriptor_2 = __compactRuntime.
|
|
8
|
+
const _descriptor_2 = new __compactRuntime.CompactTypeBytes(128);
|
|
9
9
|
|
|
10
|
-
const _descriptor_3 = new __compactRuntime.
|
|
10
|
+
const _descriptor_3 = new __compactRuntime.CompactTypeUnsignedInteger(255n, 1);
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
class _RespondBidirectionalEvent_0 {
|
|
13
|
+
alignment() {
|
|
14
|
+
return _descriptor_2.alignment().concat(_descriptor_3.alignment().concat(_descriptor_1.alignment().concat(_descriptor_1.alignment().concat(_descriptor_3.alignment()))));
|
|
15
|
+
}
|
|
16
|
+
fromValue(value_0) {
|
|
17
|
+
return {
|
|
18
|
+
serializedOutput: _descriptor_2.fromValue(value_0),
|
|
19
|
+
outputLen: _descriptor_3.fromValue(value_0),
|
|
20
|
+
r: _descriptor_1.fromValue(value_0),
|
|
21
|
+
s: _descriptor_1.fromValue(value_0),
|
|
22
|
+
recoveryId: _descriptor_3.fromValue(value_0)
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
toValue(value_0) {
|
|
26
|
+
return _descriptor_2.toValue(value_0.serializedOutput).concat(_descriptor_3.toValue(value_0.outputLen).concat(_descriptor_1.toValue(value_0.r).concat(_descriptor_1.toValue(value_0.s).concat(_descriptor_3.toValue(value_0.recoveryId)))));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
13
29
|
|
|
14
|
-
const
|
|
30
|
+
const _descriptor_4 = new _RespondBidirectionalEvent_0();
|
|
15
31
|
|
|
16
|
-
const
|
|
32
|
+
const _descriptor_5 = __compactRuntime.CompactTypeBoolean;
|
|
17
33
|
|
|
18
|
-
const
|
|
34
|
+
const _descriptor_6 = __compactRuntime.CompactTypeSecp256k1Scalar;
|
|
19
35
|
|
|
20
36
|
class _ContractAddress_0 {
|
|
21
37
|
alignment() {
|
|
22
|
-
return
|
|
38
|
+
return _descriptor_1.alignment();
|
|
23
39
|
}
|
|
24
40
|
fromValue(value_0) {
|
|
25
41
|
return {
|
|
26
|
-
bytes:
|
|
42
|
+
bytes: _descriptor_1.fromValue(value_0)
|
|
27
43
|
}
|
|
28
44
|
}
|
|
29
45
|
toValue(value_0) {
|
|
30
|
-
return
|
|
46
|
+
return _descriptor_1.toValue(value_0.bytes);
|
|
31
47
|
}
|
|
32
48
|
}
|
|
33
49
|
|
|
34
|
-
const
|
|
50
|
+
const _descriptor_7 = new _ContractAddress_0();
|
|
35
51
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
class _SignBidirectionalNotification_0 {
|
|
52
|
+
class _SignBidirectionalEventNotification_0 {
|
|
39
53
|
alignment() {
|
|
40
|
-
return
|
|
54
|
+
return _descriptor_3.alignment().concat(_descriptor_2.alignment());
|
|
41
55
|
}
|
|
42
56
|
fromValue(value_0) {
|
|
43
57
|
return {
|
|
44
|
-
version:
|
|
45
|
-
payload:
|
|
58
|
+
version: _descriptor_3.fromValue(value_0),
|
|
59
|
+
payload: _descriptor_2.fromValue(value_0)
|
|
46
60
|
}
|
|
47
61
|
}
|
|
48
62
|
toValue(value_0) {
|
|
49
|
-
return
|
|
63
|
+
return _descriptor_3.toValue(value_0.version).concat(_descriptor_2.toValue(value_0.payload));
|
|
50
64
|
}
|
|
51
65
|
}
|
|
52
66
|
|
|
53
|
-
const
|
|
67
|
+
const _descriptor_8 = new _SignBidirectionalEventNotification_0();
|
|
68
|
+
|
|
69
|
+
const _descriptor_9 = __compactRuntime.CompactTypeSecp256k1Base;
|
|
70
|
+
|
|
71
|
+
const _descriptor_10 = new __compactRuntime.CompactTypeVector(2, _descriptor_1);
|
|
54
72
|
|
|
55
|
-
class
|
|
73
|
+
class _Secp256k1EcdsaSignature_0 {
|
|
56
74
|
alignment() {
|
|
57
|
-
return
|
|
75
|
+
return _descriptor_6.alignment().concat(_descriptor_6.alignment());
|
|
58
76
|
}
|
|
59
77
|
fromValue(value_0) {
|
|
60
78
|
return {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
pk_x: _descriptor_2.fromValue(value_0),
|
|
64
|
-
pk_y: _descriptor_2.fromValue(value_0),
|
|
65
|
-
msg: _descriptor_3.fromValue(value_0)
|
|
79
|
+
r: _descriptor_6.fromValue(value_0),
|
|
80
|
+
s: _descriptor_6.fromValue(value_0)
|
|
66
81
|
}
|
|
67
82
|
}
|
|
68
83
|
toValue(value_0) {
|
|
69
|
-
return
|
|
84
|
+
return _descriptor_6.toValue(value_0.r).concat(_descriptor_6.toValue(value_0.s));
|
|
70
85
|
}
|
|
71
86
|
}
|
|
72
87
|
|
|
73
|
-
const _descriptor_11 = new
|
|
74
|
-
|
|
75
|
-
const _descriptor_12 = new __compactRuntime.CompactTypeVector(2, _descriptor_0);
|
|
76
|
-
|
|
77
|
-
const _descriptor_13 = new __compactRuntime.CompactTypeUnsignedInteger(18446744073709551615n, 8);
|
|
88
|
+
const _descriptor_11 = new _Secp256k1EcdsaSignature_0();
|
|
78
89
|
|
|
79
|
-
const
|
|
90
|
+
const _descriptor_12 = new __compactRuntime.CompactTypeUnsignedInteger(18446744073709551615n, 8);
|
|
80
91
|
|
|
81
92
|
class _Either_0 {
|
|
82
93
|
alignment() {
|
|
83
|
-
return
|
|
94
|
+
return _descriptor_5.alignment().concat(_descriptor_1.alignment().concat(_descriptor_1.alignment()));
|
|
84
95
|
}
|
|
85
96
|
fromValue(value_0) {
|
|
86
97
|
return {
|
|
87
|
-
is_left:
|
|
88
|
-
left:
|
|
89
|
-
right:
|
|
98
|
+
is_left: _descriptor_5.fromValue(value_0),
|
|
99
|
+
left: _descriptor_1.fromValue(value_0),
|
|
100
|
+
right: _descriptor_1.fromValue(value_0)
|
|
90
101
|
}
|
|
91
102
|
}
|
|
92
103
|
toValue(value_0) {
|
|
93
|
-
return
|
|
104
|
+
return _descriptor_5.toValue(value_0.is_left).concat(_descriptor_1.toValue(value_0.left).concat(_descriptor_1.toValue(value_0.right)));
|
|
94
105
|
}
|
|
95
106
|
}
|
|
96
107
|
|
|
97
|
-
const
|
|
108
|
+
const _descriptor_13 = new _Either_0();
|
|
98
109
|
|
|
99
|
-
const
|
|
110
|
+
const _descriptor_14 = new __compactRuntime.CompactTypeUnsignedInteger(340282366920938463463374607431768211455n, 16);
|
|
100
111
|
|
|
101
|
-
const
|
|
112
|
+
const _descriptor_15 = new __compactRuntime.CompactTypeUnsignedInteger(4294967295n, 4);
|
|
102
113
|
|
|
103
114
|
export class Contract {
|
|
104
115
|
witnesses;
|
|
@@ -112,23 +123,17 @@ export class Contract {
|
|
|
112
123
|
}
|
|
113
124
|
this.witnesses = witnesses_0;
|
|
114
125
|
this.circuits = {
|
|
115
|
-
async
|
|
116
|
-
return { result: pureCircuits.
|
|
126
|
+
async constructSignBidirectionalEventNotificationV1(context, ...args_1) {
|
|
127
|
+
return { result: pureCircuits.constructSignBidirectionalEventNotificationV1(...args_1), context };
|
|
117
128
|
},
|
|
118
|
-
async
|
|
119
|
-
return { result: pureCircuits.
|
|
129
|
+
async signetAttestationDigest(context, ...args_1) {
|
|
130
|
+
return { result: pureCircuits.signetAttestationDigest(...args_1), context };
|
|
120
131
|
},
|
|
121
|
-
async
|
|
122
|
-
return { result: pureCircuits.
|
|
132
|
+
async verifyRespondBidirectionalEvent(context, ...args_1) {
|
|
133
|
+
return { result: pureCircuits.verifyRespondBidirectionalEvent(...args_1), context };
|
|
123
134
|
},
|
|
124
|
-
async
|
|
125
|
-
return { result: pureCircuits.
|
|
126
|
-
},
|
|
127
|
-
async assertPathCommitment(context, ...args_1) {
|
|
128
|
-
return { result: pureCircuits.assertPathCommitment(...args_1), context };
|
|
129
|
-
},
|
|
130
|
-
async schnorrChallenge(context, ...args_1) {
|
|
131
|
-
return { result: pureCircuits.schnorrChallenge(...args_1), context };
|
|
135
|
+
async signetKeyHash(context, ...args_1) {
|
|
136
|
+
return { result: pureCircuits.signetKeyHash(...args_1), context };
|
|
132
137
|
}
|
|
133
138
|
};
|
|
134
139
|
this.impureCircuits = {};
|
|
@@ -165,315 +170,142 @@ export class Contract {
|
|
|
165
170
|
currentZswapLocalState: context.callContext.currentZswapLocalState
|
|
166
171
|
}
|
|
167
172
|
}
|
|
168
|
-
|
|
169
|
-
const
|
|
170
|
-
|
|
173
|
+
_hashToSecp256k1Scalar_0(digest_0) {
|
|
174
|
+
const v_0 = Array.from(digest_0, BigInt);
|
|
175
|
+
const beReversed_0 = Uint8Array.from([v_0[31],
|
|
176
|
+
v_0[30],
|
|
177
|
+
v_0[29],
|
|
178
|
+
v_0[28],
|
|
179
|
+
v_0[27],
|
|
180
|
+
v_0[26],
|
|
181
|
+
v_0[25],
|
|
182
|
+
v_0[24],
|
|
183
|
+
v_0[23],
|
|
184
|
+
v_0[22],
|
|
185
|
+
v_0[21],
|
|
186
|
+
v_0[20],
|
|
187
|
+
v_0[19],
|
|
188
|
+
v_0[18],
|
|
189
|
+
v_0[17],
|
|
190
|
+
v_0[16],
|
|
191
|
+
v_0[15],
|
|
192
|
+
v_0[14],
|
|
193
|
+
v_0[13],
|
|
194
|
+
v_0[12],
|
|
195
|
+
v_0[11],
|
|
196
|
+
v_0[10],
|
|
197
|
+
v_0[9],
|
|
198
|
+
v_0[8],
|
|
199
|
+
v_0[7],
|
|
200
|
+
v_0[6],
|
|
201
|
+
v_0[5],
|
|
202
|
+
v_0[4],
|
|
203
|
+
v_0[3],
|
|
204
|
+
v_0[2],
|
|
205
|
+
v_0[1],
|
|
206
|
+
v_0[0]],
|
|
207
|
+
Number);
|
|
208
|
+
return __compactRuntime.convertBytesToField(115792089237316195423570985008687907852837564279074904382605163141518161494336n,
|
|
209
|
+
32,
|
|
210
|
+
beReversed_0,
|
|
211
|
+
'Secp256k1Scalar',
|
|
212
|
+
'<standard library>');
|
|
213
|
+
}
|
|
214
|
+
_secp256k1EcdsaVerify_0(msgHash_0, sig_0, pk_0) {
|
|
215
|
+
const z_0 = this._hashToSecp256k1Scalar_0(msgHash_0);
|
|
216
|
+
const __compact_pattern_tmp1_0 = sig_0;
|
|
217
|
+
const r_0 = __compact_pattern_tmp1_0.r;
|
|
218
|
+
const s_0 = __compact_pattern_tmp1_0.s;
|
|
219
|
+
const w_0 = this._inv_0(s_0);
|
|
220
|
+
const u1_0 = this._mul_0(z_0, w_0);
|
|
221
|
+
const u2_0 = this._mul_0(r_0, w_0);
|
|
222
|
+
const point_0 = this._ecAdd_0(this._ecMulGenerator_0(u1_0),
|
|
223
|
+
this._ecMul_0(pk_0, u2_0));
|
|
224
|
+
return __compactRuntime.convertBytesToField(115792089237316195423570985008687907852837564279074904382605163141518161494336n,
|
|
225
|
+
32,
|
|
226
|
+
__compactRuntime.convertBigintToBytes(32,
|
|
227
|
+
this._secp256k1PointX_0(point_0),
|
|
228
|
+
'<standard library>'),
|
|
229
|
+
'Secp256k1Scalar',
|
|
230
|
+
'<standard library>')
|
|
231
|
+
===
|
|
232
|
+
r_0;
|
|
171
233
|
}
|
|
172
234
|
_persistentHash_0(value_0) {
|
|
173
|
-
const result_0 = __compactRuntime.persistentHash(
|
|
235
|
+
const result_0 = __compactRuntime.persistentHash(_descriptor_10, value_0);
|
|
174
236
|
return result_0;
|
|
175
237
|
}
|
|
176
238
|
_persistentHash_1(value_0) {
|
|
177
|
-
const result_0 = __compactRuntime.persistentHash(
|
|
239
|
+
const result_0 = __compactRuntime.persistentHash(_descriptor_2, value_0);
|
|
178
240
|
return result_0;
|
|
179
241
|
}
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
242
|
+
_persistentHash_2(value_0) {
|
|
243
|
+
const result_0 = __compactRuntime.persistentHash(_descriptor_0, value_0);
|
|
244
|
+
return result_0;
|
|
245
|
+
}
|
|
246
|
+
_mul_0(x_0, y_0) {
|
|
247
|
+
const result_0 = __compactRuntime.secp256k1ScalarMul(x_0, y_0);
|
|
248
|
+
return result_0;
|
|
249
|
+
}
|
|
250
|
+
_inv_0(s_0) {
|
|
251
|
+
const result_0 = __compactRuntime.secp256k1ScalarInv(s_0);
|
|
252
|
+
return result_0;
|
|
253
|
+
}
|
|
254
|
+
_secp256k1PointX_0(pt_0) {
|
|
255
|
+
const result_0 = __compactRuntime.secp256k1PointX(pt_0);
|
|
256
|
+
return result_0;
|
|
257
|
+
}
|
|
258
|
+
_ecAdd_0(a_0, b_0) {
|
|
259
|
+
const result_0 = __compactRuntime.secp256k1Add(a_0, b_0);
|
|
260
|
+
return result_0;
|
|
261
|
+
}
|
|
262
|
+
_ecMul_0(a_0, b_0) {
|
|
263
|
+
const result_0 = __compactRuntime.secp256k1Mul(a_0, b_0);
|
|
264
|
+
return result_0;
|
|
265
|
+
}
|
|
266
|
+
_ecMulGenerator_0(b_0) {
|
|
267
|
+
const result_0 = __compactRuntime.secp256k1MulGenerator(b_0);
|
|
268
|
+
return result_0;
|
|
269
|
+
}
|
|
270
|
+
_constructSignBidirectionalEventNotificationV1_0(callerAddress_0,
|
|
271
|
+
requestsIndexField_0)
|
|
183
272
|
{
|
|
184
273
|
return { version: 1n,
|
|
185
274
|
payload:
|
|
186
275
|
Uint8Array.from([...Array.from(callerAddress_0.bytes, BigInt),
|
|
187
|
-
|
|
188
|
-
|
|
276
|
+
requestsIndexField_0,
|
|
277
|
+
...Array.from(new Uint8Array(95), BigInt)],
|
|
189
278
|
Number) };
|
|
190
279
|
}
|
|
191
|
-
|
|
192
|
-
const a0_0 = __compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
|
|
193
|
-
1,
|
|
194
|
-
((e, i) => e.slice(i, i+1))(addr_0,
|
|
195
|
-
Number(0n)),
|
|
196
|
-
'Field',
|
|
197
|
-
'Signet.compact line 234 char 17');
|
|
198
|
-
const a1_0 = __compactRuntime.addField(__compactRuntime.mulField(a0_0, 256n),
|
|
199
|
-
__compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
|
|
200
|
-
1,
|
|
201
|
-
((e, i) => e.slice(i, i+1))(addr_0,
|
|
202
|
-
Number(1n)),
|
|
203
|
-
'Field',
|
|
204
|
-
'Signet.compact line 235 char 30'));
|
|
205
|
-
const a2_0 = __compactRuntime.addField(__compactRuntime.mulField(a1_0, 256n),
|
|
206
|
-
__compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
|
|
207
|
-
1,
|
|
208
|
-
((e, i) => e.slice(i, i+1))(addr_0,
|
|
209
|
-
Number(2n)),
|
|
210
|
-
'Field',
|
|
211
|
-
'Signet.compact line 236 char 30'));
|
|
212
|
-
const a3_0 = __compactRuntime.addField(__compactRuntime.mulField(a2_0, 256n),
|
|
213
|
-
__compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
|
|
214
|
-
1,
|
|
215
|
-
((e, i) => e.slice(i, i+1))(addr_0,
|
|
216
|
-
Number(3n)),
|
|
217
|
-
'Field',
|
|
218
|
-
'Signet.compact line 237 char 30'));
|
|
219
|
-
const a4_0 = __compactRuntime.addField(__compactRuntime.mulField(a3_0, 256n),
|
|
220
|
-
__compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
|
|
221
|
-
1,
|
|
222
|
-
((e, i) => e.slice(i, i+1))(addr_0,
|
|
223
|
-
Number(4n)),
|
|
224
|
-
'Field',
|
|
225
|
-
'Signet.compact line 238 char 30'));
|
|
226
|
-
const a5_0 = __compactRuntime.addField(__compactRuntime.mulField(a4_0, 256n),
|
|
227
|
-
__compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
|
|
228
|
-
1,
|
|
229
|
-
((e, i) => e.slice(i, i+1))(addr_0,
|
|
230
|
-
Number(5n)),
|
|
231
|
-
'Field',
|
|
232
|
-
'Signet.compact line 239 char 30'));
|
|
233
|
-
const a6_0 = __compactRuntime.addField(__compactRuntime.mulField(a5_0, 256n),
|
|
234
|
-
__compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
|
|
235
|
-
1,
|
|
236
|
-
((e, i) => e.slice(i, i+1))(addr_0,
|
|
237
|
-
Number(6n)),
|
|
238
|
-
'Field',
|
|
239
|
-
'Signet.compact line 240 char 30'));
|
|
240
|
-
const a7_0 = __compactRuntime.addField(__compactRuntime.mulField(a6_0, 256n),
|
|
241
|
-
__compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
|
|
242
|
-
1,
|
|
243
|
-
((e, i) => e.slice(i, i+1))(addr_0,
|
|
244
|
-
Number(7n)),
|
|
245
|
-
'Field',
|
|
246
|
-
'Signet.compact line 241 char 30'));
|
|
247
|
-
const a8_0 = __compactRuntime.addField(__compactRuntime.mulField(a7_0, 256n),
|
|
248
|
-
__compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
|
|
249
|
-
1,
|
|
250
|
-
((e, i) => e.slice(i, i+1))(addr_0,
|
|
251
|
-
Number(8n)),
|
|
252
|
-
'Field',
|
|
253
|
-
'Signet.compact line 242 char 30'));
|
|
254
|
-
const a9_0 = __compactRuntime.addField(__compactRuntime.mulField(a8_0, 256n),
|
|
255
|
-
__compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
|
|
256
|
-
1,
|
|
257
|
-
((e, i) => e.slice(i, i+1))(addr_0,
|
|
258
|
-
Number(9n)),
|
|
259
|
-
'Field',
|
|
260
|
-
'Signet.compact line 243 char 30'));
|
|
261
|
-
const a10_0 = __compactRuntime.addField(__compactRuntime.mulField(a9_0, 256n),
|
|
262
|
-
__compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
|
|
263
|
-
1,
|
|
264
|
-
((e, i) => e.slice(i, i+1))(addr_0,
|
|
265
|
-
Number(10n)),
|
|
266
|
-
'Field',
|
|
267
|
-
'Signet.compact line 244 char 30'));
|
|
268
|
-
const a11_0 = __compactRuntime.addField(__compactRuntime.mulField(a10_0,
|
|
269
|
-
256n),
|
|
270
|
-
__compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
|
|
271
|
-
1,
|
|
272
|
-
((e, i) => e.slice(i, i+1))(addr_0,
|
|
273
|
-
Number(11n)),
|
|
274
|
-
'Field',
|
|
275
|
-
'Signet.compact line 245 char 30'));
|
|
276
|
-
const a12_0 = __compactRuntime.addField(__compactRuntime.mulField(a11_0,
|
|
277
|
-
256n),
|
|
278
|
-
__compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
|
|
279
|
-
1,
|
|
280
|
-
((e, i) => e.slice(i, i+1))(addr_0,
|
|
281
|
-
Number(12n)),
|
|
282
|
-
'Field',
|
|
283
|
-
'Signet.compact line 246 char 30'));
|
|
284
|
-
const a13_0 = __compactRuntime.addField(__compactRuntime.mulField(a12_0,
|
|
285
|
-
256n),
|
|
286
|
-
__compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
|
|
287
|
-
1,
|
|
288
|
-
((e, i) => e.slice(i, i+1))(addr_0,
|
|
289
|
-
Number(13n)),
|
|
290
|
-
'Field',
|
|
291
|
-
'Signet.compact line 247 char 30'));
|
|
292
|
-
const a14_0 = __compactRuntime.addField(__compactRuntime.mulField(a13_0,
|
|
293
|
-
256n),
|
|
294
|
-
__compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
|
|
295
|
-
1,
|
|
296
|
-
((e, i) => e.slice(i, i+1))(addr_0,
|
|
297
|
-
Number(14n)),
|
|
298
|
-
'Field',
|
|
299
|
-
'Signet.compact line 248 char 30'));
|
|
300
|
-
const a15_0 = __compactRuntime.addField(__compactRuntime.mulField(a14_0,
|
|
301
|
-
256n),
|
|
302
|
-
__compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
|
|
303
|
-
1,
|
|
304
|
-
((e, i) => e.slice(i, i+1))(addr_0,
|
|
305
|
-
Number(15n)),
|
|
306
|
-
'Field',
|
|
307
|
-
'Signet.compact line 249 char 30'));
|
|
308
|
-
const a16_0 = __compactRuntime.addField(__compactRuntime.mulField(a15_0,
|
|
309
|
-
256n),
|
|
310
|
-
__compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
|
|
311
|
-
1,
|
|
312
|
-
((e, i) => e.slice(i, i+1))(addr_0,
|
|
313
|
-
Number(16n)),
|
|
314
|
-
'Field',
|
|
315
|
-
'Signet.compact line 250 char 30'));
|
|
316
|
-
const a17_0 = __compactRuntime.addField(__compactRuntime.mulField(a16_0,
|
|
317
|
-
256n),
|
|
318
|
-
__compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
|
|
319
|
-
1,
|
|
320
|
-
((e, i) => e.slice(i, i+1))(addr_0,
|
|
321
|
-
Number(17n)),
|
|
322
|
-
'Field',
|
|
323
|
-
'Signet.compact line 251 char 30'));
|
|
324
|
-
const a18_0 = __compactRuntime.addField(__compactRuntime.mulField(a17_0,
|
|
325
|
-
256n),
|
|
326
|
-
__compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
|
|
327
|
-
1,
|
|
328
|
-
((e, i) => e.slice(i, i+1))(addr_0,
|
|
329
|
-
Number(18n)),
|
|
330
|
-
'Field',
|
|
331
|
-
'Signet.compact line 252 char 30'));
|
|
332
|
-
return __compactRuntime.addField(__compactRuntime.mulField(a18_0, 256n),
|
|
333
|
-
__compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
|
|
334
|
-
1,
|
|
335
|
-
((e, i) => e.slice(i, i+1))(addr_0,
|
|
336
|
-
Number(19n)),
|
|
337
|
-
'Field',
|
|
338
|
-
'Signet.compact line 253 char 30'));
|
|
339
|
-
}
|
|
340
|
-
_signetAttestationMessage_0(requestId_0, serializedOutput_0, outputLen_0) {
|
|
341
|
-
const rid_0 = requestId_0;
|
|
280
|
+
_signetAttestationDigest_0(requestId_0, serializedOutput_0, outputLen_0) {
|
|
342
281
|
const outHash_0 = this._persistentHash_0([this._persistentHash_1(serializedOutput_0),
|
|
343
282
|
__compactRuntime.convertBigintToBytes(32,
|
|
344
283
|
outputLen_0,
|
|
345
|
-
'Signet.compact line
|
|
346
|
-
return
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
'Field',
|
|
369
|
-
'Signet.compact line 375 char 7')];
|
|
370
|
-
}
|
|
371
|
-
_charToNibble_0(c_0) {
|
|
372
|
-
const isDigit_0 = c_0 >= 48n && c_0 <= 57n;
|
|
373
|
-
const isLower_0 = c_0 >= 97n && c_0 <= 102n;
|
|
374
|
-
__compactRuntime.assert(isDigit_0 || isLower_0, 'non-canonical hex char');
|
|
375
|
-
const base_0 = (__compactRuntime.assert(c_0 >= 48n,
|
|
376
|
-
'result of subtraction would be negative'),
|
|
377
|
-
c_0 - 48n);
|
|
378
|
-
const adjust_0 = isLower_0 ? 39n : 0n;
|
|
379
|
-
__compactRuntime.assert(base_0 >= adjust_0,
|
|
380
|
-
'result of subtraction would be negative');
|
|
381
|
-
return base_0 - adjust_0;
|
|
382
|
-
}
|
|
383
|
-
_assertHexOf_0(commitment_0, hexStr_0) {
|
|
384
|
-
this._folder_0(((t_0, i_0) =>
|
|
385
|
-
{
|
|
386
|
-
const hi_0 = this._charToNibble_0(__compactRuntime.convertBytesToUint(255n,
|
|
387
|
-
1,
|
|
388
|
-
((e, i) => e.slice(i, i+1))(hexStr_0,
|
|
389
|
-
Number(2n
|
|
390
|
-
*
|
|
391
|
-
i_0)),
|
|
392
|
-
'Uint<0..256>',
|
|
393
|
-
'Signet.compact line 402 char 31'));
|
|
394
|
-
const lo_0 = this._charToNibble_0(__compactRuntime.convertBytesToUint(255n,
|
|
395
|
-
1,
|
|
396
|
-
((e, i) => e.slice(i, i+1))(hexStr_0,
|
|
397
|
-
Number(2n
|
|
398
|
-
*
|
|
399
|
-
i_0
|
|
400
|
-
+
|
|
401
|
-
1n)),
|
|
402
|
-
'Uint<0..256>',
|
|
403
|
-
'Signet.compact line 403 char 31'));
|
|
404
|
-
__compactRuntime.assert(__compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
|
|
405
|
-
1,
|
|
406
|
-
((e, i) => e.slice(i, i+1))(commitment_0,
|
|
407
|
-
Number(i_0)),
|
|
408
|
-
'Field',
|
|
409
|
-
'Signet.compact line 404 char 15')
|
|
410
|
-
===
|
|
411
|
-
__compactRuntime.addField(__compactRuntime.mulField(hi_0,
|
|
412
|
-
16n),
|
|
413
|
-
lo_0),
|
|
414
|
-
'path hex does not match commitment');
|
|
415
|
-
return t_0;
|
|
416
|
-
}),
|
|
417
|
-
[],
|
|
418
|
-
[0n,
|
|
419
|
-
1n,
|
|
420
|
-
2n,
|
|
421
|
-
3n,
|
|
422
|
-
4n,
|
|
423
|
-
5n,
|
|
424
|
-
6n,
|
|
425
|
-
7n,
|
|
426
|
-
8n,
|
|
427
|
-
9n,
|
|
428
|
-
10n,
|
|
429
|
-
11n,
|
|
430
|
-
12n,
|
|
431
|
-
13n,
|
|
432
|
-
14n,
|
|
433
|
-
15n,
|
|
434
|
-
16n,
|
|
435
|
-
17n,
|
|
436
|
-
18n,
|
|
437
|
-
19n,
|
|
438
|
-
20n,
|
|
439
|
-
21n,
|
|
440
|
-
22n,
|
|
441
|
-
23n,
|
|
442
|
-
24n,
|
|
443
|
-
25n,
|
|
444
|
-
26n,
|
|
445
|
-
27n,
|
|
446
|
-
28n,
|
|
447
|
-
29n,
|
|
448
|
-
30n,
|
|
449
|
-
31n]);
|
|
450
|
-
return [];
|
|
451
|
-
}
|
|
452
|
-
_assertPathCommitment_0(commitment_0, path_0) {
|
|
453
|
-
this._assertHexOf_0(commitment_0,
|
|
454
|
-
((e, i) => e.slice(i, i+64))(path_0, Number(0n)));
|
|
455
|
-
__compactRuntime.assert(this._equal_0(((e, i) => e.slice(i, i+192))(path_0,
|
|
456
|
-
Number(64n)),
|
|
457
|
-
new Uint8Array([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0])),
|
|
458
|
-
'Path must be zero-padded after hex');
|
|
459
|
-
return [];
|
|
460
|
-
}
|
|
461
|
-
_schnorrChallenge_0(ann_x_0, ann_y_0, pk_x_0, pk_y_0, msg_0) {
|
|
462
|
-
const cFull_0 = this._transientHash_0({ ann_x: ann_x_0,
|
|
463
|
-
ann_y: ann_y_0,
|
|
464
|
-
pk_x: pk_x_0,
|
|
465
|
-
pk_y: pk_y_0,
|
|
466
|
-
msg: msg_0 });
|
|
467
|
-
return cFull_0;
|
|
468
|
-
}
|
|
469
|
-
_folder_0(f, x, a0) {
|
|
470
|
-
for (let i = 0; i < 32; i++) { x = f(x, a0[i]); }
|
|
471
|
-
return x;
|
|
472
|
-
}
|
|
473
|
-
_equal_0(x0, y0) {
|
|
474
|
-
if (!x0.every((x, i) => y0[i] === x)) { return false; }
|
|
475
|
-
return true;
|
|
284
|
+
'Signet.compact line 285 char 7')]);
|
|
285
|
+
return this._persistentHash_0([requestId_0, outHash_0]);
|
|
286
|
+
}
|
|
287
|
+
_verifyRespondBidirectionalEvent_0(requestId_0,
|
|
288
|
+
respondBidirectionalEvent_0,
|
|
289
|
+
mpcResponseKey_0)
|
|
290
|
+
{
|
|
291
|
+
return this._secp256k1EcdsaVerify_0(this._signetAttestationDigest_0(requestId_0,
|
|
292
|
+
respondBidirectionalEvent_0.serializedOutput,
|
|
293
|
+
respondBidirectionalEvent_0.outputLen),
|
|
294
|
+
{ r:
|
|
295
|
+
__compactRuntime.convertBytesToField(115792089237316195423570985008687907852837564279074904382605163141518161494336n,
|
|
296
|
+
32,
|
|
297
|
+
respondBidirectionalEvent_0.r,
|
|
298
|
+
'Secp256k1Scalar',
|
|
299
|
+
'Signet.compact line 308 char 12'),
|
|
300
|
+
s:
|
|
301
|
+
__compactRuntime.convertBytesToField(115792089237316195423570985008687907852837564279074904382605163141518161494336n,
|
|
302
|
+
32,
|
|
303
|
+
respondBidirectionalEvent_0.s,
|
|
304
|
+
'Secp256k1Scalar',
|
|
305
|
+
'Signet.compact line 309 char 12') },
|
|
306
|
+
mpcResponseKey_0);
|
|
476
307
|
}
|
|
308
|
+
_signetKeyHash_0(pk_0) { return this._persistentHash_2(pk_0); }
|
|
477
309
|
}
|
|
478
310
|
export function ledger(stateOrChargedState) {
|
|
479
311
|
const state = stateOrChargedState instanceof __compactRuntime.StateValue ? stateOrChargedState : stateOrChargedState.state;
|
|
@@ -496,177 +328,92 @@ const _emptyContext = {
|
|
|
496
328
|
};
|
|
497
329
|
const _dummyContract = new Contract({ });
|
|
498
330
|
export const pureCircuits = {
|
|
499
|
-
|
|
500
|
-
if (args_0.length !==
|
|
501
|
-
throw new __compactRuntime.CompactError(`
|
|
331
|
+
constructSignBidirectionalEventNotificationV1: (...args_0) => {
|
|
332
|
+
if (args_0.length !== 2) {
|
|
333
|
+
throw new __compactRuntime.CompactError(`constructSignBidirectionalEventNotificationV1: expected 2 arguments (as invoked from Typescript), received ${args_0.length}`);
|
|
502
334
|
}
|
|
503
335
|
const callerAddress_0 = args_0[0];
|
|
504
|
-
const
|
|
505
|
-
const requestsIndexField_0 = args_0[2];
|
|
336
|
+
const requestsIndexField_0 = args_0[1];
|
|
506
337
|
if (!(typeof(callerAddress_0) === 'object' && callerAddress_0.bytes.buffer instanceof ArrayBuffer && callerAddress_0.bytes.BYTES_PER_ELEMENT === 1 && callerAddress_0.bytes.length === 32)) {
|
|
507
|
-
__compactRuntime.typeError('
|
|
338
|
+
__compactRuntime.typeError('constructSignBidirectionalEventNotificationV1',
|
|
508
339
|
'argument 1',
|
|
509
|
-
'Signet.compact line
|
|
340
|
+
'Signet.compact line 209 char 3',
|
|
510
341
|
'struct ContractAddress<bytes: Bytes<32>>',
|
|
511
342
|
callerAddress_0)
|
|
512
343
|
}
|
|
513
|
-
if (!(requestId_0.buffer instanceof ArrayBuffer && requestId_0.BYTES_PER_ELEMENT === 1 && requestId_0.length === 32)) {
|
|
514
|
-
__compactRuntime.typeError('constructSignBidirectionalNotificationV1',
|
|
515
|
-
'argument 2',
|
|
516
|
-
'Signet.compact line 132 char 3',
|
|
517
|
-
'Bytes<32>',
|
|
518
|
-
requestId_0)
|
|
519
|
-
}
|
|
520
344
|
if (!(typeof(requestsIndexField_0) === 'bigint' && requestsIndexField_0 >= 0n && requestsIndexField_0 <= 255n)) {
|
|
521
|
-
__compactRuntime.typeError('
|
|
522
|
-
'argument
|
|
523
|
-
'Signet.compact line
|
|
345
|
+
__compactRuntime.typeError('constructSignBidirectionalEventNotificationV1',
|
|
346
|
+
'argument 2',
|
|
347
|
+
'Signet.compact line 209 char 3',
|
|
524
348
|
'Uint<0..256>',
|
|
525
349
|
requestsIndexField_0)
|
|
526
350
|
}
|
|
527
|
-
return _dummyContract.
|
|
528
|
-
|
|
529
|
-
requestsIndexField_0);
|
|
530
|
-
},
|
|
531
|
-
evmAddressAbiValue: (...args_0) => {
|
|
532
|
-
if (args_0.length !== 1) {
|
|
533
|
-
throw new __compactRuntime.CompactError(`evmAddressAbiValue: expected 1 argument (as invoked from Typescript), received ${args_0.length}`);
|
|
534
|
-
}
|
|
535
|
-
const addr_0 = args_0[0];
|
|
536
|
-
if (!(addr_0.buffer instanceof ArrayBuffer && addr_0.BYTES_PER_ELEMENT === 1 && addr_0.length === 20)) {
|
|
537
|
-
__compactRuntime.typeError('evmAddressAbiValue',
|
|
538
|
-
'argument 1',
|
|
539
|
-
'Signet.compact line 233 char 3',
|
|
540
|
-
'Bytes<20>',
|
|
541
|
-
addr_0)
|
|
542
|
-
}
|
|
543
|
-
return _dummyContract._evmAddressAbiValue_0(addr_0);
|
|
351
|
+
return _dummyContract._constructSignBidirectionalEventNotificationV1_0(callerAddress_0,
|
|
352
|
+
requestsIndexField_0);
|
|
544
353
|
},
|
|
545
|
-
|
|
354
|
+
signetAttestationDigest: (...args_0) => {
|
|
546
355
|
if (args_0.length !== 3) {
|
|
547
|
-
throw new __compactRuntime.CompactError(`
|
|
356
|
+
throw new __compactRuntime.CompactError(`signetAttestationDigest: expected 3 arguments (as invoked from Typescript), received ${args_0.length}`);
|
|
548
357
|
}
|
|
549
358
|
const requestId_0 = args_0[0];
|
|
550
359
|
const serializedOutput_0 = args_0[1];
|
|
551
360
|
const outputLen_0 = args_0[2];
|
|
552
361
|
if (!(requestId_0.buffer instanceof ArrayBuffer && requestId_0.BYTES_PER_ELEMENT === 1 && requestId_0.length === 32)) {
|
|
553
|
-
__compactRuntime.typeError('
|
|
362
|
+
__compactRuntime.typeError('signetAttestationDigest',
|
|
554
363
|
'argument 1',
|
|
555
|
-
'Signet.compact line
|
|
364
|
+
'Signet.compact line 278 char 3',
|
|
556
365
|
'Bytes<32>',
|
|
557
366
|
requestId_0)
|
|
558
367
|
}
|
|
559
368
|
if (!(serializedOutput_0.buffer instanceof ArrayBuffer && serializedOutput_0.BYTES_PER_ELEMENT === 1 && serializedOutput_0.length === 128)) {
|
|
560
|
-
__compactRuntime.typeError('
|
|
369
|
+
__compactRuntime.typeError('signetAttestationDigest',
|
|
561
370
|
'argument 2',
|
|
562
|
-
'Signet.compact line
|
|
371
|
+
'Signet.compact line 278 char 3',
|
|
563
372
|
'Bytes<128>',
|
|
564
373
|
serializedOutput_0)
|
|
565
374
|
}
|
|
566
375
|
if (!(typeof(outputLen_0) === 'bigint' && outputLen_0 >= 0n && outputLen_0 <= 255n)) {
|
|
567
|
-
__compactRuntime.typeError('
|
|
376
|
+
__compactRuntime.typeError('signetAttestationDigest',
|
|
568
377
|
'argument 3',
|
|
569
|
-
'Signet.compact line
|
|
378
|
+
'Signet.compact line 278 char 3',
|
|
570
379
|
'Uint<0..256>',
|
|
571
380
|
outputLen_0)
|
|
572
381
|
}
|
|
573
|
-
return _dummyContract.
|
|
574
|
-
|
|
575
|
-
|
|
382
|
+
return _dummyContract._signetAttestationDigest_0(requestId_0,
|
|
383
|
+
serializedOutput_0,
|
|
384
|
+
outputLen_0);
|
|
576
385
|
},
|
|
577
|
-
|
|
578
|
-
if (args_0.length !==
|
|
579
|
-
throw new __compactRuntime.CompactError(`
|
|
580
|
-
}
|
|
581
|
-
const commitment_0 = args_0[0];
|
|
582
|
-
const hexStr_0 = args_0[1];
|
|
583
|
-
if (!(commitment_0.buffer instanceof ArrayBuffer && commitment_0.BYTES_PER_ELEMENT === 1 && commitment_0.length === 32)) {
|
|
584
|
-
__compactRuntime.typeError('assertHexOf',
|
|
585
|
-
'argument 1',
|
|
586
|
-
'Signet.compact line 400 char 3',
|
|
587
|
-
'Bytes<32>',
|
|
588
|
-
commitment_0)
|
|
589
|
-
}
|
|
590
|
-
if (!(hexStr_0.buffer instanceof ArrayBuffer && hexStr_0.BYTES_PER_ELEMENT === 1 && hexStr_0.length === 64)) {
|
|
591
|
-
__compactRuntime.typeError('assertHexOf',
|
|
592
|
-
'argument 2',
|
|
593
|
-
'Signet.compact line 400 char 3',
|
|
594
|
-
'Bytes<64>',
|
|
595
|
-
hexStr_0)
|
|
596
|
-
}
|
|
597
|
-
return _dummyContract._assertHexOf_0(commitment_0, hexStr_0);
|
|
598
|
-
},
|
|
599
|
-
assertPathCommitment: (...args_0) => {
|
|
600
|
-
if (args_0.length !== 2) {
|
|
601
|
-
throw new __compactRuntime.CompactError(`assertPathCommitment: expected 2 arguments (as invoked from Typescript), received ${args_0.length}`);
|
|
386
|
+
verifyRespondBidirectionalEvent: (...args_0) => {
|
|
387
|
+
if (args_0.length !== 3) {
|
|
388
|
+
throw new __compactRuntime.CompactError(`verifyRespondBidirectionalEvent: expected 3 arguments (as invoked from Typescript), received ${args_0.length}`);
|
|
602
389
|
}
|
|
603
|
-
const
|
|
604
|
-
const
|
|
605
|
-
|
|
606
|
-
|
|
390
|
+
const requestId_0 = args_0[0];
|
|
391
|
+
const respondBidirectionalEvent_0 = args_0[1];
|
|
392
|
+
const mpcResponseKey_0 = args_0[2];
|
|
393
|
+
if (!(requestId_0.buffer instanceof ArrayBuffer && requestId_0.BYTES_PER_ELEMENT === 1 && requestId_0.length === 32)) {
|
|
394
|
+
__compactRuntime.typeError('verifyRespondBidirectionalEvent',
|
|
607
395
|
'argument 1',
|
|
608
|
-
'Signet.compact line
|
|
396
|
+
'Signet.compact line 296 char 3',
|
|
609
397
|
'Bytes<32>',
|
|
610
|
-
|
|
398
|
+
requestId_0)
|
|
611
399
|
}
|
|
612
|
-
if (!(
|
|
613
|
-
__compactRuntime.typeError('
|
|
400
|
+
if (!(typeof(respondBidirectionalEvent_0) === 'object' && respondBidirectionalEvent_0.serializedOutput.buffer instanceof ArrayBuffer && respondBidirectionalEvent_0.serializedOutput.BYTES_PER_ELEMENT === 1 && respondBidirectionalEvent_0.serializedOutput.length === 128 && typeof(respondBidirectionalEvent_0.outputLen) === 'bigint' && respondBidirectionalEvent_0.outputLen >= 0n && respondBidirectionalEvent_0.outputLen <= 255n && respondBidirectionalEvent_0.r.buffer instanceof ArrayBuffer && respondBidirectionalEvent_0.r.BYTES_PER_ELEMENT === 1 && respondBidirectionalEvent_0.r.length === 32 && respondBidirectionalEvent_0.s.buffer instanceof ArrayBuffer && respondBidirectionalEvent_0.s.BYTES_PER_ELEMENT === 1 && respondBidirectionalEvent_0.s.length === 32 && typeof(respondBidirectionalEvent_0.recoveryId) === 'bigint' && respondBidirectionalEvent_0.recoveryId >= 0n && respondBidirectionalEvent_0.recoveryId <= 255n)) {
|
|
401
|
+
__compactRuntime.typeError('verifyRespondBidirectionalEvent',
|
|
614
402
|
'argument 2',
|
|
615
|
-
'Signet.compact line
|
|
616
|
-
'Bytes<256
|
|
617
|
-
|
|
403
|
+
'Signet.compact line 296 char 3',
|
|
404
|
+
'struct RespondBidirectionalEvent<serializedOutput: Bytes<128>, outputLen: Uint<0..256>, r: Bytes<32>, s: Bytes<32>, recoveryId: Uint<0..256>>',
|
|
405
|
+
respondBidirectionalEvent_0)
|
|
618
406
|
}
|
|
619
|
-
return _dummyContract.
|
|
407
|
+
return _dummyContract._verifyRespondBidirectionalEvent_0(requestId_0,
|
|
408
|
+
respondBidirectionalEvent_0,
|
|
409
|
+
mpcResponseKey_0);
|
|
620
410
|
},
|
|
621
|
-
|
|
622
|
-
if (args_0.length !==
|
|
623
|
-
throw new __compactRuntime.CompactError(`
|
|
624
|
-
}
|
|
625
|
-
const ann_x_0 = args_0[0];
|
|
626
|
-
const ann_y_0 = args_0[1];
|
|
627
|
-
const pk_x_0 = args_0[2];
|
|
628
|
-
const pk_y_0 = args_0[3];
|
|
629
|
-
const msg_0 = args_0[4];
|
|
630
|
-
if (!(typeof(ann_x_0) === 'bigint' && ann_x_0 >= 0 && ann_x_0 <= __compactRuntime.MAX_FIELD)) {
|
|
631
|
-
__compactRuntime.typeError('schnorrChallenge',
|
|
632
|
-
'argument 1',
|
|
633
|
-
'Schnorr.compact line 50 char 3',
|
|
634
|
-
'Field',
|
|
635
|
-
ann_x_0)
|
|
636
|
-
}
|
|
637
|
-
if (!(typeof(ann_y_0) === 'bigint' && ann_y_0 >= 0 && ann_y_0 <= __compactRuntime.MAX_FIELD)) {
|
|
638
|
-
__compactRuntime.typeError('schnorrChallenge',
|
|
639
|
-
'argument 2',
|
|
640
|
-
'Schnorr.compact line 50 char 3',
|
|
641
|
-
'Field',
|
|
642
|
-
ann_y_0)
|
|
643
|
-
}
|
|
644
|
-
if (!(typeof(pk_x_0) === 'bigint' && pk_x_0 >= 0 && pk_x_0 <= __compactRuntime.MAX_FIELD)) {
|
|
645
|
-
__compactRuntime.typeError('schnorrChallenge',
|
|
646
|
-
'argument 3',
|
|
647
|
-
'Schnorr.compact line 50 char 3',
|
|
648
|
-
'Field',
|
|
649
|
-
pk_x_0)
|
|
650
|
-
}
|
|
651
|
-
if (!(typeof(pk_y_0) === 'bigint' && pk_y_0 >= 0 && pk_y_0 <= __compactRuntime.MAX_FIELD)) {
|
|
652
|
-
__compactRuntime.typeError('schnorrChallenge',
|
|
653
|
-
'argument 4',
|
|
654
|
-
'Schnorr.compact line 50 char 3',
|
|
655
|
-
'Field',
|
|
656
|
-
pk_y_0)
|
|
657
|
-
}
|
|
658
|
-
if (!(Array.isArray(msg_0) && msg_0.length === 4 && msg_0.every((t) => typeof(t) === 'bigint' && t >= 0 && t <= __compactRuntime.MAX_FIELD))) {
|
|
659
|
-
__compactRuntime.typeError('schnorrChallenge',
|
|
660
|
-
'argument 5',
|
|
661
|
-
'Schnorr.compact line 50 char 3',
|
|
662
|
-
'Vector<4, Field>',
|
|
663
|
-
msg_0)
|
|
411
|
+
signetKeyHash: (...args_0) => {
|
|
412
|
+
if (args_0.length !== 1) {
|
|
413
|
+
throw new __compactRuntime.CompactError(`signetKeyHash: expected 1 argument (as invoked from Typescript), received ${args_0.length}`);
|
|
664
414
|
}
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
pk_x_0,
|
|
668
|
-
pk_y_0,
|
|
669
|
-
msg_0);
|
|
415
|
+
const pk_0 = args_0[0];
|
|
416
|
+
return _dummyContract._signetKeyHash_0(pk_0);
|
|
670
417
|
}
|
|
671
418
|
};
|
|
672
419
|
export const contractReferenceLocations =
|