@sig-net/midnight-contract 0.0.1
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/dist/contract-surface.d.ts +20 -0
- package/dist/contract-surface.d.ts.map +1 -0
- package/dist/contract-surface.js +17 -0
- package/dist/contract-surface.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/managed/compiler/contract-info.json +335 -0
- package/dist/managed/compiler/contract-manifest.json +98 -0
- package/dist/managed/contract/index.d.ts +129 -0
- package/dist/managed/contract/index.js +1188 -0
- package/dist/managed/contract/index.js.map +8 -0
- package/dist/managed/keys/emitSignBidirectionalEvent.verifier +0 -0
- package/dist/managed/keys/postRespondBidirectional.verifier +0 -0
- package/dist/managed/keys/postSignatureResponse.verifier +0 -0
- package/dist/managed/zkir/emitSignBidirectionalEvent.bzkir +0 -0
- package/dist/managed/zkir/emitSignBidirectionalEvent.zkir +965 -0
- package/dist/managed/zkir/postRespondBidirectional.bzkir +0 -0
- package/dist/managed/zkir/postRespondBidirectional.zkir +666 -0
- package/dist/managed/zkir/postSignatureResponse.bzkir +0 -0
- package/dist/managed/zkir/postSignatureResponse.zkir +383 -0
- package/dist/witnesses.d.ts +15 -0
- package/dist/witnesses.d.ts.map +1 -0
- package/dist/witnesses.js +15 -0
- package/dist/witnesses.js.map +1 -0
- package/package.json +49 -0
- package/src/contract-surface.ts +40 -0
- package/src/index.ts +9 -0
- package/src/signet-contract.compact +135 -0
- package/src/witnesses.ts +22 -0
|
@@ -0,0 +1,1188 @@
|
|
|
1
|
+
import * as __compactRuntime from '@midnight-ntwrk/compact-runtime';
|
|
2
|
+
__compactRuntime.checkRuntimeVersion('0.18.0-rc.0');
|
|
3
|
+
|
|
4
|
+
const _descriptor_0 = new __compactRuntime.CompactTypeBytes(32);
|
|
5
|
+
|
|
6
|
+
const _descriptor_1 = new __compactRuntime.CompactTypeBytes(128);
|
|
7
|
+
|
|
8
|
+
const _descriptor_2 = new __compactRuntime.CompactTypeUnsignedInteger(255n, 1);
|
|
9
|
+
|
|
10
|
+
const _descriptor_3 = __compactRuntime.CompactTypeJubjubPoint;
|
|
11
|
+
|
|
12
|
+
const _descriptor_4 = __compactRuntime.CompactTypeField;
|
|
13
|
+
|
|
14
|
+
class _RespondBidirectional_0 {
|
|
15
|
+
alignment() {
|
|
16
|
+
return _descriptor_1.alignment().concat(_descriptor_2.alignment().concat(_descriptor_3.alignment().concat(_descriptor_3.alignment().concat(_descriptor_4.alignment()))));
|
|
17
|
+
}
|
|
18
|
+
fromValue(value_0) {
|
|
19
|
+
return {
|
|
20
|
+
serializedOutput: _descriptor_1.fromValue(value_0),
|
|
21
|
+
outputLen: _descriptor_2.fromValue(value_0),
|
|
22
|
+
pk: _descriptor_3.fromValue(value_0),
|
|
23
|
+
announcement: _descriptor_3.fromValue(value_0),
|
|
24
|
+
response: _descriptor_4.fromValue(value_0)
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
toValue(value_0) {
|
|
28
|
+
return _descriptor_1.toValue(value_0.serializedOutput).concat(_descriptor_2.toValue(value_0.outputLen).concat(_descriptor_3.toValue(value_0.pk).concat(_descriptor_3.toValue(value_0.announcement).concat(_descriptor_4.toValue(value_0.response)))));
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const _descriptor_5 = new _RespondBidirectional_0();
|
|
33
|
+
|
|
34
|
+
const _descriptor_6 = new __compactRuntime.CompactTypeBytes(288);
|
|
35
|
+
|
|
36
|
+
const _descriptor_7 = __compactRuntime.CompactTypeBoolean;
|
|
37
|
+
|
|
38
|
+
const _descriptor_8 = new __compactRuntime.CompactTypeBytes(224);
|
|
39
|
+
|
|
40
|
+
class _SignBidirectionalEvent_0 {
|
|
41
|
+
alignment() {
|
|
42
|
+
return _descriptor_2.alignment().concat(_descriptor_8.alignment());
|
|
43
|
+
}
|
|
44
|
+
fromValue(value_0) {
|
|
45
|
+
return {
|
|
46
|
+
version: _descriptor_2.fromValue(value_0),
|
|
47
|
+
payload: _descriptor_8.fromValue(value_0)
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
toValue(value_0) {
|
|
51
|
+
return _descriptor_2.toValue(value_0.version).concat(_descriptor_8.toValue(value_0.payload));
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
const _descriptor_9 = new _SignBidirectionalEvent_0();
|
|
56
|
+
|
|
57
|
+
const _descriptor_10 = new __compactRuntime.CompactTypeUnsignedInteger(18446744073709551615n, 8);
|
|
58
|
+
|
|
59
|
+
const _descriptor_11 = new __compactRuntime.CompactTypeUnsignedInteger(65535n, 2);
|
|
60
|
+
|
|
61
|
+
class _SignetResponseKey_0 {
|
|
62
|
+
alignment() {
|
|
63
|
+
return _descriptor_10.alignment().concat(_descriptor_0.alignment());
|
|
64
|
+
}
|
|
65
|
+
fromValue(value_0) {
|
|
66
|
+
return {
|
|
67
|
+
count: _descriptor_10.fromValue(value_0),
|
|
68
|
+
requestId: _descriptor_0.fromValue(value_0)
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
toValue(value_0) {
|
|
72
|
+
return _descriptor_10.toValue(value_0.count).concat(_descriptor_0.toValue(value_0.requestId));
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const _descriptor_12 = new _SignetResponseKey_0();
|
|
77
|
+
|
|
78
|
+
class _SignatureResponse_0 {
|
|
79
|
+
alignment() {
|
|
80
|
+
return _descriptor_0.alignment().concat(_descriptor_0.alignment().concat(_descriptor_0.alignment().concat(_descriptor_2.alignment())));
|
|
81
|
+
}
|
|
82
|
+
fromValue(value_0) {
|
|
83
|
+
return {
|
|
84
|
+
bigRx: _descriptor_0.fromValue(value_0),
|
|
85
|
+
bigRy: _descriptor_0.fromValue(value_0),
|
|
86
|
+
s: _descriptor_0.fromValue(value_0),
|
|
87
|
+
recoveryId: _descriptor_2.fromValue(value_0)
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
toValue(value_0) {
|
|
91
|
+
return _descriptor_0.toValue(value_0.bigRx).concat(_descriptor_0.toValue(value_0.bigRy).concat(_descriptor_0.toValue(value_0.s).concat(_descriptor_2.toValue(value_0.recoveryId))));
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
const _descriptor_13 = new _SignatureResponse_0();
|
|
96
|
+
|
|
97
|
+
class _RespondBidirectionalEvent_0 {
|
|
98
|
+
alignment() {
|
|
99
|
+
return _descriptor_0.alignment();
|
|
100
|
+
}
|
|
101
|
+
fromValue(value_0) {
|
|
102
|
+
return {
|
|
103
|
+
requestId: _descriptor_0.fromValue(value_0)
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
toValue(value_0) {
|
|
107
|
+
return _descriptor_0.toValue(value_0.requestId);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const _descriptor_14 = new _RespondBidirectionalEvent_0();
|
|
112
|
+
|
|
113
|
+
const _descriptor_15 = new __compactRuntime.CompactTypeBytes(256);
|
|
114
|
+
|
|
115
|
+
const _descriptor_16 = new __compactRuntime.CompactTypeVector(4, _descriptor_4);
|
|
116
|
+
|
|
117
|
+
class _SignatureRespondedEvent_0 {
|
|
118
|
+
alignment() {
|
|
119
|
+
return _descriptor_0.alignment().concat(_descriptor_10.alignment());
|
|
120
|
+
}
|
|
121
|
+
fromValue(value_0) {
|
|
122
|
+
return {
|
|
123
|
+
requestId: _descriptor_0.fromValue(value_0),
|
|
124
|
+
count: _descriptor_10.fromValue(value_0)
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
toValue(value_0) {
|
|
128
|
+
return _descriptor_0.toValue(value_0.requestId).concat(_descriptor_10.toValue(value_0.count));
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
const _descriptor_17 = new _SignatureRespondedEvent_0();
|
|
133
|
+
|
|
134
|
+
const _descriptor_18 = __compactRuntime.CompactTypeField;
|
|
135
|
+
|
|
136
|
+
const _descriptor_19 = new __compactRuntime.CompactTypeVector(2, _descriptor_0);
|
|
137
|
+
|
|
138
|
+
class _JubjubSchnorrSignature_0 {
|
|
139
|
+
alignment() {
|
|
140
|
+
return _descriptor_3.alignment().concat(_descriptor_4.alignment());
|
|
141
|
+
}
|
|
142
|
+
fromValue(value_0) {
|
|
143
|
+
return {
|
|
144
|
+
announcement: _descriptor_3.fromValue(value_0),
|
|
145
|
+
response: _descriptor_4.fromValue(value_0)
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
toValue(value_0) {
|
|
149
|
+
return _descriptor_3.toValue(value_0.announcement).concat(_descriptor_4.toValue(value_0.response));
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
const _descriptor_20 = new _JubjubSchnorrSignature_0();
|
|
154
|
+
|
|
155
|
+
class _JubjubSchnorrHashInput_0 {
|
|
156
|
+
alignment() {
|
|
157
|
+
return _descriptor_4.alignment().concat(_descriptor_4.alignment().concat(_descriptor_4.alignment().concat(_descriptor_4.alignment().concat(_descriptor_16.alignment()))));
|
|
158
|
+
}
|
|
159
|
+
fromValue(value_0) {
|
|
160
|
+
return {
|
|
161
|
+
annX: _descriptor_4.fromValue(value_0),
|
|
162
|
+
annY: _descriptor_4.fromValue(value_0),
|
|
163
|
+
pkX: _descriptor_4.fromValue(value_0),
|
|
164
|
+
pkY: _descriptor_4.fromValue(value_0),
|
|
165
|
+
msg: _descriptor_16.fromValue(value_0)
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
toValue(value_0) {
|
|
169
|
+
return _descriptor_4.toValue(value_0.annX).concat(_descriptor_4.toValue(value_0.annY).concat(_descriptor_4.toValue(value_0.pkX).concat(_descriptor_4.toValue(value_0.pkY).concat(_descriptor_16.toValue(value_0.msg)))));
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
const _descriptor_21 = new _JubjubSchnorrHashInput_0();
|
|
174
|
+
|
|
175
|
+
class _Either_0 {
|
|
176
|
+
alignment() {
|
|
177
|
+
return _descriptor_7.alignment().concat(_descriptor_0.alignment().concat(_descriptor_0.alignment()));
|
|
178
|
+
}
|
|
179
|
+
fromValue(value_0) {
|
|
180
|
+
return {
|
|
181
|
+
is_left: _descriptor_7.fromValue(value_0),
|
|
182
|
+
left: _descriptor_0.fromValue(value_0),
|
|
183
|
+
right: _descriptor_0.fromValue(value_0)
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
toValue(value_0) {
|
|
187
|
+
return _descriptor_7.toValue(value_0.is_left).concat(_descriptor_0.toValue(value_0.left).concat(_descriptor_0.toValue(value_0.right)));
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
const _descriptor_22 = new _Either_0();
|
|
192
|
+
|
|
193
|
+
const _descriptor_23 = new __compactRuntime.CompactTypeUnsignedInteger(340282366920938463463374607431768211455n, 16);
|
|
194
|
+
|
|
195
|
+
class _ContractAddress_0 {
|
|
196
|
+
alignment() {
|
|
197
|
+
return _descriptor_0.alignment();
|
|
198
|
+
}
|
|
199
|
+
fromValue(value_0) {
|
|
200
|
+
return {
|
|
201
|
+
bytes: _descriptor_0.fromValue(value_0)
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
toValue(value_0) {
|
|
205
|
+
return _descriptor_0.toValue(value_0.bytes);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
const _descriptor_24 = new _ContractAddress_0();
|
|
210
|
+
|
|
211
|
+
const _descriptor_25 = new __compactRuntime.CompactTypeUnsignedInteger(4294967295n, 4);
|
|
212
|
+
|
|
213
|
+
export class Contract {
|
|
214
|
+
witnesses;
|
|
215
|
+
constructor(...args_0) {
|
|
216
|
+
if (args_0.length !== 1) {
|
|
217
|
+
throw new __compactRuntime.CompactError(`Contract constructor: expected 1 argument, received ${args_0.length}`);
|
|
218
|
+
}
|
|
219
|
+
const witnesses_0 = args_0[0];
|
|
220
|
+
if (typeof(witnesses_0) !== 'object') {
|
|
221
|
+
throw new __compactRuntime.CompactError('first (witnesses) argument to Contract constructor is not an object');
|
|
222
|
+
}
|
|
223
|
+
this.witnesses = witnesses_0;
|
|
224
|
+
this.circuits = {
|
|
225
|
+
emitSignBidirectionalEvent: async (...args_1) => {
|
|
226
|
+
if (args_1.length !== 2) {
|
|
227
|
+
throw new __compactRuntime.CompactError(`emitSignBidirectionalEvent: expected 2 arguments (as invoked from Typescript), received ${args_1.length}`);
|
|
228
|
+
}
|
|
229
|
+
const contextOrig_0 = args_1[0];
|
|
230
|
+
const signBidirectionalEvent_0 = args_1[1];
|
|
231
|
+
if (!(typeof(contextOrig_0) === 'object' && contextOrig_0.callContext.currentQueryContext != undefined)) {
|
|
232
|
+
__compactRuntime.typeError('emitSignBidirectionalEvent',
|
|
233
|
+
'argument 1 (as invoked from Typescript)',
|
|
234
|
+
'signet-contract.compact line 31 char 1',
|
|
235
|
+
'CircuitContext',
|
|
236
|
+
contextOrig_0)
|
|
237
|
+
}
|
|
238
|
+
if (!(typeof(signBidirectionalEvent_0) === 'object' && typeof(signBidirectionalEvent_0.version) === 'bigint' && signBidirectionalEvent_0.version >= 0n && signBidirectionalEvent_0.version <= 255n && signBidirectionalEvent_0.payload.buffer instanceof ArrayBuffer && signBidirectionalEvent_0.payload.BYTES_PER_ELEMENT === 1 && signBidirectionalEvent_0.payload.length === 224)) {
|
|
239
|
+
__compactRuntime.typeError('emitSignBidirectionalEvent',
|
|
240
|
+
'argument 1 (argument 2 as invoked from Typescript)',
|
|
241
|
+
'signet-contract.compact line 31 char 1',
|
|
242
|
+
'struct SignBidirectionalEvent<version: Uint<0..256>, payload: Bytes<224>>',
|
|
243
|
+
signBidirectionalEvent_0)
|
|
244
|
+
}
|
|
245
|
+
const context = __compactRuntime.copyCircuitContext(contextOrig_0);
|
|
246
|
+
const partialProofData = {
|
|
247
|
+
input: {
|
|
248
|
+
value: _descriptor_9.toValue(signBidirectionalEvent_0),
|
|
249
|
+
alignment: _descriptor_9.alignment()
|
|
250
|
+
},
|
|
251
|
+
output: undefined,
|
|
252
|
+
publicTranscript: [],
|
|
253
|
+
privateTranscriptOutputs: []
|
|
254
|
+
};
|
|
255
|
+
const result_0 = await this._emitSignBidirectionalEvent_0(context,
|
|
256
|
+
partialProofData,
|
|
257
|
+
signBidirectionalEvent_0);
|
|
258
|
+
partialProofData.output = { value: [], alignment: [] };
|
|
259
|
+
__compactRuntime.finalizeCallProofData(context, partialProofData);
|
|
260
|
+
return { result: result_0, context: context, gasCost: context.callContext.currentGasCost };
|
|
261
|
+
},
|
|
262
|
+
postSignatureResponse: async (...args_1) => {
|
|
263
|
+
if (args_1.length !== 3) {
|
|
264
|
+
throw new __compactRuntime.CompactError(`postSignatureResponse: expected 3 arguments (as invoked from Typescript), received ${args_1.length}`);
|
|
265
|
+
}
|
|
266
|
+
const contextOrig_0 = args_1[0];
|
|
267
|
+
const requestId_0 = args_1[1];
|
|
268
|
+
const signatureResponse_0 = args_1[2];
|
|
269
|
+
if (!(typeof(contextOrig_0) === 'object' && contextOrig_0.callContext.currentQueryContext != undefined)) {
|
|
270
|
+
__compactRuntime.typeError('postSignatureResponse',
|
|
271
|
+
'argument 1 (as invoked from Typescript)',
|
|
272
|
+
'signet-contract.compact line 44 char 1',
|
|
273
|
+
'CircuitContext',
|
|
274
|
+
contextOrig_0)
|
|
275
|
+
}
|
|
276
|
+
if (!(requestId_0.buffer instanceof ArrayBuffer && requestId_0.BYTES_PER_ELEMENT === 1 && requestId_0.length === 32)) {
|
|
277
|
+
__compactRuntime.typeError('postSignatureResponse',
|
|
278
|
+
'argument 1 (argument 2 as invoked from Typescript)',
|
|
279
|
+
'signet-contract.compact line 44 char 1',
|
|
280
|
+
'Bytes<32>',
|
|
281
|
+
requestId_0)
|
|
282
|
+
}
|
|
283
|
+
if (!(typeof(signatureResponse_0) === 'object' && signatureResponse_0.bigRx.buffer instanceof ArrayBuffer && signatureResponse_0.bigRx.BYTES_PER_ELEMENT === 1 && signatureResponse_0.bigRx.length === 32 && signatureResponse_0.bigRy.buffer instanceof ArrayBuffer && signatureResponse_0.bigRy.BYTES_PER_ELEMENT === 1 && signatureResponse_0.bigRy.length === 32 && signatureResponse_0.s.buffer instanceof ArrayBuffer && signatureResponse_0.s.BYTES_PER_ELEMENT === 1 && signatureResponse_0.s.length === 32 && typeof(signatureResponse_0.recoveryId) === 'bigint' && signatureResponse_0.recoveryId >= 0n && signatureResponse_0.recoveryId <= 255n)) {
|
|
284
|
+
__compactRuntime.typeError('postSignatureResponse',
|
|
285
|
+
'argument 2 (argument 3 as invoked from Typescript)',
|
|
286
|
+
'signet-contract.compact line 44 char 1',
|
|
287
|
+
'struct SignatureResponse<bigRx: Bytes<32>, bigRy: Bytes<32>, s: Bytes<32>, recoveryId: Uint<0..256>>',
|
|
288
|
+
signatureResponse_0)
|
|
289
|
+
}
|
|
290
|
+
const context = __compactRuntime.copyCircuitContext(contextOrig_0);
|
|
291
|
+
const partialProofData = {
|
|
292
|
+
input: {
|
|
293
|
+
value: _descriptor_0.toValue(requestId_0).concat(_descriptor_13.toValue(signatureResponse_0)),
|
|
294
|
+
alignment: _descriptor_0.alignment().concat(_descriptor_13.alignment())
|
|
295
|
+
},
|
|
296
|
+
output: undefined,
|
|
297
|
+
publicTranscript: [],
|
|
298
|
+
privateTranscriptOutputs: []
|
|
299
|
+
};
|
|
300
|
+
const result_0 = await this._postSignatureResponse_0(context,
|
|
301
|
+
partialProofData,
|
|
302
|
+
requestId_0,
|
|
303
|
+
signatureResponse_0);
|
|
304
|
+
partialProofData.output = { value: [], alignment: [] };
|
|
305
|
+
__compactRuntime.finalizeCallProofData(context, partialProofData);
|
|
306
|
+
return { result: result_0, context: context, gasCost: context.callContext.currentGasCost };
|
|
307
|
+
},
|
|
308
|
+
postRespondBidirectional: async (...args_1) => {
|
|
309
|
+
if (args_1.length !== 3) {
|
|
310
|
+
throw new __compactRuntime.CompactError(`postRespondBidirectional: expected 3 arguments (as invoked from Typescript), received ${args_1.length}`);
|
|
311
|
+
}
|
|
312
|
+
const contextOrig_0 = args_1[0];
|
|
313
|
+
const requestId_0 = args_1[1];
|
|
314
|
+
const respondBidirectional_0 = args_1[2];
|
|
315
|
+
if (!(typeof(contextOrig_0) === 'object' && contextOrig_0.callContext.currentQueryContext != undefined)) {
|
|
316
|
+
__compactRuntime.typeError('postRespondBidirectional',
|
|
317
|
+
'argument 1 (as invoked from Typescript)',
|
|
318
|
+
'signet-contract.compact line 85 char 1',
|
|
319
|
+
'CircuitContext',
|
|
320
|
+
contextOrig_0)
|
|
321
|
+
}
|
|
322
|
+
if (!(requestId_0.buffer instanceof ArrayBuffer && requestId_0.BYTES_PER_ELEMENT === 1 && requestId_0.length === 32)) {
|
|
323
|
+
__compactRuntime.typeError('postRespondBidirectional',
|
|
324
|
+
'argument 1 (argument 2 as invoked from Typescript)',
|
|
325
|
+
'signet-contract.compact line 85 char 1',
|
|
326
|
+
'Bytes<32>',
|
|
327
|
+
requestId_0)
|
|
328
|
+
}
|
|
329
|
+
if (!(typeof(respondBidirectional_0) === 'object' && respondBidirectional_0.serializedOutput.buffer instanceof ArrayBuffer && respondBidirectional_0.serializedOutput.BYTES_PER_ELEMENT === 1 && respondBidirectional_0.serializedOutput.length === 128 && typeof(respondBidirectional_0.outputLen) === 'bigint' && respondBidirectional_0.outputLen >= 0n && respondBidirectional_0.outputLen <= 255n && true && true && typeof(respondBidirectional_0.response) === 'bigint' && respondBidirectional_0.response >= 0 && respondBidirectional_0.response <= __compactRuntime.MAX_FIELD)) {
|
|
330
|
+
__compactRuntime.typeError('postRespondBidirectional',
|
|
331
|
+
'argument 2 (argument 3 as invoked from Typescript)',
|
|
332
|
+
'signet-contract.compact line 85 char 1',
|
|
333
|
+
'struct RespondBidirectional<serializedOutput: Bytes<128>, outputLen: Uint<0..256>, pk: Opaque<"JubjubPoint">, announcement: Opaque<"JubjubPoint">, response: Field>',
|
|
334
|
+
respondBidirectional_0)
|
|
335
|
+
}
|
|
336
|
+
const context = __compactRuntime.copyCircuitContext(contextOrig_0);
|
|
337
|
+
const partialProofData = {
|
|
338
|
+
input: {
|
|
339
|
+
value: _descriptor_0.toValue(requestId_0).concat(_descriptor_5.toValue(respondBidirectional_0)),
|
|
340
|
+
alignment: _descriptor_0.alignment().concat(_descriptor_5.alignment())
|
|
341
|
+
},
|
|
342
|
+
output: undefined,
|
|
343
|
+
publicTranscript: [],
|
|
344
|
+
privateTranscriptOutputs: []
|
|
345
|
+
};
|
|
346
|
+
const result_0 = await this._postRespondBidirectional_0(context,
|
|
347
|
+
partialProofData,
|
|
348
|
+
requestId_0,
|
|
349
|
+
respondBidirectional_0);
|
|
350
|
+
partialProofData.output = { value: [], alignment: [] };
|
|
351
|
+
__compactRuntime.finalizeCallProofData(context, partialProofData);
|
|
352
|
+
return { result: result_0, context: context, gasCost: context.callContext.currentGasCost };
|
|
353
|
+
}
|
|
354
|
+
};
|
|
355
|
+
this.impureCircuits = {
|
|
356
|
+
emitSignBidirectionalEvent: this.circuits.emitSignBidirectionalEvent,
|
|
357
|
+
postSignatureResponse: this.circuits.postSignatureResponse,
|
|
358
|
+
postRespondBidirectional: this.circuits.postRespondBidirectional
|
|
359
|
+
};
|
|
360
|
+
this.provableCircuits = {
|
|
361
|
+
emitSignBidirectionalEvent: this.circuits.emitSignBidirectionalEvent,
|
|
362
|
+
postSignatureResponse: this.circuits.postSignatureResponse,
|
|
363
|
+
postRespondBidirectional: this.circuits.postRespondBidirectional
|
|
364
|
+
};
|
|
365
|
+
}
|
|
366
|
+
async initialState(...args_0) {
|
|
367
|
+
if (args_0.length !== 2) {
|
|
368
|
+
throw new __compactRuntime.CompactError(`Contract state constructor: expected 2 arguments (as invoked from Typescript), received ${args_0.length}`);
|
|
369
|
+
}
|
|
370
|
+
const constructorContext_0 = args_0[0];
|
|
371
|
+
const mpcPk_0 = args_0[1];
|
|
372
|
+
if (typeof(constructorContext_0) !== 'object') {
|
|
373
|
+
throw new __compactRuntime.CompactError(`Contract state constructor: expected 'constructorContext' in argument 1 (as invoked from Typescript) to be an object`);
|
|
374
|
+
}
|
|
375
|
+
if (!('initialZswapLocalState' in constructorContext_0)) {
|
|
376
|
+
throw new __compactRuntime.CompactError(`Contract state constructor: expected 'initialZswapLocalState' in argument 1 (as invoked from Typescript)`);
|
|
377
|
+
}
|
|
378
|
+
if (typeof(constructorContext_0.initialZswapLocalState) !== 'object') {
|
|
379
|
+
throw new __compactRuntime.CompactError(`Contract state constructor: expected 'initialZswapLocalState' in argument 1 (as invoked from Typescript) to be an object`);
|
|
380
|
+
}
|
|
381
|
+
const state_0 = new __compactRuntime.ContractState();
|
|
382
|
+
let stateValue_0 = __compactRuntime.StateValue.newArray();
|
|
383
|
+
stateValue_0 = stateValue_0.arrayPush(__compactRuntime.StateValue.newNull());
|
|
384
|
+
stateValue_0 = stateValue_0.arrayPush(__compactRuntime.StateValue.newNull());
|
|
385
|
+
stateValue_0 = stateValue_0.arrayPush(__compactRuntime.StateValue.newNull());
|
|
386
|
+
stateValue_0 = stateValue_0.arrayPush(__compactRuntime.StateValue.newNull());
|
|
387
|
+
state_0.data = new __compactRuntime.ChargedState(stateValue_0);
|
|
388
|
+
state_0.setOperation('emitSignBidirectionalEvent', new __compactRuntime.ContractOperation());
|
|
389
|
+
state_0.setOperation('postSignatureResponse', new __compactRuntime.ContractOperation());
|
|
390
|
+
state_0.setOperation('postRespondBidirectional', new __compactRuntime.ContractOperation());
|
|
391
|
+
const context = __compactRuntime.createCircuitContext('constructor', __compactRuntime.dummyContractAddress(), constructorContext_0.initialZswapLocalState.coinPublicKey, state_0.data, constructorContext_0.initialPrivateState);
|
|
392
|
+
const partialProofData = {
|
|
393
|
+
input: { value: [], alignment: [] },
|
|
394
|
+
output: undefined,
|
|
395
|
+
publicTranscript: [],
|
|
396
|
+
privateTranscriptOutputs: []
|
|
397
|
+
};
|
|
398
|
+
__compactRuntime.queryLedgerState(context,
|
|
399
|
+
partialProofData,
|
|
400
|
+
[
|
|
401
|
+
{ push: { storage: false,
|
|
402
|
+
value: __compactRuntime.StateValue.newCell({ value: _descriptor_2.toValue(0n),
|
|
403
|
+
alignment: _descriptor_2.alignment() }).encode() } },
|
|
404
|
+
{ push: { storage: true,
|
|
405
|
+
value: __compactRuntime.StateValue.newMap(
|
|
406
|
+
new __compactRuntime.StateMap()
|
|
407
|
+
).encode() } },
|
|
408
|
+
{ ins: { cached: false, n: 1 } }]);
|
|
409
|
+
__compactRuntime.queryLedgerState(context,
|
|
410
|
+
partialProofData,
|
|
411
|
+
[
|
|
412
|
+
{ push: { storage: false,
|
|
413
|
+
value: __compactRuntime.StateValue.newCell({ value: _descriptor_2.toValue(1n),
|
|
414
|
+
alignment: _descriptor_2.alignment() }).encode() } },
|
|
415
|
+
{ push: { storage: true,
|
|
416
|
+
value: __compactRuntime.StateValue.newMap(
|
|
417
|
+
new __compactRuntime.StateMap()
|
|
418
|
+
).encode() } },
|
|
419
|
+
{ ins: { cached: false, n: 1 } }]);
|
|
420
|
+
__compactRuntime.queryLedgerState(context,
|
|
421
|
+
partialProofData,
|
|
422
|
+
[
|
|
423
|
+
{ push: { storage: false,
|
|
424
|
+
value: __compactRuntime.StateValue.newCell({ value: _descriptor_2.toValue(2n),
|
|
425
|
+
alignment: _descriptor_2.alignment() }).encode() } },
|
|
426
|
+
{ push: { storage: true,
|
|
427
|
+
value: __compactRuntime.StateValue.newMap(
|
|
428
|
+
new __compactRuntime.StateMap()
|
|
429
|
+
).encode() } },
|
|
430
|
+
{ ins: { cached: false, n: 1 } }]);
|
|
431
|
+
__compactRuntime.queryLedgerState(context,
|
|
432
|
+
partialProofData,
|
|
433
|
+
[
|
|
434
|
+
{ push: { storage: false,
|
|
435
|
+
value: __compactRuntime.StateValue.newCell({ value: _descriptor_2.toValue(3n),
|
|
436
|
+
alignment: _descriptor_2.alignment() }).encode() } },
|
|
437
|
+
{ push: { storage: true,
|
|
438
|
+
value: __compactRuntime.StateValue.newCell({ value: _descriptor_0.toValue(new Uint8Array(32)),
|
|
439
|
+
alignment: _descriptor_0.alignment() }).encode() } },
|
|
440
|
+
{ ins: { cached: false, n: 1 } }]);
|
|
441
|
+
const tmp_0 = this._persistentHash_0(mpcPk_0);
|
|
442
|
+
__compactRuntime.queryLedgerState(context,
|
|
443
|
+
partialProofData,
|
|
444
|
+
[
|
|
445
|
+
{ push: { storage: false,
|
|
446
|
+
value: __compactRuntime.StateValue.newCell({ value: _descriptor_2.toValue(3n),
|
|
447
|
+
alignment: _descriptor_2.alignment() }).encode() } },
|
|
448
|
+
{ push: { storage: true,
|
|
449
|
+
value: __compactRuntime.StateValue.newCell({ value: _descriptor_0.toValue(tmp_0),
|
|
450
|
+
alignment: _descriptor_0.alignment() }).encode() } },
|
|
451
|
+
{ ins: { cached: false, n: 1 } }]);
|
|
452
|
+
state_0.data = new __compactRuntime.ChargedState(context.callContext.currentQueryContext.state.state);
|
|
453
|
+
return {
|
|
454
|
+
currentContractState: state_0,
|
|
455
|
+
currentPrivateState: context.callContext.currentPrivateState,
|
|
456
|
+
currentZswapLocalState: context.callContext.currentZswapLocalState
|
|
457
|
+
}
|
|
458
|
+
}
|
|
459
|
+
_jubjubSchnorrVerify_0(msg_0, signature_0, pk_0) {
|
|
460
|
+
const __compact_pattern_tmp1_0 = signature_0;
|
|
461
|
+
const announcement_0 = __compact_pattern_tmp1_0.announcement;
|
|
462
|
+
const response_0 = __compact_pattern_tmp1_0.response;
|
|
463
|
+
const cNative_0 = this._transientHash_0({ annX:
|
|
464
|
+
this._jubjubPointX_0(announcement_0),
|
|
465
|
+
annY:
|
|
466
|
+
this._jubjubPointY_0(announcement_0),
|
|
467
|
+
pkX: this._jubjubPointX_0(pk_0),
|
|
468
|
+
pkY: this._jubjubPointY_0(pk_0),
|
|
469
|
+
msg: msg_0 });
|
|
470
|
+
const c_0 = cNative_0;
|
|
471
|
+
const lhs_0 = this._ecMulGenerator_0(response_0);
|
|
472
|
+
const rhs_0 = this._ecAdd_0(announcement_0, this._ecMul_0(pk_0, c_0));
|
|
473
|
+
return this._equal_0(lhs_0, rhs_0);
|
|
474
|
+
}
|
|
475
|
+
_transientHash_0(value_0) {
|
|
476
|
+
const result_0 = __compactRuntime.transientHash(_descriptor_21, value_0);
|
|
477
|
+
return result_0;
|
|
478
|
+
}
|
|
479
|
+
_persistentHash_0(value_0) {
|
|
480
|
+
const result_0 = __compactRuntime.persistentHash(_descriptor_3, value_0);
|
|
481
|
+
return result_0;
|
|
482
|
+
}
|
|
483
|
+
_persistentHash_1(value_0) {
|
|
484
|
+
const result_0 = __compactRuntime.persistentHash(_descriptor_19, value_0);
|
|
485
|
+
return result_0;
|
|
486
|
+
}
|
|
487
|
+
_persistentHash_2(value_0) {
|
|
488
|
+
const result_0 = __compactRuntime.persistentHash(_descriptor_1, value_0);
|
|
489
|
+
return result_0;
|
|
490
|
+
}
|
|
491
|
+
_jubjubPointX_0(pt_0) {
|
|
492
|
+
const result_0 = __compactRuntime.jubjubPointX(pt_0);
|
|
493
|
+
return result_0;
|
|
494
|
+
}
|
|
495
|
+
_jubjubPointY_0(pt_0) {
|
|
496
|
+
const result_0 = __compactRuntime.jubjubPointY(pt_0);
|
|
497
|
+
return result_0;
|
|
498
|
+
}
|
|
499
|
+
_ecAdd_0(a_0, b_0) {
|
|
500
|
+
const result_0 = __compactRuntime.ecAdd(a_0, b_0);
|
|
501
|
+
return result_0;
|
|
502
|
+
}
|
|
503
|
+
_ecMul_0(a_0, b_0) {
|
|
504
|
+
const result_0 = __compactRuntime.ecMul(a_0, b_0);
|
|
505
|
+
return result_0;
|
|
506
|
+
}
|
|
507
|
+
_ecMulGenerator_0(b_0) {
|
|
508
|
+
const result_0 = __compactRuntime.ecMulGenerator(b_0);
|
|
509
|
+
return result_0;
|
|
510
|
+
}
|
|
511
|
+
_serialize_0(value_0) {
|
|
512
|
+
return Uint8Array.from([value_0.version,
|
|
513
|
+
...Array.from(value_0.payload, BigInt),
|
|
514
|
+
...Array.from(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]),
|
|
515
|
+
BigInt)],
|
|
516
|
+
Number);
|
|
517
|
+
}
|
|
518
|
+
_serialize_1(value_0) {
|
|
519
|
+
return Uint8Array.from([...Array.from(value_0.requestId, BigInt),
|
|
520
|
+
...Array.from(__compactRuntime.convertBigintToBytes(8,
|
|
521
|
+
value_0.count,
|
|
522
|
+
'<standard library>'),
|
|
523
|
+
BigInt),
|
|
524
|
+
...Array.from(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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]),
|
|
525
|
+
BigInt)],
|
|
526
|
+
Number);
|
|
527
|
+
}
|
|
528
|
+
_serialize_2(value_0) {
|
|
529
|
+
return Uint8Array.from([...Array.from(value_0.requestId, BigInt),
|
|
530
|
+
...Array.from(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, 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]),
|
|
531
|
+
BigInt)],
|
|
532
|
+
Number);
|
|
533
|
+
}
|
|
534
|
+
_signetAttestationMessage_0(requestId_0, serializedOutput_0, outputLen_0) {
|
|
535
|
+
const rid_0 = requestId_0;
|
|
536
|
+
const outHash_0 = this._persistentHash_1([this._persistentHash_2(serializedOutput_0),
|
|
537
|
+
__compactRuntime.convertBigintToBytes(32,
|
|
538
|
+
outputLen_0,
|
|
539
|
+
'Signet.compact line 393 char 7')]);
|
|
540
|
+
return [__compactRuntime.convertBytesToBigint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
|
|
541
|
+
16,
|
|
542
|
+
((e, i) => e.slice(i, i+16))(rid_0,
|
|
543
|
+
Number(0n)),
|
|
544
|
+
'Field',
|
|
545
|
+
'Signet.compact line 396 char 7'),
|
|
546
|
+
__compactRuntime.convertBytesToBigint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
|
|
547
|
+
16,
|
|
548
|
+
((e, i) => e.slice(i, i+16))(rid_0,
|
|
549
|
+
Number(16n)),
|
|
550
|
+
'Field',
|
|
551
|
+
'Signet.compact line 397 char 7'),
|
|
552
|
+
__compactRuntime.convertBytesToBigint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
|
|
553
|
+
16,
|
|
554
|
+
((e, i) => e.slice(i, i+16))(outHash_0,
|
|
555
|
+
Number(0n)),
|
|
556
|
+
'Field',
|
|
557
|
+
'Signet.compact line 398 char 7'),
|
|
558
|
+
__compactRuntime.convertBytesToBigint(52435875175126190479447740508185965837690552500527637822603658699938581184512n,
|
|
559
|
+
16,
|
|
560
|
+
((e, i) => e.slice(i, i+16))(outHash_0,
|
|
561
|
+
Number(16n)),
|
|
562
|
+
'Field',
|
|
563
|
+
'Signet.compact line 399 char 7')];
|
|
564
|
+
}
|
|
565
|
+
async _emitSignBidirectionalEvent_0(context,
|
|
566
|
+
partialProofData,
|
|
567
|
+
signBidirectionalEvent_0)
|
|
568
|
+
{
|
|
569
|
+
let t_0;
|
|
570
|
+
__compactRuntime.queryLedgerState(context,
|
|
571
|
+
partialProofData,
|
|
572
|
+
[
|
|
573
|
+
{ push: { storage: false,
|
|
574
|
+
value: __compactRuntime.StateValue.newArray()
|
|
575
|
+
.arrayPush(__compactRuntime.StateValue.newCell({ value: _descriptor_25.toValue(1n),
|
|
576
|
+
alignment: _descriptor_25.alignment() })).arrayPush(__compactRuntime.StateValue.newCell({ value: _descriptor_2.toValue(10n),
|
|
577
|
+
alignment: _descriptor_2.alignment() })).arrayPush(__compactRuntime.StateValue.newCell({ value: _descriptor_6.toValue((t_0 = { name:
|
|
578
|
+
new Uint8Array([83, 105, 103, 110, 66, 105, 100, 105, 114, 101, 99, 116, 105, 111, 110, 97, 108, 69, 118, 101, 110, 116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]),
|
|
579
|
+
payload:
|
|
580
|
+
this._serialize_0(signBidirectionalEvent_0) },
|
|
581
|
+
Uint8Array.from([...Array.from(t_0.name,
|
|
582
|
+
BigInt),
|
|
583
|
+
...Array.from(t_0.payload,
|
|
584
|
+
BigInt)],
|
|
585
|
+
Number))),
|
|
586
|
+
alignment: _descriptor_6.alignment() }))
|
|
587
|
+
.encode() } },
|
|
588
|
+
'log']);
|
|
589
|
+
return [];
|
|
590
|
+
}
|
|
591
|
+
async _postSignatureResponse_0(context,
|
|
592
|
+
partialProofData,
|
|
593
|
+
requestId_0,
|
|
594
|
+
signatureResponse_0)
|
|
595
|
+
{
|
|
596
|
+
const disclosedRequestId_0 = requestId_0;
|
|
597
|
+
if (!_descriptor_7.fromValue(__compactRuntime.queryLedgerState(context,
|
|
598
|
+
partialProofData,
|
|
599
|
+
[
|
|
600
|
+
{ dup: { n: 0 } },
|
|
601
|
+
{ idx: { cached: false,
|
|
602
|
+
pushPath: false,
|
|
603
|
+
path: [
|
|
604
|
+
{ tag: 'value',
|
|
605
|
+
value: { value: _descriptor_2.toValue(0n),
|
|
606
|
+
alignment: _descriptor_2.alignment() } }] } },
|
|
607
|
+
{ push: { storage: false,
|
|
608
|
+
value: __compactRuntime.StateValue.newCell({ value: _descriptor_0.toValue(disclosedRequestId_0),
|
|
609
|
+
alignment: _descriptor_0.alignment() }).encode() } },
|
|
610
|
+
'member',
|
|
611
|
+
{ popeq: { cached: true,
|
|
612
|
+
result: undefined } }]).value))
|
|
613
|
+
{
|
|
614
|
+
__compactRuntime.queryLedgerState(context,
|
|
615
|
+
partialProofData,
|
|
616
|
+
[
|
|
617
|
+
{ idx: { cached: false,
|
|
618
|
+
pushPath: true,
|
|
619
|
+
path: [
|
|
620
|
+
{ tag: 'value',
|
|
621
|
+
value: { value: _descriptor_2.toValue(0n),
|
|
622
|
+
alignment: _descriptor_2.alignment() } }] } },
|
|
623
|
+
{ push: { storage: false,
|
|
624
|
+
value: __compactRuntime.StateValue.newCell({ value: _descriptor_0.toValue(disclosedRequestId_0),
|
|
625
|
+
alignment: _descriptor_0.alignment() }).encode() } },
|
|
626
|
+
{ push: { storage: true,
|
|
627
|
+
value: __compactRuntime.StateValue.newCell({ value: _descriptor_10.toValue(0n),
|
|
628
|
+
alignment: _descriptor_10.alignment() }).encode() } },
|
|
629
|
+
{ ins: { cached: false, n: 1 } },
|
|
630
|
+
{ ins: { cached: true, n: 1 } }]);
|
|
631
|
+
}
|
|
632
|
+
const count_0 = _descriptor_10.fromValue(__compactRuntime.queryLedgerState(context,
|
|
633
|
+
partialProofData,
|
|
634
|
+
[
|
|
635
|
+
{ dup: { n: 0 } },
|
|
636
|
+
{ idx: { cached: false,
|
|
637
|
+
pushPath: false,
|
|
638
|
+
path: [
|
|
639
|
+
{ tag: 'value',
|
|
640
|
+
value: { value: _descriptor_2.toValue(0n),
|
|
641
|
+
alignment: _descriptor_2.alignment() } },
|
|
642
|
+
{ tag: 'value',
|
|
643
|
+
value: { value: _descriptor_0.toValue(disclosedRequestId_0),
|
|
644
|
+
alignment: _descriptor_0.alignment() } }] } },
|
|
645
|
+
{ popeq: { cached: true,
|
|
646
|
+
result: undefined } }]).value);
|
|
647
|
+
const tmp_0 = 1n;
|
|
648
|
+
__compactRuntime.queryLedgerState(context,
|
|
649
|
+
partialProofData,
|
|
650
|
+
[
|
|
651
|
+
{ idx: { cached: false,
|
|
652
|
+
pushPath: true,
|
|
653
|
+
path: [
|
|
654
|
+
{ tag: 'value',
|
|
655
|
+
value: { value: _descriptor_2.toValue(0n),
|
|
656
|
+
alignment: _descriptor_2.alignment() } },
|
|
657
|
+
{ tag: 'value',
|
|
658
|
+
value: { value: _descriptor_0.toValue(disclosedRequestId_0),
|
|
659
|
+
alignment: _descriptor_0.alignment() } }] } },
|
|
660
|
+
{ addi: { immediate: parseInt(__compactRuntime.valueToBigInt(
|
|
661
|
+
{ value: _descriptor_11.toValue(tmp_0),
|
|
662
|
+
alignment: _descriptor_11.alignment() }
|
|
663
|
+
.value
|
|
664
|
+
)) } },
|
|
665
|
+
{ ins: { cached: true, n: 2 } }]);
|
|
666
|
+
const tmp_1 = { count: count_0, requestId: disclosedRequestId_0 };
|
|
667
|
+
__compactRuntime.queryLedgerState(context,
|
|
668
|
+
partialProofData,
|
|
669
|
+
[
|
|
670
|
+
{ idx: { cached: false,
|
|
671
|
+
pushPath: true,
|
|
672
|
+
path: [
|
|
673
|
+
{ tag: 'value',
|
|
674
|
+
value: { value: _descriptor_2.toValue(1n),
|
|
675
|
+
alignment: _descriptor_2.alignment() } }] } },
|
|
676
|
+
{ push: { storage: false,
|
|
677
|
+
value: __compactRuntime.StateValue.newCell({ value: _descriptor_12.toValue(tmp_1),
|
|
678
|
+
alignment: _descriptor_12.alignment() }).encode() } },
|
|
679
|
+
{ push: { storage: true,
|
|
680
|
+
value: __compactRuntime.StateValue.newCell({ value: _descriptor_13.toValue(signatureResponse_0),
|
|
681
|
+
alignment: _descriptor_13.alignment() }).encode() } },
|
|
682
|
+
{ ins: { cached: false, n: 1 } },
|
|
683
|
+
{ ins: { cached: true, n: 1 } }]);
|
|
684
|
+
let t_0;
|
|
685
|
+
__compactRuntime.queryLedgerState(context,
|
|
686
|
+
partialProofData,
|
|
687
|
+
[
|
|
688
|
+
{ push: { storage: false,
|
|
689
|
+
value: __compactRuntime.StateValue.newArray()
|
|
690
|
+
.arrayPush(__compactRuntime.StateValue.newCell({ value: _descriptor_25.toValue(1n),
|
|
691
|
+
alignment: _descriptor_25.alignment() })).arrayPush(__compactRuntime.StateValue.newCell({ value: _descriptor_2.toValue(10n),
|
|
692
|
+
alignment: _descriptor_2.alignment() })).arrayPush(__compactRuntime.StateValue.newCell({ value: _descriptor_6.toValue((t_0 = { name:
|
|
693
|
+
new Uint8Array([83, 105, 103, 110, 97, 116, 117, 114, 101, 82, 101, 115, 112, 111, 110, 100, 101, 100, 69, 118, 101, 110, 116, 0, 0, 0, 0, 0, 0, 0, 0, 0]),
|
|
694
|
+
payload:
|
|
695
|
+
this._serialize_1({ requestId:
|
|
696
|
+
disclosedRequestId_0,
|
|
697
|
+
count:
|
|
698
|
+
count_0 }) },
|
|
699
|
+
Uint8Array.from([...Array.from(t_0.name,
|
|
700
|
+
BigInt),
|
|
701
|
+
...Array.from(t_0.payload,
|
|
702
|
+
BigInt)],
|
|
703
|
+
Number))),
|
|
704
|
+
alignment: _descriptor_6.alignment() }))
|
|
705
|
+
.encode() } },
|
|
706
|
+
'log']);
|
|
707
|
+
return [];
|
|
708
|
+
}
|
|
709
|
+
async _postRespondBidirectional_0(context,
|
|
710
|
+
partialProofData,
|
|
711
|
+
requestId_0,
|
|
712
|
+
respondBidirectional_0)
|
|
713
|
+
{
|
|
714
|
+
const disclosedRequestId_0 = requestId_0;
|
|
715
|
+
const disclosedResponse_0 = respondBidirectional_0;
|
|
716
|
+
__compactRuntime.assert(this._equal_1(this._persistentHash_0(disclosedResponse_0.pk),
|
|
717
|
+
_descriptor_0.fromValue(__compactRuntime.queryLedgerState(context,
|
|
718
|
+
partialProofData,
|
|
719
|
+
[
|
|
720
|
+
{ dup: { n: 0 } },
|
|
721
|
+
{ idx: { cached: false,
|
|
722
|
+
pushPath: false,
|
|
723
|
+
path: [
|
|
724
|
+
{ tag: 'value',
|
|
725
|
+
value: { value: _descriptor_2.toValue(3n),
|
|
726
|
+
alignment: _descriptor_2.alignment() } }] } },
|
|
727
|
+
{ popeq: { cached: false,
|
|
728
|
+
result: undefined } }]).value)),
|
|
729
|
+
'unauthorized: attestation pk is not the MPC key');
|
|
730
|
+
__compactRuntime.assert(this._jubjubSchnorrVerify_0(this._signetAttestationMessage_0(disclosedRequestId_0,
|
|
731
|
+
disclosedResponse_0.serializedOutput,
|
|
732
|
+
disclosedResponse_0.outputLen),
|
|
733
|
+
{ announcement:
|
|
734
|
+
disclosedResponse_0.announcement,
|
|
735
|
+
response:
|
|
736
|
+
disclosedResponse_0.response },
|
|
737
|
+
disclosedResponse_0.pk),
|
|
738
|
+
'Invalid attestation signature');
|
|
739
|
+
if (_descriptor_7.fromValue(__compactRuntime.queryLedgerState(context,
|
|
740
|
+
partialProofData,
|
|
741
|
+
[
|
|
742
|
+
{ dup: { n: 0 } },
|
|
743
|
+
{ idx: { cached: false,
|
|
744
|
+
pushPath: false,
|
|
745
|
+
path: [
|
|
746
|
+
{ tag: 'value',
|
|
747
|
+
value: { value: _descriptor_2.toValue(2n),
|
|
748
|
+
alignment: _descriptor_2.alignment() } }] } },
|
|
749
|
+
{ push: { storage: false,
|
|
750
|
+
value: __compactRuntime.StateValue.newCell({ value: _descriptor_0.toValue(disclosedRequestId_0),
|
|
751
|
+
alignment: _descriptor_0.alignment() }).encode() } },
|
|
752
|
+
'member',
|
|
753
|
+
{ popeq: { cached: true,
|
|
754
|
+
result: undefined } }]).value))
|
|
755
|
+
{
|
|
756
|
+
return [];
|
|
757
|
+
} else {
|
|
758
|
+
__compactRuntime.queryLedgerState(context,
|
|
759
|
+
partialProofData,
|
|
760
|
+
[
|
|
761
|
+
{ idx: { cached: false,
|
|
762
|
+
pushPath: true,
|
|
763
|
+
path: [
|
|
764
|
+
{ tag: 'value',
|
|
765
|
+
value: { value: _descriptor_2.toValue(2n),
|
|
766
|
+
alignment: _descriptor_2.alignment() } }] } },
|
|
767
|
+
{ push: { storage: false,
|
|
768
|
+
value: __compactRuntime.StateValue.newCell({ value: _descriptor_0.toValue(disclosedRequestId_0),
|
|
769
|
+
alignment: _descriptor_0.alignment() }).encode() } },
|
|
770
|
+
{ push: { storage: true,
|
|
771
|
+
value: __compactRuntime.StateValue.newCell({ value: _descriptor_5.toValue(disclosedResponse_0),
|
|
772
|
+
alignment: _descriptor_5.alignment() }).encode() } },
|
|
773
|
+
{ ins: { cached: false, n: 1 } },
|
|
774
|
+
{ ins: { cached: true, n: 1 } }]);
|
|
775
|
+
let t_0;
|
|
776
|
+
__compactRuntime.queryLedgerState(context,
|
|
777
|
+
partialProofData,
|
|
778
|
+
[
|
|
779
|
+
{ push: { storage: false,
|
|
780
|
+
value: __compactRuntime.StateValue.newArray()
|
|
781
|
+
.arrayPush(__compactRuntime.StateValue.newCell({ value: _descriptor_25.toValue(1n),
|
|
782
|
+
alignment: _descriptor_25.alignment() })).arrayPush(__compactRuntime.StateValue.newCell({ value: _descriptor_2.toValue(10n),
|
|
783
|
+
alignment: _descriptor_2.alignment() })).arrayPush(__compactRuntime.StateValue.newCell({ value: _descriptor_6.toValue((t_0 = { name:
|
|
784
|
+
new Uint8Array([82, 101, 115, 112, 111, 110, 100, 66, 105, 100, 105, 114, 101, 99, 116, 105, 111, 110, 97, 108, 69, 118, 101, 110, 116, 0, 0, 0, 0, 0, 0, 0]),
|
|
785
|
+
payload:
|
|
786
|
+
this._serialize_2({ requestId:
|
|
787
|
+
disclosedRequestId_0 }) },
|
|
788
|
+
Uint8Array.from([...Array.from(t_0.name,
|
|
789
|
+
BigInt),
|
|
790
|
+
...Array.from(t_0.payload,
|
|
791
|
+
BigInt)],
|
|
792
|
+
Number))),
|
|
793
|
+
alignment: _descriptor_6.alignment() }))
|
|
794
|
+
.encode() } },
|
|
795
|
+
'log']);
|
|
796
|
+
return [];
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
_equal_0(x0, y0) {
|
|
800
|
+
{
|
|
801
|
+
let x1 = x0.x;
|
|
802
|
+
let y1 = y0.x;
|
|
803
|
+
if (x1 !== y1) { return false; }
|
|
804
|
+
}
|
|
805
|
+
{
|
|
806
|
+
let x1 = x0.y;
|
|
807
|
+
let y1 = y0.y;
|
|
808
|
+
if (x1 !== y1) { return false; }
|
|
809
|
+
}
|
|
810
|
+
return true;
|
|
811
|
+
}
|
|
812
|
+
_equal_1(x0, y0) {
|
|
813
|
+
if (!x0.every((x, i) => y0[i] === x)) { return false; }
|
|
814
|
+
return true;
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
export function ledger(stateOrChargedState) {
|
|
818
|
+
const state = stateOrChargedState instanceof __compactRuntime.StateValue ? stateOrChargedState : stateOrChargedState.state;
|
|
819
|
+
const chargedState = stateOrChargedState instanceof __compactRuntime.StateValue ? new __compactRuntime.ChargedState(stateOrChargedState) : stateOrChargedState;
|
|
820
|
+
const context = {
|
|
821
|
+
callContext: { currentQueryContext: new __compactRuntime.QueryContext(chargedState, __compactRuntime.dummyContractAddress()), currentGasCost: __compactRuntime.emptyRunningCost() },
|
|
822
|
+
costModel: __compactRuntime.CostModel.initialCostModel()
|
|
823
|
+
};
|
|
824
|
+
const partialProofData = {
|
|
825
|
+
input: { value: [], alignment: [] },
|
|
826
|
+
output: undefined,
|
|
827
|
+
publicTranscript: [],
|
|
828
|
+
privateTranscriptOutputs: []
|
|
829
|
+
};
|
|
830
|
+
return {
|
|
831
|
+
signatureResponseCounterIndex: {
|
|
832
|
+
isEmpty(...args_0) {
|
|
833
|
+
if (args_0.length !== 0) {
|
|
834
|
+
throw new __compactRuntime.CompactError(`isEmpty: expected 0 arguments, received ${args_0.length}`);
|
|
835
|
+
}
|
|
836
|
+
return _descriptor_7.fromValue(__compactRuntime.queryLedgerState(context,
|
|
837
|
+
partialProofData,
|
|
838
|
+
[
|
|
839
|
+
{ dup: { n: 0 } },
|
|
840
|
+
{ idx: { cached: false,
|
|
841
|
+
pushPath: false,
|
|
842
|
+
path: [
|
|
843
|
+
{ tag: 'value',
|
|
844
|
+
value: { value: _descriptor_2.toValue(0n),
|
|
845
|
+
alignment: _descriptor_2.alignment() } }] } },
|
|
846
|
+
'size',
|
|
847
|
+
{ push: { storage: false,
|
|
848
|
+
value: __compactRuntime.StateValue.newCell({ value: _descriptor_10.toValue(0n),
|
|
849
|
+
alignment: _descriptor_10.alignment() }).encode() } },
|
|
850
|
+
'eq',
|
|
851
|
+
{ popeq: { cached: true,
|
|
852
|
+
result: undefined } }]).value);
|
|
853
|
+
},
|
|
854
|
+
size(...args_0) {
|
|
855
|
+
if (args_0.length !== 0) {
|
|
856
|
+
throw new __compactRuntime.CompactError(`size: expected 0 arguments, received ${args_0.length}`);
|
|
857
|
+
}
|
|
858
|
+
return _descriptor_10.fromValue(__compactRuntime.queryLedgerState(context,
|
|
859
|
+
partialProofData,
|
|
860
|
+
[
|
|
861
|
+
{ dup: { n: 0 } },
|
|
862
|
+
{ idx: { cached: false,
|
|
863
|
+
pushPath: false,
|
|
864
|
+
path: [
|
|
865
|
+
{ tag: 'value',
|
|
866
|
+
value: { value: _descriptor_2.toValue(0n),
|
|
867
|
+
alignment: _descriptor_2.alignment() } }] } },
|
|
868
|
+
'size',
|
|
869
|
+
{ popeq: { cached: true,
|
|
870
|
+
result: undefined } }]).value);
|
|
871
|
+
},
|
|
872
|
+
member(...args_0) {
|
|
873
|
+
if (args_0.length !== 1) {
|
|
874
|
+
throw new __compactRuntime.CompactError(`member: expected 1 argument, received ${args_0.length}`);
|
|
875
|
+
}
|
|
876
|
+
const key_0 = args_0[0];
|
|
877
|
+
if (!(key_0.buffer instanceof ArrayBuffer && key_0.BYTES_PER_ELEMENT === 1 && key_0.length === 32)) {
|
|
878
|
+
__compactRuntime.typeError('member',
|
|
879
|
+
'argument 1',
|
|
880
|
+
'signet-contract.compact line 14 char 1',
|
|
881
|
+
'Bytes<32>',
|
|
882
|
+
key_0)
|
|
883
|
+
}
|
|
884
|
+
return _descriptor_7.fromValue(__compactRuntime.queryLedgerState(context,
|
|
885
|
+
partialProofData,
|
|
886
|
+
[
|
|
887
|
+
{ dup: { n: 0 } },
|
|
888
|
+
{ idx: { cached: false,
|
|
889
|
+
pushPath: false,
|
|
890
|
+
path: [
|
|
891
|
+
{ tag: 'value',
|
|
892
|
+
value: { value: _descriptor_2.toValue(0n),
|
|
893
|
+
alignment: _descriptor_2.alignment() } }] } },
|
|
894
|
+
{ push: { storage: false,
|
|
895
|
+
value: __compactRuntime.StateValue.newCell({ value: _descriptor_0.toValue(key_0),
|
|
896
|
+
alignment: _descriptor_0.alignment() }).encode() } },
|
|
897
|
+
'member',
|
|
898
|
+
{ popeq: { cached: true,
|
|
899
|
+
result: undefined } }]).value);
|
|
900
|
+
},
|
|
901
|
+
lookup(...args_0) {
|
|
902
|
+
if (args_0.length !== 1) {
|
|
903
|
+
throw new __compactRuntime.CompactError(`lookup: expected 1 argument, received ${args_0.length}`);
|
|
904
|
+
}
|
|
905
|
+
const key_0 = args_0[0];
|
|
906
|
+
if (!(key_0.buffer instanceof ArrayBuffer && key_0.BYTES_PER_ELEMENT === 1 && key_0.length === 32)) {
|
|
907
|
+
__compactRuntime.typeError('lookup',
|
|
908
|
+
'argument 1',
|
|
909
|
+
'signet-contract.compact line 14 char 1',
|
|
910
|
+
'Bytes<32>',
|
|
911
|
+
key_0)
|
|
912
|
+
}
|
|
913
|
+
if (state.asArray()[0].asMap().get({ value: _descriptor_0.toValue(key_0),
|
|
914
|
+
alignment: _descriptor_0.alignment() }) === undefined) {
|
|
915
|
+
throw new __compactRuntime.CompactError(`Map value undefined for ${key_0}`);
|
|
916
|
+
}
|
|
917
|
+
return {
|
|
918
|
+
read(...args_1) {
|
|
919
|
+
if (args_1.length !== 0) {
|
|
920
|
+
throw new __compactRuntime.CompactError(`read: expected 0 arguments, received ${args_1.length}`);
|
|
921
|
+
}
|
|
922
|
+
return _descriptor_10.fromValue(__compactRuntime.queryLedgerState(context,
|
|
923
|
+
partialProofData,
|
|
924
|
+
[
|
|
925
|
+
{ dup: { n: 0 } },
|
|
926
|
+
{ idx: { cached: false,
|
|
927
|
+
pushPath: false,
|
|
928
|
+
path: [
|
|
929
|
+
{ tag: 'value',
|
|
930
|
+
value: { value: _descriptor_2.toValue(0n),
|
|
931
|
+
alignment: _descriptor_2.alignment() } },
|
|
932
|
+
{ tag: 'value',
|
|
933
|
+
value: { value: _descriptor_0.toValue(key_0),
|
|
934
|
+
alignment: _descriptor_0.alignment() } }] } },
|
|
935
|
+
{ popeq: { cached: true,
|
|
936
|
+
result: undefined } }]).value);
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
},
|
|
941
|
+
signatureResponseIndex: {
|
|
942
|
+
isEmpty(...args_0) {
|
|
943
|
+
if (args_0.length !== 0) {
|
|
944
|
+
throw new __compactRuntime.CompactError(`isEmpty: expected 0 arguments, received ${args_0.length}`);
|
|
945
|
+
}
|
|
946
|
+
return _descriptor_7.fromValue(__compactRuntime.queryLedgerState(context,
|
|
947
|
+
partialProofData,
|
|
948
|
+
[
|
|
949
|
+
{ dup: { n: 0 } },
|
|
950
|
+
{ idx: { cached: false,
|
|
951
|
+
pushPath: false,
|
|
952
|
+
path: [
|
|
953
|
+
{ tag: 'value',
|
|
954
|
+
value: { value: _descriptor_2.toValue(1n),
|
|
955
|
+
alignment: _descriptor_2.alignment() } }] } },
|
|
956
|
+
'size',
|
|
957
|
+
{ push: { storage: false,
|
|
958
|
+
value: __compactRuntime.StateValue.newCell({ value: _descriptor_10.toValue(0n),
|
|
959
|
+
alignment: _descriptor_10.alignment() }).encode() } },
|
|
960
|
+
'eq',
|
|
961
|
+
{ popeq: { cached: true,
|
|
962
|
+
result: undefined } }]).value);
|
|
963
|
+
},
|
|
964
|
+
size(...args_0) {
|
|
965
|
+
if (args_0.length !== 0) {
|
|
966
|
+
throw new __compactRuntime.CompactError(`size: expected 0 arguments, received ${args_0.length}`);
|
|
967
|
+
}
|
|
968
|
+
return _descriptor_10.fromValue(__compactRuntime.queryLedgerState(context,
|
|
969
|
+
partialProofData,
|
|
970
|
+
[
|
|
971
|
+
{ dup: { n: 0 } },
|
|
972
|
+
{ idx: { cached: false,
|
|
973
|
+
pushPath: false,
|
|
974
|
+
path: [
|
|
975
|
+
{ tag: 'value',
|
|
976
|
+
value: { value: _descriptor_2.toValue(1n),
|
|
977
|
+
alignment: _descriptor_2.alignment() } }] } },
|
|
978
|
+
'size',
|
|
979
|
+
{ popeq: { cached: true,
|
|
980
|
+
result: undefined } }]).value);
|
|
981
|
+
},
|
|
982
|
+
member(...args_0) {
|
|
983
|
+
if (args_0.length !== 1) {
|
|
984
|
+
throw new __compactRuntime.CompactError(`member: expected 1 argument, received ${args_0.length}`);
|
|
985
|
+
}
|
|
986
|
+
const key_0 = args_0[0];
|
|
987
|
+
if (!(typeof(key_0) === 'object' && typeof(key_0.count) === 'bigint' && key_0.count >= 0n && key_0.count <= 18446744073709551615n && key_0.requestId.buffer instanceof ArrayBuffer && key_0.requestId.BYTES_PER_ELEMENT === 1 && key_0.requestId.length === 32)) {
|
|
988
|
+
__compactRuntime.typeError('member',
|
|
989
|
+
'argument 1',
|
|
990
|
+
'signet-contract.compact line 16 char 1',
|
|
991
|
+
'struct SignetResponseKey<count: Uint<0..18446744073709551616>, requestId: Bytes<32>>',
|
|
992
|
+
key_0)
|
|
993
|
+
}
|
|
994
|
+
return _descriptor_7.fromValue(__compactRuntime.queryLedgerState(context,
|
|
995
|
+
partialProofData,
|
|
996
|
+
[
|
|
997
|
+
{ dup: { n: 0 } },
|
|
998
|
+
{ idx: { cached: false,
|
|
999
|
+
pushPath: false,
|
|
1000
|
+
path: [
|
|
1001
|
+
{ tag: 'value',
|
|
1002
|
+
value: { value: _descriptor_2.toValue(1n),
|
|
1003
|
+
alignment: _descriptor_2.alignment() } }] } },
|
|
1004
|
+
{ push: { storage: false,
|
|
1005
|
+
value: __compactRuntime.StateValue.newCell({ value: _descriptor_12.toValue(key_0),
|
|
1006
|
+
alignment: _descriptor_12.alignment() }).encode() } },
|
|
1007
|
+
'member',
|
|
1008
|
+
{ popeq: { cached: true,
|
|
1009
|
+
result: undefined } }]).value);
|
|
1010
|
+
},
|
|
1011
|
+
lookup(...args_0) {
|
|
1012
|
+
if (args_0.length !== 1) {
|
|
1013
|
+
throw new __compactRuntime.CompactError(`lookup: expected 1 argument, received ${args_0.length}`);
|
|
1014
|
+
}
|
|
1015
|
+
const key_0 = args_0[0];
|
|
1016
|
+
if (!(typeof(key_0) === 'object' && typeof(key_0.count) === 'bigint' && key_0.count >= 0n && key_0.count <= 18446744073709551615n && key_0.requestId.buffer instanceof ArrayBuffer && key_0.requestId.BYTES_PER_ELEMENT === 1 && key_0.requestId.length === 32)) {
|
|
1017
|
+
__compactRuntime.typeError('lookup',
|
|
1018
|
+
'argument 1',
|
|
1019
|
+
'signet-contract.compact line 16 char 1',
|
|
1020
|
+
'struct SignetResponseKey<count: Uint<0..18446744073709551616>, requestId: Bytes<32>>',
|
|
1021
|
+
key_0)
|
|
1022
|
+
}
|
|
1023
|
+
return _descriptor_13.fromValue(__compactRuntime.queryLedgerState(context,
|
|
1024
|
+
partialProofData,
|
|
1025
|
+
[
|
|
1026
|
+
{ dup: { n: 0 } },
|
|
1027
|
+
{ idx: { cached: false,
|
|
1028
|
+
pushPath: false,
|
|
1029
|
+
path: [
|
|
1030
|
+
{ tag: 'value',
|
|
1031
|
+
value: { value: _descriptor_2.toValue(1n),
|
|
1032
|
+
alignment: _descriptor_2.alignment() } }] } },
|
|
1033
|
+
{ idx: { cached: false,
|
|
1034
|
+
pushPath: false,
|
|
1035
|
+
path: [
|
|
1036
|
+
{ tag: 'value',
|
|
1037
|
+
value: { value: _descriptor_12.toValue(key_0),
|
|
1038
|
+
alignment: _descriptor_12.alignment() } }] } },
|
|
1039
|
+
{ popeq: { cached: false,
|
|
1040
|
+
result: undefined } }]).value);
|
|
1041
|
+
},
|
|
1042
|
+
[Symbol.iterator](...args_0) {
|
|
1043
|
+
if (args_0.length !== 0) {
|
|
1044
|
+
throw new __compactRuntime.CompactError(`iter: expected 0 arguments, received ${args_0.length}`);
|
|
1045
|
+
}
|
|
1046
|
+
const self_0 = state.asArray()[1];
|
|
1047
|
+
return self_0.asMap().keys().map( (key) => { const value = self_0.asMap().get(key).asCell(); return [ _descriptor_12.fromValue(key.value), _descriptor_13.fromValue(value.value) ]; })[Symbol.iterator]();
|
|
1048
|
+
}
|
|
1049
|
+
},
|
|
1050
|
+
respondBidirectionalIndex: {
|
|
1051
|
+
isEmpty(...args_0) {
|
|
1052
|
+
if (args_0.length !== 0) {
|
|
1053
|
+
throw new __compactRuntime.CompactError(`isEmpty: expected 0 arguments, received ${args_0.length}`);
|
|
1054
|
+
}
|
|
1055
|
+
return _descriptor_7.fromValue(__compactRuntime.queryLedgerState(context,
|
|
1056
|
+
partialProofData,
|
|
1057
|
+
[
|
|
1058
|
+
{ dup: { n: 0 } },
|
|
1059
|
+
{ idx: { cached: false,
|
|
1060
|
+
pushPath: false,
|
|
1061
|
+
path: [
|
|
1062
|
+
{ tag: 'value',
|
|
1063
|
+
value: { value: _descriptor_2.toValue(2n),
|
|
1064
|
+
alignment: _descriptor_2.alignment() } }] } },
|
|
1065
|
+
'size',
|
|
1066
|
+
{ push: { storage: false,
|
|
1067
|
+
value: __compactRuntime.StateValue.newCell({ value: _descriptor_10.toValue(0n),
|
|
1068
|
+
alignment: _descriptor_10.alignment() }).encode() } },
|
|
1069
|
+
'eq',
|
|
1070
|
+
{ popeq: { cached: true,
|
|
1071
|
+
result: undefined } }]).value);
|
|
1072
|
+
},
|
|
1073
|
+
size(...args_0) {
|
|
1074
|
+
if (args_0.length !== 0) {
|
|
1075
|
+
throw new __compactRuntime.CompactError(`size: expected 0 arguments, received ${args_0.length}`);
|
|
1076
|
+
}
|
|
1077
|
+
return _descriptor_10.fromValue(__compactRuntime.queryLedgerState(context,
|
|
1078
|
+
partialProofData,
|
|
1079
|
+
[
|
|
1080
|
+
{ dup: { n: 0 } },
|
|
1081
|
+
{ idx: { cached: false,
|
|
1082
|
+
pushPath: false,
|
|
1083
|
+
path: [
|
|
1084
|
+
{ tag: 'value',
|
|
1085
|
+
value: { value: _descriptor_2.toValue(2n),
|
|
1086
|
+
alignment: _descriptor_2.alignment() } }] } },
|
|
1087
|
+
'size',
|
|
1088
|
+
{ popeq: { cached: true,
|
|
1089
|
+
result: undefined } }]).value);
|
|
1090
|
+
},
|
|
1091
|
+
member(...args_0) {
|
|
1092
|
+
if (args_0.length !== 1) {
|
|
1093
|
+
throw new __compactRuntime.CompactError(`member: expected 1 argument, received ${args_0.length}`);
|
|
1094
|
+
}
|
|
1095
|
+
const key_0 = args_0[0];
|
|
1096
|
+
if (!(key_0.buffer instanceof ArrayBuffer && key_0.BYTES_PER_ELEMENT === 1 && key_0.length === 32)) {
|
|
1097
|
+
__compactRuntime.typeError('member',
|
|
1098
|
+
'argument 1',
|
|
1099
|
+
'signet-contract.compact line 18 char 1',
|
|
1100
|
+
'Bytes<32>',
|
|
1101
|
+
key_0)
|
|
1102
|
+
}
|
|
1103
|
+
return _descriptor_7.fromValue(__compactRuntime.queryLedgerState(context,
|
|
1104
|
+
partialProofData,
|
|
1105
|
+
[
|
|
1106
|
+
{ dup: { n: 0 } },
|
|
1107
|
+
{ idx: { cached: false,
|
|
1108
|
+
pushPath: false,
|
|
1109
|
+
path: [
|
|
1110
|
+
{ tag: 'value',
|
|
1111
|
+
value: { value: _descriptor_2.toValue(2n),
|
|
1112
|
+
alignment: _descriptor_2.alignment() } }] } },
|
|
1113
|
+
{ push: { storage: false,
|
|
1114
|
+
value: __compactRuntime.StateValue.newCell({ value: _descriptor_0.toValue(key_0),
|
|
1115
|
+
alignment: _descriptor_0.alignment() }).encode() } },
|
|
1116
|
+
'member',
|
|
1117
|
+
{ popeq: { cached: true,
|
|
1118
|
+
result: undefined } }]).value);
|
|
1119
|
+
},
|
|
1120
|
+
lookup(...args_0) {
|
|
1121
|
+
if (args_0.length !== 1) {
|
|
1122
|
+
throw new __compactRuntime.CompactError(`lookup: expected 1 argument, received ${args_0.length}`);
|
|
1123
|
+
}
|
|
1124
|
+
const key_0 = args_0[0];
|
|
1125
|
+
if (!(key_0.buffer instanceof ArrayBuffer && key_0.BYTES_PER_ELEMENT === 1 && key_0.length === 32)) {
|
|
1126
|
+
__compactRuntime.typeError('lookup',
|
|
1127
|
+
'argument 1',
|
|
1128
|
+
'signet-contract.compact line 18 char 1',
|
|
1129
|
+
'Bytes<32>',
|
|
1130
|
+
key_0)
|
|
1131
|
+
}
|
|
1132
|
+
return _descriptor_5.fromValue(__compactRuntime.queryLedgerState(context,
|
|
1133
|
+
partialProofData,
|
|
1134
|
+
[
|
|
1135
|
+
{ dup: { n: 0 } },
|
|
1136
|
+
{ idx: { cached: false,
|
|
1137
|
+
pushPath: false,
|
|
1138
|
+
path: [
|
|
1139
|
+
{ tag: 'value',
|
|
1140
|
+
value: { value: _descriptor_2.toValue(2n),
|
|
1141
|
+
alignment: _descriptor_2.alignment() } }] } },
|
|
1142
|
+
{ idx: { cached: false,
|
|
1143
|
+
pushPath: false,
|
|
1144
|
+
path: [
|
|
1145
|
+
{ tag: 'value',
|
|
1146
|
+
value: { value: _descriptor_0.toValue(key_0),
|
|
1147
|
+
alignment: _descriptor_0.alignment() } }] } },
|
|
1148
|
+
{ popeq: { cached: false,
|
|
1149
|
+
result: undefined } }]).value);
|
|
1150
|
+
},
|
|
1151
|
+
[Symbol.iterator](...args_0) {
|
|
1152
|
+
if (args_0.length !== 0) {
|
|
1153
|
+
throw new __compactRuntime.CompactError(`iter: expected 0 arguments, received ${args_0.length}`);
|
|
1154
|
+
}
|
|
1155
|
+
const self_0 = state.asArray()[2];
|
|
1156
|
+
return self_0.asMap().keys().map( (key) => { const value = self_0.asMap().get(key).asCell(); return [ _descriptor_0.fromValue(key.value), _descriptor_5.fromValue(value.value) ]; })[Symbol.iterator]();
|
|
1157
|
+
}
|
|
1158
|
+
},
|
|
1159
|
+
get mpcPubKeyHash() {
|
|
1160
|
+
return _descriptor_0.fromValue(__compactRuntime.queryLedgerState(context,
|
|
1161
|
+
partialProofData,
|
|
1162
|
+
[
|
|
1163
|
+
{ dup: { n: 0 } },
|
|
1164
|
+
{ idx: { cached: false,
|
|
1165
|
+
pushPath: false,
|
|
1166
|
+
path: [
|
|
1167
|
+
{ tag: 'value',
|
|
1168
|
+
value: { value: _descriptor_2.toValue(3n),
|
|
1169
|
+
alignment: _descriptor_2.alignment() } }] } },
|
|
1170
|
+
{ popeq: { cached: false,
|
|
1171
|
+
result: undefined } }]).value);
|
|
1172
|
+
}
|
|
1173
|
+
};
|
|
1174
|
+
}
|
|
1175
|
+
const _emptyContext = {
|
|
1176
|
+
callContext: { currentQueryContext: new __compactRuntime.QueryContext(new __compactRuntime.ContractState().data, __compactRuntime.dummyContractAddress()), currentGasCost: __compactRuntime.emptyRunningCost() }
|
|
1177
|
+
};
|
|
1178
|
+
const _dummyContract = new Contract({ });
|
|
1179
|
+
export const pureCircuits = {};
|
|
1180
|
+
export const contractReferenceLocations =
|
|
1181
|
+
{ tag: 'publicLedgerArray', indices: { } };
|
|
1182
|
+
export const expectedVk = {
|
|
1183
|
+
'emitSignBidirectionalEvent': '97af5bb456fae0ea3daf411d8031e6ceefe1cdc6dc0349372c56414d53fb8d6e',
|
|
1184
|
+
'postRespondBidirectional': 'feda5f59c6367153d6089edefc96a7a18597373393d1f0c3410e9790c65078c7',
|
|
1185
|
+
'postSignatureResponse': '1774d8bce0d5a9f4dcbd59f292b9cb5a9b69c5636ce9a95b7ec17ce797b425e7',
|
|
1186
|
+
};
|
|
1187
|
+
|
|
1188
|
+
//# sourceMappingURL=index.js.map
|