@sig-net/midnight 0.0.9 → 0.11.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.
Files changed (44) hide show
  1. package/README.md +254 -112
  2. package/dist/constants.d.ts +1 -1
  3. package/dist/constants.js +1 -1
  4. package/dist/ecdsa-attestation.d.ts +53 -1
  5. package/dist/ecdsa-attestation.d.ts.map +1 -1
  6. package/dist/ecdsa-attestation.js +96 -4
  7. package/dist/ecdsa-attestation.js.map +1 -1
  8. package/dist/epsilon-derivation.d.ts +8 -8
  9. package/dist/epsilon-derivation.d.ts.map +1 -1
  10. package/dist/epsilon-derivation.js +15 -17
  11. package/dist/epsilon-derivation.js.map +1 -1
  12. package/dist/index.d.ts +3 -13
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js +3 -13
  15. package/dist/index.js.map +1 -1
  16. package/dist/managed/compiler/contract-info.json +76 -24
  17. package/dist/managed/compiler/contract-manifest.json +8 -8
  18. package/dist/managed/contract/index.d.ts +18 -10
  19. package/dist/managed/contract/index.js +218 -103
  20. package/dist/managed/contract/index.js.map +1 -1
  21. package/dist/signature-requests-state-reader.d.ts +2 -2
  22. package/dist/signature-requests-state-reader.d.ts.map +1 -1
  23. package/dist/signature-requests-state-reader.js +32 -15
  24. package/dist/signature-requests-state-reader.js.map +1 -1
  25. package/dist/signature-response-verification.d.ts +1 -1
  26. package/dist/signature-response-verification.js +5 -5
  27. package/dist/signature-response-verification.js.map +1 -1
  28. package/dist/signet-contract-state-reader.d.ts +49 -30
  29. package/dist/signet-contract-state-reader.d.ts.map +1 -1
  30. package/dist/signet-contract-state-reader.js +55 -35
  31. package/dist/signet-contract-state-reader.js.map +1 -1
  32. package/dist/signet-evtype2tx-requests.d.ts +65 -43
  33. package/dist/signet-evtype2tx-requests.d.ts.map +1 -1
  34. package/dist/signet-evtype2tx-requests.js +77 -78
  35. package/dist/signet-evtype2tx-requests.js.map +1 -1
  36. package/dist/signet-request-response-reader.d.ts +3 -3
  37. package/dist/signet-request-response-reader.js +9 -9
  38. package/dist/signet-request-response-reader.js.map +1 -1
  39. package/dist/signet-requests.d.ts +4 -4
  40. package/dist/signet-requests.js +3 -3
  41. package/dist/signet-requests.js.map +1 -1
  42. package/package.json +1 -1
  43. package/src/Signet.compact +122 -72
  44. package/src/circuits.compact +10 -27
@@ -1,117 +1,150 @@
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 = new __compactRuntime.CompactTypeUnsignedInteger(340282366920938463463374607431768211455n, 16);
4
+ const _descriptor_0 = new __compactRuntime.CompactTypeBytes(32);
5
5
 
6
- const _descriptor_1 = new __compactRuntime.CompactTypeBytes(32);
6
+ const _descriptor_1 = new __compactRuntime.CompactTypeUnsignedInteger(340282366920938463463374607431768211455n, 16);
7
7
 
8
- const _descriptor_2 = __compactRuntime.CompactTypeSecp256k1Point;
8
+ const _descriptor_2 = __compactRuntime.CompactTypeBoolean;
9
9
 
10
- const _descriptor_3 = new __compactRuntime.CompactTypeBytes(20);
10
+ const _descriptor_3 = __compactRuntime.CompactTypeSecp256k1Point;
11
11
 
12
- const _descriptor_4 = new __compactRuntime.CompactTypeBytes(128);
12
+ const _descriptor_4 = new __compactRuntime.CompactTypeBytes(20);
13
13
 
14
- const _descriptor_5 = new __compactRuntime.CompactTypeUnsignedInteger(255n, 1);
14
+ const _descriptor_5 = new __compactRuntime.CompactTypeBytes(128);
15
15
 
