@sig-net/midnight 0.0.9 → 0.10.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.
@@ -1,53 +1,53 @@
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
+
16
+ const _descriptor_6 = new __compactRuntime.CompactTypeUnsignedInteger(255n, 1);
15
17
 
16
18
  class _RespondBidirectionalEvent_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_5.alignment().concat(_descriptor_6.alignment().concat(_descriptor_0.alignment().concat(_descriptor_0.alignment().concat(_descriptor_6.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
+ serializedOutput: _descriptor_5.fromValue(value_0),
25
+ outputLen: _descriptor_6.fromValue(value_0),
26
+ r: _descriptor_0.fromValue(value_0),
27
+ s: _descriptor_0.fromValue(value_0),
28
+ recoveryId: _descriptor_6.fromValue(value_0)
27
29
  }
28
30
  }
29
31
  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)))));
32
+ return _descriptor_5.toValue(value_0.serializedOutput).concat(_descriptor_6.toValue(value_0.outputLen).concat(_descriptor_0.toValue(value_0.r).concat(_descriptor_0.toValue(value_0.s).concat(_descriptor_6.toValue(value_0.recoveryId)))));
31
33
  }
32
34
  }
33
35
 
34
- const _descriptor_6 = new _RespondBidirectionalEvent_0();
35
-
36
- const _descriptor_7 = __compactRuntime.CompactTypeBoolean;
36
+ const _descriptor_7 = new _RespondBidirectionalEvent_0();
37
37
 
38
38
  const _descriptor_8 = __compactRuntime.CompactTypeSecp256k1Scalar;
39
39
 
40
40
  class _ContractAddress_0 {
41
41
  alignment() {
42
- return _descriptor_1.alignment();
42
+ return _descriptor_0.alignment();
43
43
  }
44
44
  fromValue(value_0) {
45
45
  return {
46
- bytes: _descriptor_1.fromValue(value_0)
46
+ bytes: _descriptor_0.fromValue(value_0)
47
47
  }
48
48
  }
49
49
  toValue(value_0) {
50
- return _descriptor_1.toValue(value_0.bytes);
50
+ return _descriptor_0.toValue(value_0.bytes);
51
51
  }
52
52
  }
53
53
 
@@ -55,16 +55,16 @@ const _descriptor_9 = new _ContractAddress_0();
55
55
 
56
56
  class _SignBidirectionalEventNotification_0 {
57
57
  alignment() {
58
- return _descriptor_5.alignment().concat(_descriptor_4.alignment());
58
+ return _descriptor_6.alignment().concat(_descriptor_5.alignment());
59
59
  }
60
60
  fromValue(value_0) {
61
61
  return {
62
- version: _descriptor_5.fromValue(value_0),
63
- payload: _descriptor_4.fromValue(value_0)
62
+ version: _descriptor_6.fromValue(value_0),
63
+ payload: _descriptor_5.fromValue(value_0)
64
64
  }
65
65
  }
66
66
  toValue(value_0) {
67
- return _descriptor_5.toValue(value_0.version).concat(_descriptor_4.toValue(value_0.payload));
67
+ return _descriptor_6.toValue(value_0.version).concat(_descriptor_5.toValue(value_0.payload));
68
68
  }
69
69
  }
70
70
 
@@ -72,7 +72,7 @@ const _descriptor_10 = new _SignBidirectionalEventNotification_0();
72
72
 
73
73
  const _descriptor_11 = __compactRuntime.CompactTypeSecp256k1Base;
74
74
 
75
- const _descriptor_12 = new __compactRuntime.CompactTypeVector(2, _descriptor_1);
75
+ const _descriptor_12 = new __compactRuntime.CompactTypeVector(2, _descriptor_0);
76
76
 