16
- class _RespondBidirectionalEvent_0 {
16
+ const _descriptor_6 = new __compactRuntime.CompactTypeUnsignedInteger(255n, 1);
17
+
18
+ class _AffinePoint_0 {
17
19
  alignment() {
18
- return _descriptor_4.alignment().concat(_descriptor_5.alignment().concat(_descriptor_1.alignment().concat(_descriptor_1.alignment().concat(_descriptor_5.alignment()))));
20
+ return _descriptor_0.alignment().concat(_descriptor_0.alignment());
19
21
  }
20
22
  fromValue(value_0) {
21
23
  return {
22
- serializedOutput: _descriptor_4.fromValue(value_0),
23
- outputLen: _descriptor_5.fromValue(value_0),
24
- r: _descriptor_1.fromValue(value_0),
25
- s: _descriptor_1.fromValue(value_0),
26
- recoveryId: _descriptor_5.fromValue(value_0)
24
+ x: _descriptor_0.fromValue(value_0),
25
+ y: _descriptor_0.fromValue(value_0)
27
26
  }
28
27
  }
29
28
  toValue(value_0) {
30
- return _descriptor_4.toValue(value_0.serializedOutput).concat(_descriptor_5.toValue(value_0.outputLen).concat(_descriptor_1.toValue(value_0.r).concat(_descriptor_1.toValue(value_0.s).concat(_descriptor_5.toValue(value_0.recoveryId)))));
29
+ return _descriptor_0.toValue(value_0.x).concat(_descriptor_0.toValue(value_0.y));
31
30
  }
32
31
  }
33
32
 
34
- const _descriptor_6 = new _RespondBidirectionalEvent_0();
33
+ const _descriptor_7 = new _AffinePoint_0();
35
34
 
36
- const _descriptor_7 = __compactRuntime.CompactTypeBoolean;
35
+ class _Signature_0 {
36
+ alignment() {
37
+ return _descriptor_7.alignment().concat(_descriptor_0.alignment().concat(_descriptor_6.alignment()));
38
+ }
39
+ fromValue(value_0) {
40
+ return {
41
+ bigR: _descriptor_7.fromValue(value_0),
42
+ s: _descriptor_0.fromValue(value_0),
43
+ recoveryId: _descriptor_6.fromValue(value_0)
44
+ }
45
+ }
46
+ toValue(value_0) {
47
+ return _descriptor_7.toValue(value_0.bigR).concat(_descriptor_0.toValue(value_0.s).concat(_descriptor_6.toValue(value_0.recoveryId)));
48
+ }
49
+ }
37
50
 
38
- const _descriptor_8 = __compactRuntime.CompactTypeSecp256k1Scalar;
51
+ const _descriptor_8 = new _Signature_0();
52
+
53
+ class _RespondBidirectionalEvent_0 {
54
+ alignment() {
55
+ return _descriptor_5.alignment().concat(_descriptor_6.alignment().concat(_descriptor_8.alignment()));
56
+ }
57
+ fromValue(value_0) {
58
+ return {
59
+ serializedOutput: _descriptor_5.fromValue(value_0),
60
+ outputLen: _descriptor_6.fromValue(value_0),
61
+ signature: _descriptor_8.fromValue(value_0)
62
+ }
63
+ }
64
+ toValue(value_0) {
65
+ return _descriptor_5.toValue(value_0.serializedOutput).concat(_descriptor_6.toValue(value_0.outputLen).concat(_descriptor_8.toValue(value_0.signature)));
66
+ }
67
+ }
68
+
69
+ const _descriptor_9 = new _RespondBidirectionalEvent_0();
39
70
 
40
71
  class _ContractAddress_0 {
41
72
  alignment() {
42
- return _descriptor_1.alignment();
73
+ return _descriptor_0.alignment();
43
74
  }
44
75
  fromValue(value_0) {
45
76
  return {
46
- bytes: _descriptor_1.fromValue(value_0)
77
+ bytes: _descriptor_0.fromValue(value_0)
47
78
  }
48
79
  }
49
80
  toValue(value_0) {
50
- return _descriptor_1.toValue(value_0.bytes);
81
+ return _descriptor_0.toValue(value_0.bytes);
51
82
  }
52
83
  }
53
84
 
54
- const _descriptor_9 = new _ContractAddress_0();
85
+ const _descriptor_10 = new _ContractAddress_0();
55
86
 
56
87
  class _SignBidirectionalEventNotification_0 {
57
88
  alignment() {
58
- return _descriptor_5.alignment().concat(_descriptor_4.alignment());
89
+ return _descriptor_6.alignment().concat(_descriptor_5.alignment());
59
90
  }
60
91
  fromValue(value_0) {
61
92
  return {
62
- version: _descriptor_5.fromValue(value_0),
63
- payload: _descriptor_4.fromValue(value_0)
93
+ version: _descriptor_6.fromValue(value_0),
94
+ payload: _descriptor_5.fromValue(value_0)
64
95
  }
65
96
  }
66
97
  toValue(value_0) {
67
- return _descriptor_5.toValue(value_0.version).concat(_descriptor_4.toValue(value_0.payload));
98
+ return _descriptor_6.toValue(value_0.version).concat(_descriptor_5.toValue(value_0.payload));
68
99
  }
69
100
  }
70
101
 
71
- const _descriptor_10 = new _SignBidirectionalEventNotification_0();
102
+ const _descriptor_11 = new _SignBidirectionalEventNotification_0();
103
+
104
+ const _descriptor_12 = __compactRuntime.CompactTypeSecp256k1Scalar;
72
105
 
73
- const _descriptor_11 = __compactRuntime.CompactTypeSecp256k1Base;
106
+ const _descriptor_13 = __compactRuntime.CompactTypeSecp256k1Base;
74
107
 
75
- const _descriptor_12 = new __compactRuntime.CompactTypeVector(2, _descriptor_1);
108
+ const _descriptor_14 = new __compactRuntime.CompactTypeBytes(160);
76
109
 
77
110
  class _Secp256k1EcdsaSignature_0 {
78
111
  alignment() {
79
- return _descriptor_8.alignment().concat(_descriptor_8.alignment());
112
+ return _descriptor_12.alignment().concat(_descriptor_12.alignment());
80
113
  }
81
114
  fromValue(value_0) {
82
115
  return {
83
- r: _descriptor_8.fromValue(value_0),
84
- s: _descriptor_8.fromValue(value_0)
116
+ r: _descriptor_12.fromValue(value_0),
117
+ s: _descriptor_12.fromValue(value_0)
85
118
  }
86
119
  }
87
120
  toValue(value_0) {
88
- return _descriptor_8.toValue(value_0.r).concat(_descriptor_8.toValue(value_0.s));
121
+ return _descriptor_12.toValue(value_0.r).concat(_descriptor_12.toValue(value_0.s));
89
122
  }
90
123
  }
91
124
 
92
- const _descriptor_13 = new _Secp256k1EcdsaSignature_0();
125
+ const _descriptor_15 = new _Secp256k1EcdsaSignature_0();
93
126
 
94
- const _descriptor_14 = new __compactRuntime.CompactTypeUnsignedInteger(18446744073709551615n, 8);
127
+ const _descriptor_16 = new __compactRuntime.CompactTypeUnsignedInteger(18446744073709551615n, 8);
95
128
 
96
129
  class _Either_0 {
97
130
  alignment() {
98
- return _descriptor_7.alignment().concat(_descriptor_1.alignment().concat(_descriptor_1.alignment()));
131
+ return _descriptor_2.alignment().concat(_descriptor_0.alignment().concat(_descriptor_0.alignment()));
99
132
  }
100
133
  fromValue(value_0) {
101
134
  return {
102
- is_left: _descriptor_7.fromValue(value_0),
103
- left: _descriptor_1.fromValue(value_0),
104
- right: _descriptor_1.fromValue(value_0)
135
+ is_left: _descriptor_2.fromValue(value_0),
136
+ left: _descriptor_0.fromValue(value_0),
137
+ right: _descriptor_0.fromValue(value_0)
105
138
  }
106
139
  }
107
140
  toValue(value_0) {
108
- return _descriptor_7.toValue(value_0.is_left).concat(_descriptor_1.toValue(value_0.left).concat(_descriptor_1.toValue(value_0.right)));
141
+ return _descriptor_2.toValue(value_0.is_left).concat(_descriptor_0.toValue(value_0.left).concat(_descriptor_0.toValue(value_0.right)));
109
142
  }
110
143
  }
111
144
 
112
- const _descriptor_15 = new _Either_0();
145
+ const _descriptor_17 = new _Either_0();
113
146
 
114
- const _descriptor_16 = new __compactRuntime.CompactTypeUnsignedInteger(4294967295n, 4);
147
+ const _descriptor_18 = new __compactRuntime.CompactTypeUnsignedInteger(4294967295n, 4);
115
148
 
116
149
  export class Contract {
117
150
  witnesses;
@@ -143,8 +176,14 @@ export class Contract {
143
176
  async numericAbiWord(context, ...args_1) {
144
177
  return { result: pureCircuits.numericAbiWord(...args_1), context };
145
178
  },
179
+ async boolAbiWord(context, ...args_1) {
180
+ return { result: pureCircuits.boolAbiWord(...args_1), context };
181
+ },
146
182
  async abiWordToUint128(context, ...args_1) {
147
183
  return { result: pureCircuits.abiWordToUint128(...args_1), context };
184
+ },
185
+ async abiWordToBool(context, ...args_1) {
186
+ return { result: pureCircuits.abiWordToBool(...args_1), context };
148
187
  }
149
188
  };
150
189
  this.impureCircuits = {};
@@ -243,15 +282,11 @@ export class Contract {
243
282
  r_0;
244
283
  }
245
284
  _persistentHash_0(value_0) {
246
- const result_0 = __compactRuntime.persistentHash(_descriptor_12, value_0);
285
+ const result_0 = __compactRuntime.persistentHash(_descriptor_3, value_0);
247
286
  return result_0;
248
287
  }
249
- _persistentHash_1(value_0) {
250
- const result_0 = __compactRuntime.persistentHash(_descriptor_4, value_0);
251
- return result_0;
252
- }
253
- _persistentHash_2(value_0) {
254
- const result_0 = __compactRuntime.persistentHash(_descriptor_2, value_0);
288
+ _keccak256_0(value_0) {
289
+ const result_0 = __compactRuntime.keccak256(_descriptor_14, value_0);
255
290
  return result_0;
256
291
  }
257
292
  _mul_0(x_0, y_0) {
@@ -288,35 +323,71 @@ export class Contract {
288
323
  ...Array.from(new Uint8Array(95), BigInt)],
289
324
  Number) };
290
325
  }
291
- _signetAttestationDigest_0(requestId_0, serializedOutput_0, outputLen_0) {
292
- const outHash_0 = this._persistentHash_0([this._persistentHash_1(serializedOutput_0),
293
- __compactRuntime.convertBigintToBytes(32,
294
- outputLen_0,
295
- 'Signet.compact line 285 char 7')]);
296
- return this._persistentHash_0([requestId_0, outHash_0]);
326
+ _signetAttestationDigest_0(requestId_0, serializedOutput_0) {
327
+ const requestIdBytes_0 = requestId_0;
328
+ return this._keccak256_0(Uint8Array.from([...Array.from(requestIdBytes_0,
329
+ BigInt),
330
+ ...Array.from(serializedOutput_0,
331
+ BigInt)],
332
+ Number));
333
+ }
334
+ _reverseBytes32_0(b_0) {
335
+ const v_0 = Array.from(b_0, BigInt);
336
+ return Uint8Array.from([v_0[31],
337
+ v_0[30],
338
+ v_0[29],
339
+ v_0[28],
340
+ v_0[27],
341
+ v_0[26],
342
+ v_0[25],
343
+ v_0[24],
344
+ v_0[23],
345
+ v_0[22],
346
+ v_0[21],
347
+ v_0[20],
348
+ v_0[19],
349
+ v_0[18],
350
+ v_0[17],
351
+ v_0[16],
352
+ v_0[15],
353
+ v_0[14],
354
+ v_0[13],
355
+ v_0[12],
356
+ v_0[11],
357
+ v_0[10],
358
+ v_0[9],
359
+ v_0[8],
360
+ v_0[7],
361
+ v_0[6],
362
+ v_0[5],
363
+ v_0[4],
364
+ v_0[3],
365
+ v_0[2],
366
+ v_0[1],
367
+ v_0[0]],
368
+ Number);
297
369
  }
298
370
  _verifyRespondBidirectionalEvent_0(requestId_0,
299
371
  respondBidirectionalEvent_0,
300
372
  mpcResponseKey_0)
301
373
  {
302
374
  return this._secp256k1EcdsaVerify_0(this._signetAttestationDigest_0(requestId_0,
303
- respondBidirectionalEvent_0.serializedOutput,
304
- respondBidirectionalEvent_0.outputLen),
375
+ respondBidirectionalEvent_0.serializedOutput),
305
376
  { r:
306
377
  __compactRuntime.convertBytesToField(115792089237316195423570985008687907852837564279074904382605163141518161494336n,
307
378
  32,
308
- respondBidirectionalEvent_0.r,
379
+ this._reverseBytes32_0(respondBidirectionalEvent_0.signature.bigR.x),
309
380
  'Secp256k1Scalar',
310
- 'Signet.compact line 308 char 12'),
381
+ 'Signet.compact line 341 char 12'),
311
382
  s:
312
383
  __compactRuntime.convertBytesToField(115792089237316195423570985008687907852837564279074904382605163141518161494336n,
313
384
  32,
314
- respondBidirectionalEvent_0.s,
385
+ this._reverseBytes32_0(respondBidirectionalEvent_0.signature.s),
315
386
  'Secp256k1Scalar',
316
- 'Signet.compact line 309 char 12') },
387
+ 'Signet.compact line 342 char 12') },
317
388
  mpcResponseKey_0);