77
77
  class _Secp256k1EcdsaSignature_0 {
78
78
  alignment() {
@@ -95,17 +95,17 @@ const _descriptor_14 = new __compactRuntime.CompactTypeUnsignedInteger(184467440
95
95
 
96
96
  class _Either_0 {
97
97
  alignment() {
98
- return _descriptor_7.alignment().concat(_descriptor_1.alignment().concat(_descriptor_1.alignment()));
98
+ return _descriptor_2.alignment().concat(_descriptor_0.alignment().concat(_descriptor_0.alignment()));
99
99
  }
100
100
  fromValue(value_0) {
101
101
  return {
102
- is_left: _descriptor_7.fromValue(value_0),
103
- left: _descriptor_1.fromValue(value_0),
104
- right: _descriptor_1.fromValue(value_0)
102
+ is_left: _descriptor_2.fromValue(value_0),
103
+ left: _descriptor_0.fromValue(value_0),
104
+ right: _descriptor_0.fromValue(value_0)
105
105
  }
106
106
  }
107
107
  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)));
108
+ return _descriptor_2.toValue(value_0.is_left).concat(_descriptor_0.toValue(value_0.left).concat(_descriptor_0.toValue(value_0.right)));
109
109
  }
110
110
  }
111
111
 
@@ -143,8 +143,14 @@ export class Contract {
143
143
  async numericAbiWord(context, ...args_1) {
144
144
  return { result: pureCircuits.numericAbiWord(...args_1), context };
145
145
  },
146
+ async boolAbiWord(context, ...args_1) {
147
+ return { result: pureCircuits.boolAbiWord(...args_1), context };
148
+ },
146
149
  async abiWordToUint128(context, ...args_1) {
147
150
  return { result: pureCircuits.abiWordToUint128(...args_1), context };
151
+ },
152
+ async abiWordToBool(context, ...args_1) {
153
+ return { result: pureCircuits.abiWordToBool(...args_1), context };
148
154
  }
149
155
  };
150
156
  this.impureCircuits = {};
@@ -247,11 +253,11 @@ export class Contract {
247
253
  return result_0;
248
254
  }
249
255
  _persistentHash_1(value_0) {
250
- const result_0 = __compactRuntime.persistentHash(_descriptor_4, value_0);
256
+ const result_0 = __compactRuntime.persistentHash(_descriptor_5, value_0);
251
257
  return result_0;
252
258
  }
253
259
  _persistentHash_2(value_0) {
254
- const result_0 = __compactRuntime.persistentHash(_descriptor_2, value_0);
260
+ const result_0 = __compactRuntime.persistentHash(_descriptor_3, value_0);
255
261
  return result_0;
256
262
  }
257
263
  _mul_0(x_0, y_0) {
@@ -292,7 +298,7 @@ export class Contract {
292
298
  const outHash_0 = this._persistentHash_0([this._persistentHash_1(serializedOutput_0),
293
299
  __compactRuntime.convertBigintToBytes(32,
294
300
  outputLen_0,
295
- 'Signet.compact line 285 char 7')]);
301
+ 'Signet.compact line 287 char 7')]);
296
302
  return this._persistentHash_0([requestId_0, outHash_0]);
297
303
  }
298
304
  _verifyRespondBidirectionalEvent_0(requestId_0,
@@ -307,13 +313,13 @@ export class Contract {
307
313
  32,
308
314
  respondBidirectionalEvent_0.r,
309
315
  'Secp256k1Scalar',
310
- 'Signet.compact line 308 char 12'),
316
+ 'Signet.compact line 310 char 12'),
311
317
  s:
312
318
  __compactRuntime.convertBytesToField(115792089237316195423570985008687907852837564279074904382605163141518161494336n,
313
319
  32,
314
320
  respondBidirectionalEvent_0.s,
315
321
  'Secp256k1Scalar',
316
- 'Signet.compact line 309 char 12') },
322
+ 'Signet.compact line 311 char 12') },
317
323
  mpcResponseKey_0);
318
324
  }
319
325
  _signetKeyHash_0(pk_0) { return this._persistentHash_2(pk_0); }