318
389
  }
319
- _signetKeyHash_0(pk_0) { return this._persistentHash_2(pk_0); }
390
+ _signetKeyHash_0(pk_0) { return this._persistentHash_0(pk_0); }
320
391
  _evmAddressAbiWord_0(addr_0) {
321
392
  return Uint8Array.from([...Array.from(new Uint8Array(12), BigInt),
322
393
  ...Array.from(addr_0, BigInt)],
@@ -325,7 +396,7 @@ export class Contract {
325
396
  _numericAbiWord_0(value_0) {
326
397
  const le_0 = Array.from(__compactRuntime.convertBigintToBytes(16,
327
398
  value_0,
328
- 'Signet.compact line 389 char 17'),
399
+ 'Signet.compact line 424 char 17'),
329
400
  BigInt);
330
401
  return Uint8Array.from([...Array.from(new Uint8Array(16), BigInt),
331
402
  le_0[15],
@@ -346,13 +417,18 @@ export class Contract {
346
417
  le_0[0]],
347
418
  Number);
348
419
  }
420
+ _boolAbiWord_0(value_0) {
421
+ return Uint8Array.from([...Array.from(new Uint8Array(31), BigInt),
422
+ value_0 ? 1n : 0n],
423
+ Number);
424
+ }
349
425
  _abiWordToUint128_0(word_0) {
350
426
  __compactRuntime.assert(__compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
351
427
  16,
352
428
  ((e, i) => e.slice(i, i+16))(word_0,
353
429
  Number(0n)),
354
430
  'Field',
355
- 'Signet.compact line 402 char 12')
431
+ 'Signet.compact line 443 char 12')
356
432
  ===
357
433
  0n,
358
434
  'ABI word exceeds Uint<128>');
@@ -361,77 +437,77 @@ export class Contract {
361
437
  ((e, i) => e.slice(i, i+1))(word_0,
362
438
  Number(16n)),
363
439
  'Field',
364
- 'Signet.compact line 403 char 17');
440
+ 'Signet.compact line 444 char 17');
365
441
  const b1_0 = __compactRuntime.addField(__compactRuntime.mulField(b0_0, 256n),
366
442
  __compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
367
443
  1,
368
444
  ((e, i) => e.slice(i, i+1))(word_0,
369
445
  Number(17n)),
370
446
  'Field',
371
- 'Signet.compact line 404 char 30'));
447
+ 'Signet.compact line 445 char 30'));
372
448
  const b2_0 = __compactRuntime.addField(__compactRuntime.mulField(b1_0, 256n),
373
449
  __compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
374
450
  1,
375
451
  ((e, i) => e.slice(i, i+1))(word_0,
376
452
  Number(18n)),
377
453
  'Field',
378
- 'Signet.compact line 405 char 30'));
454
+ 'Signet.compact line 446 char 30'));
379
455
  const b3_0 = __compactRuntime.addField(__compactRuntime.mulField(b2_0, 256n),
380
456
  __compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
381
457
  1,
382
458
  ((e, i) => e.slice(i, i+1))(word_0,
383
459
  Number(19n)),
384
460
  'Field',
385
- 'Signet.compact line 406 char 30'));
461
+ 'Signet.compact line 447 char 30'));
386
462
  const b4_0 = __compactRuntime.addField(__compactRuntime.mulField(b3_0, 256n),
387
463
  __compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
388
464
  1,
389
465
  ((e, i) => e.slice(i, i+1))(word_0,
390
466
  Number(20n)),
391
467
  'Field',
392
- 'Signet.compact line 407 char 30'));
468
+ 'Signet.compact line 448 char 30'));
393
469
  const b5_0 = __compactRuntime.addField(__compactRuntime.mulField(b4_0, 256n),
394
470
  __compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
395
471
  1,
396
472
  ((e, i) => e.slice(i, i+1))(word_0,
397
473
  Number(21n)),
398
474
  'Field',
399
- 'Signet.compact line 408 char 30'));
475
+ 'Signet.compact line 449 char 30'));
400
476
  const b6_0 = __compactRuntime.addField(__compactRuntime.mulField(b5_0, 256n),
401
477
  __compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
402
478
  1,
403
479
  ((e, i) => e.slice(i, i+1))(word_0,
404
480
  Number(22n)),
405
481
  'Field',
406
- 'Signet.compact line 409 char 30'));
482
+ 'Signet.compact line 450 char 30'));
407
483
  const b7_0 = __compactRuntime.addField(__compactRuntime.mulField(b6_0, 256n),
408
484
  __compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
409
485
  1,
410
486
  ((e, i) => e.slice(i, i+1))(word_0,
411
487
  Number(23n)),
412
488
  'Field',
413
- 'Signet.compact line 410 char 30'));
489
+ 'Signet.compact line 451 char 30'));
414
490
  const b8_0 = __compactRuntime.addField(__compactRuntime.mulField(b7_0, 256n),
415
491
  __compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
416
492
  1,
417
493
  ((e, i) => e.slice(i, i+1))(word_0,
418
494
  Number(24n)),
419
495
  'Field',
420
- 'Signet.compact line 411 char 30'));
496
+ 'Signet.compact line 452 char 30'));
421
497
  const b9_0 = __compactRuntime.addField(__compactRuntime.mulField(b8_0, 256n),
422
498
  __compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
423
499
  1,
424
500
  ((e, i) => e.slice(i, i+1))(word_0,
425
501
  Number(25n)),
426
502
  'Field',
427
- 'Signet.compact line 412 char 30'));
503
+ 'Signet.compact line 453 char 30'));
428
504
  const b10_0 = __compactRuntime.addField(__compactRuntime.mulField(b9_0, 256n),
429
505
  __compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
430
506
  1,
431
507
  ((e, i) => e.slice(i, i+1))(word_0,
432
508
  Number(26n)),
433
509
  'Field',
434
- 'Signet.compact line 413 char 30'));
510
+ 'Signet.compact line 454 char 30'));
435
511
  const b11_0 = __compactRuntime.addField(__compactRuntime.mulField(b10_0,
436
512
  256n),
437
513
  __compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
@@ -439,7 +515,7 @@ export class Contract {
439
515
  ((e, i) => e.slice(i, i+1))(word_0,
440
516
  Number(27n)),
441
517
  'Field',
442
- 'Signet.compact line 414 char 30'));
518
+ 'Signet.compact line 455 char 30'));
443
519
  const b12_0 = __compactRuntime.addField(__compactRuntime.mulField(b11_0,
444
520
  256n),
445
521
  __compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
@@ -447,7 +523,7 @@ export class Contract {
447
523
  ((e, i) => e.slice(i, i+1))(word_0,
448
524
  Number(28n)),
449
525
  'Field',
450
- 'Signet.compact line 415 char 30'));
526
+ 'Signet.compact line 456 char 30'));
451
527
  const b13_0 = __compactRuntime.addField(__compactRuntime.mulField(b12_0,
452
528
  256n),
453
529
  __compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
@@ -455,7 +531,7 @@ export class Contract {
455
531
  ((e, i) => e.slice(i, i+1))(word_0,
456
532
  Number(29n)),
457
533
  'Field',
458
- 'Signet.compact line 416 char 30'));
534
+ 'Signet.compact line 457 char 30'));
459
535
  const b14_0 = __compactRuntime.addField(__compactRuntime.mulField(b13_0,
460
536
  256n),
461
537
  __compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
@@ -463,7 +539,7 @@ export class Contract {
463
539
  ((e, i) => e.slice(i, i+1))(word_0,
464
540
  Number(30n)),
465
541
  'Field',
466
- 'Signet.compact line 417 char 30'));
542
+ 'Signet.compact line 458 char 30'));
467
543
  const b15_0 = __compactRuntime.addField(__compactRuntime.mulField(b14_0,
468
544
  256n),
469
545
  __compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
@@ -471,14 +547,34 @@ export class Contract {
471
547
  ((e, i) => e.slice(i, i+1))(word_0,
472
548
  Number(31n)),
473
549
  'Field',
474
- 'Signet.compact line 418 char 30'));
550
+ 'Signet.compact line 459 char 30'));
475
551
  return ((t1) => {
476
552
  if (t1 > 340282366920938463463374607431768211455n) {
477
- throw new __compactRuntime.CompactError('Signet.compact line 419 char 12: cast from Field or Uint value to smaller Uint value failed: ' + t1 + ' is greater than 340282366920938463463374607431768211455');
553
+ throw new __compactRuntime.CompactError('Signet.compact line 460 char 12: cast from Field or Uint value to smaller Uint value failed: ' + t1 + ' is greater than 340282366920938463463374607431768211455');
478
554
  }
479
555
  return t1;
480
556
  })(b15_0);
481
557
  }
558
+ _abiWordToBool_0(word_0) {
559
+ __compactRuntime.assert(__compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
560
+ 31,
561
+ ((e, i) => e.slice(i, i+31))(word_0,
562
+ Number(0n)),
563
+ 'Field',
564
+ 'Signet.compact line 466 char 12')
565
+ ===
566
+ 0n,
567
+ 'ABI word is not a canonical Boolean');
568
+ const last_0 = __compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
569
+ 1,
570
+ ((e, i) => e.slice(i, i+1))(word_0,
571
+ Number(31n)),
572
+ 'Field',
573
+ 'Signet.compact line 467 char 18');
574
+ __compactRuntime.assert(last_0 === 0n || last_0 === 1n,
575
+ 'ABI word is not a canonical Boolean');
576
+ return last_0 === 1n;
577
+ }
482
578
  }
483
579
  export function ledger(stateOrChargedState) {
484
580
  const state = stateOrChargedState instanceof __compactRuntime.StateValue ? stateOrChargedState : stateOrChargedState.state;
@@ -510,14 +606,14 @@ export const pureCircuits = {
510
606
  if (!(typeof(callerAddress_0) === 'object' && callerAddress_0.bytes.buffer instanceof ArrayBuffer && callerAddress_0.bytes.BYTES_PER_ELEMENT === 1 && callerAddress_0.bytes.length === 32)) {
511
607
  __compactRuntime.typeError('constructSignBidirectionalEventNotificationV1',
512
608
  'argument 1',
513
- 'Signet.compact line 209 char 3',
609
+ 'Signet.compact line 213 char 3',
514
610
  'struct ContractAddress<bytes: Bytes<32>>',
515
611
  callerAddress_0)
516
612
  }
517
613
  if (!(typeof(requestsIndexField_0) === 'bigint' && requestsIndexField_0 >= 0n && requestsIndexField_0 <= 255n)) {
518
614
  __compactRuntime.typeError('constructSignBidirectionalEventNotificationV1',
519
615
  'argument 2',
520
- 'Signet.compact line 209 char 3',
616
+ 'Signet.compact line 213 char 3',
521
617
  'Uint<0..256>',
522
618
  requestsIndexField_0)
523
619
  }
@@ -525,36 +621,27 @@ export const pureCircuits = {
525
621
  requestsIndexField_0);
526
622
  },
527
623
  signetAttestationDigest: (...args_0) => {
528
- if (args_0.length !== 3) {
529
- throw new __compactRuntime.CompactError(`signetAttestationDigest: expected 3 arguments (as invoked from Typescript), received ${args_0.length}`);
624
+ if (args_0.length !== 2) {
625
+ throw new __compactRuntime.CompactError(`signetAttestationDigest: expected 2 arguments (as invoked from Typescript), received ${args_0.length}`);
530
626
  }
531
627
  const requestId_0 = args_0[0];
532
628
  const serializedOutput_0 = args_0[1];
533
- const outputLen_0 = args_0[2];
534
629
  if (!(requestId_0.buffer instanceof ArrayBuffer && requestId_0.BYTES_PER_ELEMENT === 1 && requestId_0.length === 32)) {
535
630
  __compactRuntime.typeError('signetAttestationDigest',
536
631
  'argument 1',
537
- 'Signet.compact line 278 char 3',
632
+ 'Signet.compact line 300 char 3',
538
633
  'Bytes<32>',
539
634
  requestId_0)
540
635
  }
541
636
  if (!(serializedOutput_0.buffer instanceof ArrayBuffer && serializedOutput_0.BYTES_PER_ELEMENT === 1 && serializedOutput_0.length === 128)) {
542
637
  __compactRuntime.typeError('signetAttestationDigest',
543
638
  'argument 2',
544
- 'Signet.compact line 278 char 3',
639
+ 'Signet.compact line 300 char 3',
545
640
  'Bytes<128>',
546
641
  serializedOutput_0)
547
642
  }
548
- if (!(typeof(outputLen_0) === 'bigint' && outputLen_0 >= 0n && outputLen_0 <= 255n)) {
549
- __compactRuntime.typeError('signetAttestationDigest',
550
- 'argument 3',
551
- 'Signet.compact line 278 char 3',
552
- 'Uint<0..256>',
553
- outputLen_0)
554
- }
555
643
  return _dummyContract._signetAttestationDigest_0(requestId_0,
556
- serializedOutput_0,
557
- outputLen_0);
644
+ serializedOutput_0);
558
645
  },
559
646
  verifyRespondBidirectionalEvent: (...args_0) => {
560
647
  if (args_0.length !== 3) {
@@ -566,15 +653,15 @@ export const pureCircuits = {
566
653
  if (!(requestId_0.buffer instanceof ArrayBuffer && requestId_0.BYTES_PER_ELEMENT === 1 && requestId_0.length === 32)) {
567
654
  __compactRuntime.typeError('verifyRespondBidirectionalEvent',
568
655
  'argument 1',
569
- 'Signet.compact line 296 char 3',
656
+ 'Signet.compact line 333 char 3',
570
657
  'Bytes<32>',
571
658
  requestId_0)
572
659
  }
573
- 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)) {
660
+ 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 && typeof(respondBidirectionalEvent_0.signature) === 'object' && typeof(respondBidirectionalEvent_0.signature.bigR) === 'object' && respondBidirectionalEvent_0.signature.bigR.x.buffer instanceof ArrayBuffer && respondBidirectionalEvent_0.signature.bigR.x.BYTES_PER_ELEMENT === 1 && respondBidirectionalEvent_0.signature.bigR.x.length === 32 && respondBidirectionalEvent_0.signature.bigR.y.buffer instanceof ArrayBuffer && respondBidirectionalEvent_0.signature.bigR.y.BYTES_PER_ELEMENT === 1 && respondBidirectionalEvent_0.signature.bigR.y.length === 32 && respondBidirectionalEvent_0.signature.s.buffer instanceof ArrayBuffer && respondBidirectionalEvent_0.signature.s.BYTES_PER_ELEMENT === 1 && respondBidirectionalEvent_0.signature.s.length === 32 && typeof(respondBidirectionalEvent_0.signature.recoveryId) === 'bigint' && respondBidirectionalEvent_0.signature.recoveryId >= 0n && respondBidirectionalEvent_0.signature.recoveryId <= 255n)) {
574
661
  __compactRuntime.typeError('verifyRespondBidirectionalEvent',
575
662
  'argument 2',
576
- 'Signet.compact line 296 char 3',
577
- 'struct RespondBidirectionalEvent<serializedOutput: Bytes<128>, outputLen: Uint<0..256>, r: Bytes<32>, s: Bytes<32>, recoveryId: Uint<0..256>>',
663
+ 'Signet.compact line 333 char 3',
664
+ 'struct RespondBidirectionalEvent<serializedOutput: Bytes<128>, outputLen: Uint<0..256>, signature: struct Signature<bigR: struct AffinePoint<x: Bytes<32>, y: Bytes<32>>, s: Bytes<32>, recoveryId: Uint<0..256>>>',
578
665
  respondBidirectionalEvent_0)
579
666
  }
580
667
  return _dummyContract._verifyRespondBidirectionalEvent_0(requestId_0,
@@ -596,7 +683,7 @@ export const pureCircuits = {
596
683
  if (!(addr_0.buffer instanceof ArrayBuffer && addr_0.BYTES_PER_ELEMENT === 1 && addr_0.length === 20)) {
597
684
  __compactRuntime.typeError('evmAddressAbiWord',
598
685
  'argument 1',
599
- 'Signet.compact line 381 char 3',
686
+ 'Signet.compact line 415 char 3',
600
687
  'Bytes<20>',
601
688
  addr_0)
602
689
  }
@@ -610,12 +697,26 @@ export const pureCircuits = {
610
697
  if (!(typeof(value_0) === 'bigint' && value_0 >= 0n && value_0 <= 340282366920938463463374607431768211455n)) {
611
698
  __compactRuntime.typeError('numericAbiWord',
612
699
  'argument 1',
613
- 'Signet.compact line 388 char 3',
700
+ 'Signet.compact line 421 char 3',
614
701
  'Uint<0..340282366920938463463374607431768211456>',
615
702
  value_0)
616
703
  }
617
704
  return _dummyContract._numericAbiWord_0(value_0);
618
705
  },
706
+ boolAbiWord: (...args_0) => {
707
+ if (args_0.length !== 1) {
708
+ throw new __compactRuntime.CompactError(`boolAbiWord: expected 1 argument (as invoked from Typescript), received ${args_0.length}`);
709
+ }
710
+ const value_0 = args_0[0];
711
+ if (!(typeof(value_0) === 'boolean')) {
712
+ __compactRuntime.typeError('boolAbiWord',
713
+ 'argument 1',
714
+ 'Signet.compact line 434 char 3',
715
+ 'Boolean',
716
+ value_0)
717
+ }
718
+ return _dummyContract._boolAbiWord_0(value_0);
719
+ },
619
720
  abiWordToUint128: (...args_0) => {
620
721
  if (args_0.length !== 1) {
621
722
  throw new __compactRuntime.CompactError(`abiWordToUint128: expected 1 argument (as invoked from Typescript), received ${args_0.length}`);
@@ -624,11 +725,25 @@ export const pureCircuits = {
624
725
  if (!(word_0.buffer instanceof ArrayBuffer && word_0.BYTES_PER_ELEMENT === 1 && word_0.length === 32)) {
625
726
  __compactRuntime.typeError('abiWordToUint128',
626
727
  'argument 1',
627
- 'Signet.compact line 401 char 3',
728
+ 'Signet.compact line 442 char 3',
628
729
  'Bytes<32>',
629
730
  word_0)
630
731
  }
631
732
  return _dummyContract._abiWordToUint128_0(word_0);
733
+ },
734
+ abiWordToBool: (...args_0) => {
735
+ if (args_0.length !== 1) {
736
+ throw new __compactRuntime.CompactError(`abiWordToBool: expected 1 argument (as invoked from Typescript), received ${args_0.length}`);
737
+ }
738
+ const word_0 = args_0[0];
739
+ if (!(word_0.buffer instanceof ArrayBuffer && word_0.BYTES_PER_ELEMENT === 1 && word_0.length === 32)) {
740
+ __compactRuntime.typeError('abiWordToBool',
741
+ 'argument 1',
742
+ 'Signet.compact line 465 char 3',
743
+ 'Bytes<32>',
744
+ word_0)
745
+ }
746
+ return _dummyContract._abiWordToBool_0(word_0);
632
747
  }
633
748
  };
634
749
  export const contractReferenceLocations =