@@ -325,7 +331,7 @@ export class Contract {
325
331
  _numericAbiWord_0(value_0) {
326
332
  const le_0 = Array.from(__compactRuntime.convertBigintToBytes(16,
327
333
  value_0,
328
- 'Signet.compact line 389 char 17'),
334
+ 'Signet.compact line 390 char 17'),
329
335
  BigInt);
330
336
  return Uint8Array.from([...Array.from(new Uint8Array(16), BigInt),
331
337
  le_0[15],
@@ -346,13 +352,18 @@ export class Contract {
346
352
  le_0[0]],
347
353
  Number);
348
354
  }
355
+ _boolAbiWord_0(value_0) {
356
+ return Uint8Array.from([...Array.from(new Uint8Array(31), BigInt),
357
+ value_0 ? 1n : 0n],
358
+ Number);
359
+ }
349
360
  _abiWordToUint128_0(word_0) {
350
361
  __compactRuntime.assert(__compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
351
362
  16,
352
363
  ((e, i) => e.slice(i, i+16))(word_0,
353
364
  Number(0n)),
354
365
  'Field',
355
- 'Signet.compact line 402 char 12')
366
+ 'Signet.compact line 409 char 12')
356
367
  ===
357
368
  0n,
358
369
  'ABI word exceeds Uint<128>');
@@ -361,77 +372,77 @@ export class Contract {
361
372
  ((e, i) => e.slice(i, i+1))(word_0,
362
373
  Number(16n)),
363
374
  'Field',
364
- 'Signet.compact line 403 char 17');
375
+ 'Signet.compact line 410 char 17');
365
376
  const b1_0 = __compactRuntime.addField(__compactRuntime.mulField(b0_0, 256n),
366
377
  __compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
367
378
  1,
368
379
  ((e, i) => e.slice(i, i+1))(word_0,
369
380
  Number(17n)),
370
381
  'Field',
371
- 'Signet.compact line 404 char 30'));
382
+ 'Signet.compact line 411 char 30'));
372
383
  const b2_0 = __compactRuntime.addField(__compactRuntime.mulField(b1_0, 256n),
373
384
  __compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
374
385
  1,
375
386
  ((e, i) => e.slice(i, i+1))(word_0,
376
387
  Number(18n)),
377
388
  'Field',
378
- 'Signet.compact line 405 char 30'));
389
+ 'Signet.compact line 412 char 30'));
379
390
  const b3_0 = __compactRuntime.addField(__compactRuntime.mulField(b2_0, 256n),
380
391
  __compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
381
392
  1,
382
393
  ((e, i) => e.slice(i, i+1))(word_0,
383
394
  Number(19n)),
384
395
  'Field',
385
- 'Signet.compact line 406 char 30'));
396
+ 'Signet.compact line 413 char 30'));
386
397
  const b4_0 = __compactRuntime.addField(__compactRuntime.mulField(b3_0, 256n),
387
398
  __compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
388
399
  1,
389
400
  ((e, i) => e.slice(i, i+1))(word_0,
390
401
  Number(20n)),
391
402
  'Field',
392
- 'Signet.compact line 407 char 30'));
403
+ 'Signet.compact line 414 char 30'));
393
404
  const b5_0 = __compactRuntime.addField(__compactRuntime.mulField(b4_0, 256n),
394
405
  __compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
395
406
  1,
396
407
  ((e, i) => e.slice(i, i+1))(word_0,
397
408
  Number(21n)),
398
409
  'Field',
399
- 'Signet.compact line 408 char 30'));
410
+ 'Signet.compact line 415 char 30'));
400
411
  const b6_0 = __compactRuntime.addField(__compactRuntime.mulField(b5_0, 256n),
401
412
  __compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
402
413
  1,
403
414
  ((e, i) => e.slice(i, i+1))(word_0,
404
415
  Number(22n)),
405
416
  'Field',
406
- 'Signet.compact line 409 char 30'));
417
+ 'Signet.compact line 416 char 30'));
407
418
  const b7_0 = __compactRuntime.addField(__compactRuntime.mulField(b6_0, 256n),
408
419
  __compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
409
420
  1,
410
421
  ((e, i) => e.slice(i, i+1))(word_0,
411
422
  Number(23n)),
412
423
  'Field',
413
- 'Signet.compact line 410 char 30'));
424
+ 'Signet.compact line 417 char 30'));
414
425
  const b8_0 = __compactRuntime.addField(__compactRuntime.mulField(b7_0, 256n),
415
426
  __compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
416
427
  1,
417
428
  ((e, i) => e.slice(i, i+1))(word_0,
418
429
  Number(24n)),
419
430
  'Field',
420
- 'Signet.compact line 411 char 30'));
431
+ 'Signet.compact line 418 char 30'));
421
432
  const b9_0 = __compactRuntime.addField(__compactRuntime.mulField(b8_0, 256n),
422
433
  __compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
423
434
  1,
424
435
  ((e, i) => e.slice(i, i+1))(word_0,
425
436
  Number(25n)),
426
437
  'Field',
427
- 'Signet.compact line 412 char 30'));
438
+ 'Signet.compact line 419 char 30'));
428
439
  const b10_0 = __compactRuntime.addField(__compactRuntime.mulField(b9_0, 256n),
429
440
  __compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
430
441
  1,
431
442
  ((e, i) => e.slice(i, i+1))(word_0,
432
443
  Number(26n)),
433
444
  'Field',
434
- 'Signet.compact line 413 char 30'));
445
+ 'Signet.compact line 420 char 30'));
435
446
  const b11_0 = __compactRuntime.addField(__compactRuntime.mulField(b10_0,
436
447
  256n),
437
448
  __compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
@@ -439,7 +450,7 @@ export class Contract {
439
450
  ((e, i) => e.slice(i, i+1))(word_0,
440
451
  Number(27n)),
441
452
  'Field',
442
- 'Signet.compact line 414 char 30'));
453
+ 'Signet.compact line 421 char 30'));
443
454
  const b12_0 = __compactRuntime.addField(__compactRuntime.mulField(b11_0,
444
455
  256n),
445
456
  __compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
@@ -447,7 +458,7 @@ export class Contract {
447
458
  ((e, i) => e.slice(i, i+1))(word_0,
448
459
  Number(28n)),
449
460
  'Field',
450
- 'Signet.compact line 415 char 30'));
461
+ 'Signet.compact line 422 char 30'));
451
462
  const b13_0 = __compactRuntime.addField(__compactRuntime.mulField(b12_0,
452
463
  256n),
453
464
  __compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
@@ -455,7 +466,7 @@ export class Contract {
455
466
  ((e, i) => e.slice(i, i+1))(word_0,
456
467
  Number(29n)),
457
468
  'Field',
458
- 'Signet.compact line 416 char 30'));
469
+ 'Signet.compact line 423 char 30'));
459
470
  const b14_0 = __compactRuntime.addField(__compactRuntime.mulField(b13_0,
460
471
  256n),
461
472
  __compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
@@ -463,7 +474,7 @@ export class Contract {
463
474
  ((e, i) => e.slice(i, i+1))(word_0,
464
475
  Number(30n)),
465
476
  'Field',
466
- 'Signet.compact line 417 char 30'));
477
+ 'Signet.compact line 424 char 30'));
467
478
  const b15_0 = __compactRuntime.addField(__compactRuntime.mulField(b14_0,
468
479
  256n),
469
480
  __compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
@@ -471,14 +482,34 @@ export class Contract {
471
482
  ((e, i) => e.slice(i, i+1))(word_0,
472
483
  Number(31n)),
473
484
  'Field',
474
- 'Signet.compact line 418 char 30'));
485
+ 'Signet.compact line 425 char 30'));
475
486
  return ((t1) => {
476
487
  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');
488
+ throw new __compactRuntime.CompactError('Signet.compact line 426 char 12: cast from Field or Uint value to smaller Uint value failed: ' + t1 + ' is greater than 340282366920938463463374607431768211455');
478
489
  }
479
490
  return t1;
480
491
  })(b15_0);
481
492
  }
493
+ _abiWordToBool_0(word_0) {
494
+ __compactRuntime.assert(__compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
495
+ 31,
496
+ ((e, i) => e.slice(i, i+31))(word_0,
497
+ Number(0n)),
498
+ 'Field',
499
+ 'Signet.compact line 432 char 12')
500
+ ===
501
+ 0n,
502
+ 'ABI word is not a canonical Boolean');
503
+ const last_0 = __compactRuntime.convertBytesToUint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
504
+ 1,
505
+ ((e, i) => e.slice(i, i+1))(word_0,
506
+ Number(31n)),
507
+ 'Field',
508
+ 'Signet.compact line 433 char 18');
509
+ __compactRuntime.assert(last_0 === 0n || last_0 === 1n,
510
+ 'ABI word is not a canonical Boolean');
511
+ return last_0 === 1n;
512
+ }
482
513
  }
483
514
  export function ledger(stateOrChargedState) {
484
515
  const state = stateOrChargedState instanceof __compactRuntime.StateValue ? stateOrChargedState : stateOrChargedState.state;
@@ -510,14 +541,14 @@ export const pureCircuits = {
510
541
  if (!(typeof(callerAddress_0) === 'object' && callerAddress_0.bytes.buffer instanceof ArrayBuffer && callerAddress_0.bytes.BYTES_PER_ELEMENT === 1 && callerAddress_0.bytes.length === 32)) {
511
542
  __compactRuntime.typeError('constructSignBidirectionalEventNotificationV1',
512
543
  'argument 1',
513
- 'Signet.compact line 209 char 3',
544
+ 'Signet.compact line 211 char 3',
514
545
  'struct ContractAddress<bytes: Bytes<32>>',
515
546
  callerAddress_0)
516
547
  }
517
548
  if (!(typeof(requestsIndexField_0) === 'bigint' && requestsIndexField_0 >= 0n && requestsIndexField_0 <= 255n)) {
518
549
  __compactRuntime.typeError('constructSignBidirectionalEventNotificationV1',
519
550
  'argument 2',
520
- 'Signet.compact line 209 char 3',
551
+ 'Signet.compact line 211 char 3',
521
552
  'Uint<0..256>',
522
553
  requestsIndexField_0)
523
554
  }
@@ -534,21 +565,21 @@ export const pureCircuits = {
534
565
  if (!(requestId_0.buffer instanceof ArrayBuffer && requestId_0.BYTES_PER_ELEMENT === 1 && requestId_0.length === 32)) {
535
566
  __compactRuntime.typeError('signetAttestationDigest',
536
567
  'argument 1',
537
- 'Signet.compact line 278 char 3',
568
+ 'Signet.compact line 280 char 3',
538
569
  'Bytes<32>',
539
570
  requestId_0)
540
571
  }
541
572
  if (!(serializedOutput_0.buffer instanceof ArrayBuffer && serializedOutput_0.BYTES_PER_ELEMENT === 1 && serializedOutput_0.length === 128)) {
542
573
  __compactRuntime.typeError('signetAttestationDigest',
543
574
  'argument 2',
544
- 'Signet.compact line 278 char 3',
575
+ 'Signet.compact line 280 char 3',
545
576
  'Bytes<128>',
546
577
  serializedOutput_0)
547
578
  }
548
579
  if (!(typeof(outputLen_0) === 'bigint' && outputLen_0 >= 0n && outputLen_0 <= 255n)) {
549
580
  __compactRuntime.typeError('signetAttestationDigest',
550
581
  'argument 3',
551
- 'Signet.compact line 278 char 3',
582
+ 'Signet.compact line 280 char 3',
552
583
  'Uint<0..256>',
553
584
  outputLen_0)
554
585
  }
@@ -566,14 +597,14 @@ export const pureCircuits = {
566
597
  if (!(requestId_0.buffer instanceof ArrayBuffer && requestId_0.BYTES_PER_ELEMENT === 1 && requestId_0.length === 32)) {
567
598
  __compactRuntime.typeError('verifyRespondBidirectionalEvent',
568
599
  'argument 1',
569
- 'Signet.compact line 296 char 3',
600
+ 'Signet.compact line 298 char 3',
570
601
  'Bytes<32>',
571
602
  requestId_0)
572
603
  }
573
604
  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)) {
574
605
  __compactRuntime.typeError('verifyRespondBidirectionalEvent',
575
606
  'argument 2',
576
- 'Signet.compact line 296 char 3',
607
+ 'Signet.compact line 298 char 3',
577
608
  'struct RespondBidirectionalEvent<serializedOutput: Bytes<128>, outputLen: Uint<0..256>, r: Bytes<32>, s: Bytes<32>, recoveryId: Uint<0..256>>',
578
609
  respondBidirectionalEvent_0)
579
610
  }
@@ -610,12 +641,26 @@ export const pureCircuits = {
610
641
  if (!(typeof(value_0) === 'bigint' && value_0 >= 0n && value_0 <= 340282366920938463463374607431768211455n)) {
611
642
  __compactRuntime.typeError('numericAbiWord',
612
643
  'argument 1',
613
- 'Signet.compact line 388 char 3',
644
+ 'Signet.compact line 387 char 3',
614
645
  'Uint<0..340282366920938463463374607431768211456>',
615
646
  value_0)
616
647
  }
617
648
  return _dummyContract._numericAbiWord_0(value_0);
618
649
  },
650
+ boolAbiWord: (...args_0) => {
651
+ if (args_0.length !== 1) {
652
+ throw new __compactRuntime.CompactError(`boolAbiWord: expected 1 argument (as invoked from Typescript), received ${args_0.length}`);
653
+ }
654
+ const value_0 = args_0[0];
655
+ if (!(typeof(value_0) === 'boolean')) {
656
+ __compactRuntime.typeError('boolAbiWord',
657
+ 'argument 1',
658
+ 'Signet.compact line 400 char 3',
659
+ 'Boolean',
660
+ value_0)
661
+ }
662
+ return _dummyContract._boolAbiWord_0(value_0);
663
+ },
619
664
  abiWordToUint128: (...args_0) => {
620
665
  if (args_0.length !== 1) {
621
666
  throw new __compactRuntime.CompactError(`abiWordToUint128: expected 1 argument (as invoked from Typescript), received ${args_0.length}`);
@@ -624,11 +669,25 @@ export const pureCircuits = {
624
669
  if (!(word_0.buffer instanceof ArrayBuffer && word_0.BYTES_PER_ELEMENT === 1 && word_0.length === 32)) {
625
670
  __compactRuntime.typeError('abiWordToUint128',
626
671
  'argument 1',
627
- 'Signet.compact line 401 char 3',
672
+ 'Signet.compact line 408 char 3',
628
673
  'Bytes<32>',
629
674
  word_0)
630
675
  }
631
676
  return _dummyContract._abiWordToUint128_0(word_0);
677
+ },
678
+ abiWordToBool: (...args_0) => {
679
+ if (args_0.length !== 1) {
680
+ throw new __compactRuntime.CompactError(`abiWordToBool: expected 1 argument (as invoked from Typescript), received ${args_0.length}`);
681
+ }
682
+ const word_0 = args_0[0];
683
+ if (!(word_0.buffer instanceof ArrayBuffer && word_0.BYTES_PER_ELEMENT === 1 && word_0.length === 32)) {
684
+ __compactRuntime.typeError('abiWordToBool',
685
+ 'argument 1',
686
+ 'Signet.compact line 431 char 3',
687
+ 'Bytes<32>',
688
+ word_0)
689
+ }
690
+ return _dummyContract._abiWordToBool_0(word_0);
632
691
  }
633
692
  };
634
693
  export const contractReferenceLocations =
@@ -4,5 +4,5 @@
4
4
  "sourceRoot": "../../../",
5
5
  "sources": ["src/circuits.compact", "src/./Signet.compact", "compiler/zkir-v3-library.compact"],
6
6
  "names": [],
7
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAA;;;;;;;;;;MCgNE,MAAA,6CAWC;;OAAA;MA0DD,MAAA,uBAUC;;OAAA;MAQD,MAAA,+BAiBC;;OAAA;MAKD,MAAA,aAEC;;OAAA;MA6DD,MAAA,iBAEC;;OAAA;MAKD,MAAA,cAOC;;OAAA;MAMD,MAAA,gBAmBC;;OAAA;;;;GD1XF;EAzCD;;;;;;;;;;;;;;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AA,6CAWC;;;;UARC,eAA8B;UAC9B,oBAA2B;;;;;;;;;;;;;;;2EAD3B,eAA8B;2EAC9B,oBAA2B;GAO5B;EA0DD,AAAA,uBAUC;;;;UATC,WAAoB;UACpB,kBAA4B;UAC5B,WAAkB;;;;;;;;;;;;;;;;;;;;;;qDAFlB,WAAoB;qDACpB,kBAA4B;qDAC5B,WAAkB;GAOnB;EAQD,AAAA,+BAiBC;;;;UAhBC,WAAoB;UACpB,2BAAoD;UACpD,gBAA8B;;;;;;;;;;;;;;;6DAF9B,WAAoB;6DACpB,2BAAoD;6DACpD,gBAA8B;GAc/B;EAKD,AAAA,aAEC;;;;UAFiC,IAAkB;2CAAlB,IAAkB;GAEnD;EA2DD,AAAA,iBAEC;;;;UAFqC,MAAe;;;;;;;;+CAAf,MAAe;GAEpD;EAID,AAAA,cASC;;;;UATkC,OAAgB;;;;;;;;4CAAhB,OAAgB;GASlD;EAID,AAAA,WAEC;;;;UAF+B,OAAc;;;;;;;;yCAAd,OAAc;GAE7C;EAMD,AAAA,gBAmBC;;;;UAnBoC,MAAe;;;;;;;;8CAAf,MAAe;GAmBnD;EAID,AAAA,aAKC;;;;UALiC,MAAe;;;;;;;;2CAAf,MAAe;GAKhD;;;;;;"
8
8
  }
@@ -139,6 +139,15 @@ export declare function numericAbiWord(value: bigint): Uint8Array;
139
139
  * @throws Error if the address is not exactly 20 bytes.
140
140
  */
141
141
  export declare function evmAddressAbiWord(address: Uint8Array): Uint8Array;
142
+ /**
143
+ * The ABI word for a Boolean: 31 zero bytes, then 0x01 (true) or 0x00
144
+ * (false). TS mirror of Signet.compact's `boolAbiWord` circuit
145
+ * (lockstep-tested against the compiled circuit).
146
+ *
147
+ * @param value - The word's Boolean value.
148
+ * @returns The ABI-ready 32-byte word to store in an {@link EVMCalldata} word.
149
+ */
150
+ export declare function boolAbiWord(value: boolean): Uint8Array;
142
151
  /**
143
152
  * Read a numeric ABI word back into a bigint: the big-endian reading of bytes
144
153
  * 16..31. TS mirror of Signet.compact's `abiWordToUint128` circuit, including
@@ -150,6 +159,16 @@ export declare function evmAddressAbiWord(address: Uint8Array): Uint8Array;
150
159
  * @throws Error if the word is not 32 bytes or its leading half is nonzero.
151
160
  */
152
161
  export declare function abiWordToUint128(word: Uint8Array): bigint;
162
+ /**
163
+ * Read a Boolean ABI word back into a boolean. TS mirror of Signet.compact's
164
+ * `abiWordToBool` circuit, including its canonicality check: the first 31
165
+ * bytes must be zero and the last byte 0 or 1.
166
+ *
167
+ * @param word - The ABI-ready 32-byte word.
168
+ * @returns The word's Boolean value.
169
+ * @throws Error if the word is not 32 bytes or is not a canonical Boolean.
170
+ */
171
+ export declare function abiWordToBool(word: Uint8Array): boolean;
153
172
  /**
154
173
  * Assemble the raw calldata a request's words describe:
155
174
  * `data = selector || words[0..noWords]`, VERBATIM. Words are stored
@@ -1 +1 @@
1
- {"version":3,"file":"signet-evtype2tx-requests.d.ts","sourceRoot":"","sources":["../src/signet-evtype2tx-requests.ts"],"names":[],"mappings":"AAYA,OAAO,EAKL,KAAK,WAAW,EACjB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAwB,SAAS,EAAE,WAAW,EAAE,MAAM,QAAQ,CAAC;AAEtE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AACjF,OAAO,EAKL,KAAK,KAAK,EACV,KAAK,SAAS,EACd,KAAK,sBAAsB,EAC5B,MAAM,sBAAsB,CAAC;AAE9B;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IAC1B,yDAAyD;IACzD,QAAQ,EAAE,UAAU,CAAC;IACrB,6EAA6E;IAC7E,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,KAAK,EAAE,UAAU,EAAE,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IACjC,iEAAiE;IACjE,OAAO,EAAE,UAAU,CAAC;IACpB,qDAAqD;IACrD,eAAe,EAAE,MAAM,CAAC;IACxB,sEAAsE;IACtE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,wBAAgB,4CAA4C,CAC1D,OAAO,EAAE,sBAAsB,EAC/B,QAAQ,EAAE,uBAAuB,GAChC,WAAW,CAIb"}
@@ -142,6 +142,19 @@ export function evmAddressAbiWord(address) {
142
142
  word.set(address, 12);
143
143
  return word;
144
144
  }
145
+ /**
146
+ * The ABI word for a Boolean: 31 zero bytes, then 0x01 (true) or 0x00
147
+ * (false). TS mirror of Signet.compact's `boolAbiWord` circuit
148
+ * (lockstep-tested against the compiled circuit).
149
+ *
150
+ * @param value - The word's Boolean value.
151
+ * @returns The ABI-ready 32-byte word to store in an {@link EVMCalldata} word.
152
+ */
153
+ export function boolAbiWord(value) {
154
+ const word = new Uint8Array(32);
155
+ word[31] = value ? 1 : 0;
156
+ return word;
157
+ }
145
158
  /**
146
159
  * Read a numeric ABI word back into a bigint: the big-endian reading of bytes
147
160
  * 16..31. TS mirror of Signet.compact's `abiWordToUint128` circuit, including
@@ -165,6 +178,24 @@ export function abiWordToUint128(word) {
165
178
  }
166
179
  return value;
167
180
  }
181
+ /**
182
+ * Read a Boolean ABI word back into a boolean. TS mirror of Signet.compact's
183
+ * `abiWordToBool` circuit, including its canonicality check: the first 31
184
+ * bytes must be zero and the last byte 0 or 1.
185
+ *
186
+ * @param word - The ABI-ready 32-byte word.
187
+ * @returns The word's Boolean value.
188
+ * @throws Error if the word is not 32 bytes or is not a canonical Boolean.
189
+ */
190
+ export function abiWordToBool(word) {
191
+ if (word.length !== 32) {
192
+ throw new Error(`ABI word must be 32 bytes, got ${word.length}`);
193
+ }
194
+ if (word.slice(0, 31).some((byte) => byte !== 0) || word[31] > 1) {
195
+ throw new Error("ABI word is not a canonical Boolean");
196
+ }
197
+ return word[31] === 1;
198
+ }
168
199
  /**
169
200
  * Assemble the raw calldata a request's words describe:
170
201
  * `data = selector || words[0..noWords]`, VERBATIM. Words are stored