@midnames/sdk 0.1.8 → 0.2.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.
@@ -0,0 +1,2789 @@
1
+ 'use strict';
2
+ const __compactRuntime = require('@midnight-ntwrk/compact-runtime');
3
+ const expectedRuntimeVersionString = '0.8.1';
4
+ const expectedRuntimeVersion = expectedRuntimeVersionString.split('-')[0].split('.').map(Number);
5
+ const actualRuntimeVersion = __compactRuntime.versionString.split('-')[0].split('.').map(Number);
6
+ if (expectedRuntimeVersion[0] != actualRuntimeVersion[0]
7
+ || (actualRuntimeVersion[0] == 0 && expectedRuntimeVersion[1] != actualRuntimeVersion[1])
8
+ || expectedRuntimeVersion[1] > actualRuntimeVersion[1]
9
+ || (expectedRuntimeVersion[1] == actualRuntimeVersion[1] && expectedRuntimeVersion[2] > actualRuntimeVersion[2]))
10
+ throw new __compactRuntime.CompactError(`Version mismatch: compiled code expects ${expectedRuntimeVersionString}, runtime is ${__compactRuntime.versionString}`);
11
+ { const MAX_FIELD = 52435875175126190479447740508185965837690552500527637822603658699938581184512n;
12
+ if (__compactRuntime.MAX_FIELD !== MAX_FIELD)
13
+ throw new __compactRuntime.CompactError(`compiler thinks maximum field value is ${MAX_FIELD}; run time thinks it is ${__compactRuntime.MAX_FIELD}`)
14
+ }
15
+
16
+ const _descriptor_0 = new __compactRuntime.CompactTypeOpaqueString();
17
+
18
+ const _descriptor_1 = new __compactRuntime.CompactTypeBytes(32);
19
+
20
+ class _ZswapCoinPublicKey_0 {
21
+ alignment() {
22
+ return _descriptor_1.alignment();
23
+ }
24
+ fromValue(value_0) {
25
+ return {
26
+ bytes: _descriptor_1.fromValue(value_0)
27
+ }
28
+ }
29
+ toValue(value_0) {
30
+ return _descriptor_1.toValue(value_0.bytes);
31
+ }
32
+ }
33
+
34
+ const _descriptor_2 = new _ZswapCoinPublicKey_0();
35
+
36
+ class _ContractAddress_0 {
37
+ alignment() {
38
+ return _descriptor_1.alignment();
39
+ }
40
+ fromValue(value_0) {
41
+ return {
42
+ bytes: _descriptor_1.fromValue(value_0)
43
+ }
44
+ }
45
+ toValue(value_0) {
46
+ return _descriptor_1.toValue(value_0.bytes);
47
+ }
48
+ }
49
+
50
+ const _descriptor_3 = new _ContractAddress_0();
51
+
52
+ class _DomainData_0 {
53
+ alignment() {
54
+ return _descriptor_2.alignment().concat(_descriptor_3.alignment());
55
+ }
56
+ fromValue(value_0) {
57
+ return {
58
+ owner: _descriptor_2.fromValue(value_0),
59
+ resolver: _descriptor_3.fromValue(value_0)
60
+ }
61
+ }
62
+ toValue(value_0) {
63
+ return _descriptor_2.toValue(value_0.owner).concat(_descriptor_3.toValue(value_0.resolver));
64
+ }
65
+ }
66
+
67
+ const _descriptor_4 = new _DomainData_0();
68
+
69
+ const _descriptor_5 = new __compactRuntime.CompactTypeBoolean();
70
+
71
+ const _descriptor_6 = new __compactRuntime.CompactTypeUnsignedInteger(18446744073709551615n, 8);
72
+
73
+ class _Either_0 {
74
+ alignment() {
75
+ return _descriptor_5.alignment().concat(_descriptor_2.alignment().concat(_descriptor_3.alignment()));
76
+ }
77
+ fromValue(value_0) {
78
+ return {
79
+ is_left: _descriptor_5.fromValue(value_0),
80
+ left: _descriptor_2.fromValue(value_0),
81
+ right: _descriptor_3.fromValue(value_0)
82
+ }
83
+ }
84
+ toValue(value_0) {
85
+ return _descriptor_5.toValue(value_0.is_left).concat(_descriptor_2.toValue(value_0.left).concat(_descriptor_3.toValue(value_0.right)));
86
+ }
87
+ }
88
+
89
+ const _descriptor_7 = new _Either_0();
90
+
91
+ const _descriptor_8 = new __compactRuntime.CompactTypeUnsignedInteger(340282366920938463463374607431768211455n, 16);
92
+
93
+ class _CoinInfo_0 {
94
+ alignment() {
95
+ return _descriptor_1.alignment().concat(_descriptor_1.alignment().concat(_descriptor_8.alignment()));
96
+ }
97
+ fromValue(value_0) {
98
+ return {
99
+ nonce: _descriptor_1.fromValue(value_0),
100
+ color: _descriptor_1.fromValue(value_0),
101
+ value: _descriptor_8.fromValue(value_0)
102
+ }
103
+ }
104
+ toValue(value_0) {
105
+ return _descriptor_1.toValue(value_0.nonce).concat(_descriptor_1.toValue(value_0.color).concat(_descriptor_8.toValue(value_0.value)));
106
+ }
107
+ }
108
+
109
+ const _descriptor_9 = new _CoinInfo_0();
110
+
111
+ class _tuple_0 {
112
+ alignment() {
113
+ return _descriptor_0.alignment().concat(_descriptor_0.alignment());
114
+ }
115
+ fromValue(value_0) {
116
+ return [
117
+ _descriptor_0.fromValue(value_0),
118
+ _descriptor_0.fromValue(value_0)
119
+ ]
120
+ }
121
+ toValue(value_0) {
122
+ return _descriptor_0.toValue(value_0[0]).concat(_descriptor_0.toValue(value_0[1]));
123
+ }
124
+ }
125
+
126
+ const _descriptor_10 = new _tuple_0();
127
+
128
+ class _Maybe_0 {
129
+ alignment() {
130
+ return _descriptor_5.alignment().concat(_descriptor_10.alignment());
131
+ }
132
+ fromValue(value_0) {
133
+ return {
134
+ is_some: _descriptor_5.fromValue(value_0),
135
+ value: _descriptor_10.fromValue(value_0)
136
+ }
137
+ }
138
+ toValue(value_0) {
139
+ return _descriptor_5.toValue(value_0.is_some).concat(_descriptor_10.toValue(value_0.value));
140
+ }
141
+ }
142
+
143
+ const _descriptor_11 = new _Maybe_0();
144
+
145
+ const _descriptor_12 = new __compactRuntime.CompactTypeVector(10, _descriptor_11);
146
+
147
+ class _QualifiedCoinInfo_0 {
148
+ alignment() {
149
+ return _descriptor_1.alignment().concat(_descriptor_1.alignment().concat(_descriptor_8.alignment().concat(_descriptor_6.alignment())));
150
+ }
151
+ fromValue(value_0) {
152
+ return {
153
+ nonce: _descriptor_1.fromValue(value_0),
154
+ color: _descriptor_1.fromValue(value_0),
155
+ value: _descriptor_8.fromValue(value_0),
156
+ mt_index: _descriptor_6.fromValue(value_0)
157
+ }
158
+ }
159
+ toValue(value_0) {
160
+ return _descriptor_1.toValue(value_0.nonce).concat(_descriptor_1.toValue(value_0.color).concat(_descriptor_8.toValue(value_0.value).concat(_descriptor_6.toValue(value_0.mt_index))));
161
+ }
162
+ }
163
+
164
+ const _descriptor_13 = new _QualifiedCoinInfo_0();
165
+
166
+ class _Maybe_1 {
167
+ alignment() {
168
+ return _descriptor_5.alignment().concat(_descriptor_9.alignment());
169
+ }
170
+ fromValue(value_0) {
171
+ return {
172
+ is_some: _descriptor_5.fromValue(value_0),
173
+ value: _descriptor_9.fromValue(value_0)
174
+ }
175
+ }
176
+ toValue(value_0) {
177
+ return _descriptor_5.toValue(value_0.is_some).concat(_descriptor_9.toValue(value_0.value));
178
+ }
179
+ }
180
+
181
+ const _descriptor_14 = new _Maybe_1();
182
+
183
+ class _SendResult_0 {
184
+ alignment() {
185
+ return _descriptor_14.alignment().concat(_descriptor_9.alignment());
186
+ }
187
+ fromValue(value_0) {
188
+ return {
189
+ change: _descriptor_14.fromValue(value_0),
190
+ sent: _descriptor_9.fromValue(value_0)
191
+ }
192
+ }
193
+ toValue(value_0) {
194
+ return _descriptor_14.toValue(value_0.change).concat(_descriptor_9.toValue(value_0.sent));
195
+ }
196
+ }
197
+
198
+ const _descriptor_15 = new _SendResult_0();
199
+
200
+ const _descriptor_16 = new __compactRuntime.CompactTypeField();
201
+
202
+ const _descriptor_17 = new __compactRuntime.CompactTypeBytes(6);
203
+
204
+ class _CoinPreimage_0 {
205
+ alignment() {
206
+ return _descriptor_9.alignment().concat(_descriptor_5.alignment().concat(_descriptor_1.alignment().concat(_descriptor_17.alignment())));
207
+ }
208
+ fromValue(value_0) {
209
+ return {
210
+ info: _descriptor_9.fromValue(value_0),
211
+ dataType: _descriptor_5.fromValue(value_0),
212
+ data: _descriptor_1.fromValue(value_0),
213
+ domain_sep: _descriptor_17.fromValue(value_0)
214
+ }
215
+ }
216
+ toValue(value_0) {
217
+ return _descriptor_9.toValue(value_0.info).concat(_descriptor_5.toValue(value_0.dataType).concat(_descriptor_1.toValue(value_0.data).concat(_descriptor_17.toValue(value_0.domain_sep))));
218
+ }
219
+ }
220
+
221
+ const _descriptor_18 = new _CoinPreimage_0();
222
+
223
+ const _descriptor_19 = new __compactRuntime.CompactTypeVector(2, _descriptor_16);
224
+
225
+ class _Maybe_2 {
226
+ alignment() {
227
+ return _descriptor_5.alignment().concat(_descriptor_0.alignment());
228
+ }
229
+ fromValue(value_0) {
230
+ return {
231
+ is_some: _descriptor_5.fromValue(value_0),
232
+ value: _descriptor_0.fromValue(value_0)
233
+ }
234
+ }
235
+ toValue(value_0) {
236
+ return _descriptor_5.toValue(value_0.is_some).concat(_descriptor_0.toValue(value_0.value));
237
+ }
238
+ }
239
+
240
+ const _descriptor_20 = new _Maybe_2();
241
+
242
+ const _descriptor_21 = new __compactRuntime.CompactTypeUnsignedInteger(255n, 1);
243
+
244
+ class Contract {
245
+ witnesses;
246
+ constructor(...args_0) {
247
+ if (args_0.length !== 1) {
248
+ throw new __compactRuntime.CompactError(`Contract constructor: expected 1 argument, received ${args_0.length}`);
249
+ }
250
+ const witnesses_0 = args_0[0];
251
+ if (typeof(witnesses_0) !== 'object') {
252
+ throw new __compactRuntime.CompactError('first (witnesses) argument to Contract constructor is not an object');
253
+ }
254
+ this.witnesses = witnesses_0;
255
+ this.circuits = {
256
+ update_color: (...args_1) => {
257
+ if (args_1.length !== 2) {
258
+ throw new __compactRuntime.CompactError(`update_color: expected 2 arguments (as invoked from Typescript), received ${args_1.length}`);
259
+ }
260
+ const contextOrig_0 = args_1[0];
261
+ const c_0 = args_1[1];
262
+ if (!(typeof(contextOrig_0) === 'object' && contextOrig_0.originalState != undefined && contextOrig_0.transactionContext != undefined)) {
263
+ __compactRuntime.type_error('update_color',
264
+ 'argument 1 (as invoked from Typescript)',
265
+ 'leaf.compact line 84 char 1',
266
+ 'CircuitContext',
267
+ contextOrig_0)
268
+ }
269
+ if (!(c_0.buffer instanceof ArrayBuffer && c_0.BYTES_PER_ELEMENT === 1 && c_0.length === 32)) {
270
+ __compactRuntime.type_error('update_color',
271
+ 'argument 1 (argument 2 as invoked from Typescript)',
272
+ 'leaf.compact line 84 char 1',
273
+ 'Bytes<32>',
274
+ c_0)
275
+ }
276
+ const context = { ...contextOrig_0 };
277
+ const partialProofData = {
278
+ input: {
279
+ value: _descriptor_1.toValue(c_0),
280
+ alignment: _descriptor_1.alignment()
281
+ },
282
+ output: undefined,
283
+ publicTranscript: [],
284
+ privateTranscriptOutputs: []
285
+ };
286
+ const result_0 = this._update_color_0(context, partialProofData, c_0);
287
+ partialProofData.output = { value: [], alignment: [] };
288
+ return { result: result_0, context: context, proofData: partialProofData };
289
+ },
290
+ update_cost: (...args_1) => {
291
+ if (args_1.length !== 2) {
292
+ throw new __compactRuntime.CompactError(`update_cost: expected 2 arguments (as invoked from Typescript), received ${args_1.length}`);
293
+ }
294
+ const contextOrig_0 = args_1[0];
295
+ const c_0 = args_1[1];
296
+ if (!(typeof(contextOrig_0) === 'object' && contextOrig_0.originalState != undefined && contextOrig_0.transactionContext != undefined)) {
297
+ __compactRuntime.type_error('update_cost',
298
+ 'argument 1 (as invoked from Typescript)',
299
+ 'leaf.compact line 89 char 1',
300
+ 'CircuitContext',
301
+ contextOrig_0)
302
+ }
303
+ if (!(typeof(c_0) === 'bigint' && c_0 >= 0n && c_0 <= 18446744073709551615n)) {
304
+ __compactRuntime.type_error('update_cost',
305
+ 'argument 1 (argument 2 as invoked from Typescript)',
306
+ 'leaf.compact line 89 char 1',
307
+ 'Uint<0..18446744073709551615>',
308
+ c_0)
309
+ }
310
+ const context = { ...contextOrig_0 };
311
+ const partialProofData = {
312
+ input: {
313
+ value: _descriptor_6.toValue(c_0),
314
+ alignment: _descriptor_6.alignment()
315
+ },
316
+ output: undefined,
317
+ publicTranscript: [],
318
+ privateTranscriptOutputs: []
319
+ };
320
+ const result_0 = this._update_cost_0(context, partialProofData, c_0);
321
+ partialProofData.output = { value: [], alignment: [] };
322
+ return { result: result_0, context: context, proofData: partialProofData };
323
+ },
324
+ update_target_and_fields: (...args_1) => {
325
+ if (args_1.length !== 3) {
326
+ throw new __compactRuntime.CompactError(`update_target_and_fields: expected 3 arguments (as invoked from Typescript), received ${args_1.length}`);
327
+ }
328
+ const contextOrig_0 = args_1[0];
329
+ const new_target_0 = args_1[1];
330
+ const kvs_0 = args_1[2];
331
+ if (!(typeof(contextOrig_0) === 'object' && contextOrig_0.originalState != undefined && contextOrig_0.transactionContext != undefined)) {
332
+ __compactRuntime.type_error('update_target_and_fields',
333
+ 'argument 1 (as invoked from Typescript)',
334
+ 'leaf.compact line 94 char 1',
335
+ 'CircuitContext',
336
+ contextOrig_0)
337
+ }
338
+ if (!(typeof(new_target_0) === 'object' && typeof(new_target_0.is_left) === 'boolean' && typeof(new_target_0.left) === 'object' && new_target_0.left.bytes.buffer instanceof ArrayBuffer && new_target_0.left.bytes.BYTES_PER_ELEMENT === 1 && new_target_0.left.bytes.length === 32 && typeof(new_target_0.right) === 'object' && new_target_0.right.bytes.buffer instanceof ArrayBuffer && new_target_0.right.bytes.BYTES_PER_ELEMENT === 1 && new_target_0.right.bytes.length === 32)) {
339
+ __compactRuntime.type_error('update_target_and_fields',
340
+ 'argument 1 (argument 2 as invoked from Typescript)',
341
+ 'leaf.compact line 94 char 1',
342
+ 'struct Either<is_left: Boolean, left: struct ZswapCoinPublicKey<bytes: Bytes<32>>, right: struct ContractAddress<bytes: Bytes<32>>>',
343
+ new_target_0)
344
+ }
345
+ if (!(Array.isArray(kvs_0) && kvs_0.length === 10 && kvs_0.every((t) => typeof(t) === 'object' && typeof(t.is_some) === 'boolean' && Array.isArray(t.value) && t.value.length === 2 && true && true))) {
346
+ __compactRuntime.type_error('update_target_and_fields',
347
+ 'argument 2 (argument 3 as invoked from Typescript)',
348
+ 'leaf.compact line 94 char 1',
349
+ 'Vector<10, struct Maybe<is_some: Boolean, value: [Opaque<"string">, Opaque<"string">]>>',
350
+ kvs_0)
351
+ }
352
+ const context = { ...contextOrig_0 };
353
+ const partialProofData = {
354
+ input: {
355
+ value: _descriptor_7.toValue(new_target_0).concat(_descriptor_12.toValue(kvs_0)),
356
+ alignment: _descriptor_7.alignment().concat(_descriptor_12.alignment())
357
+ },
358
+ output: undefined,
359
+ publicTranscript: [],
360
+ privateTranscriptOutputs: []
361
+ };
362
+ const result_0 = this._update_target_and_fields_0(context,
363
+ partialProofData,
364
+ new_target_0,
365
+ kvs_0);
366
+ partialProofData.output = { value: [], alignment: [] };
367
+ return { result: result_0, context: context, proofData: partialProofData };
368
+ },
369
+ buy_domain_for: (...args_1) => {
370
+ if (args_1.length !== 5) {
371
+ throw new __compactRuntime.CompactError(`buy_domain_for: expected 5 arguments (as invoked from Typescript), received ${args_1.length}`);
372
+ }
373
+ const contextOrig_0 = args_1[0];
374
+ const owner_0 = args_1[1];
375
+ const domain_0 = args_1[2];
376
+ const resolver_0 = args_1[3];
377
+ const payment_0 = args_1[4];
378
+ if (!(typeof(contextOrig_0) === 'object' && contextOrig_0.originalState != undefined && contextOrig_0.transactionContext != undefined)) {
379
+ __compactRuntime.type_error('buy_domain_for',
380
+ 'argument 1 (as invoked from Typescript)',
381
+ 'leaf.compact line 109 char 1',
382
+ 'CircuitContext',
383
+ contextOrig_0)
384
+ }
385
+ if (!(typeof(owner_0) === 'object' && owner_0.bytes.buffer instanceof ArrayBuffer && owner_0.bytes.BYTES_PER_ELEMENT === 1 && owner_0.bytes.length === 32)) {
386
+ __compactRuntime.type_error('buy_domain_for',
387
+ 'argument 1 (argument 2 as invoked from Typescript)',
388
+ 'leaf.compact line 109 char 1',
389
+ 'struct ZswapCoinPublicKey<bytes: Bytes<32>>',
390
+ owner_0)
391
+ }
392
+ if (!(typeof(resolver_0) === 'object' && resolver_0.bytes.buffer instanceof ArrayBuffer && resolver_0.bytes.BYTES_PER_ELEMENT === 1 && resolver_0.bytes.length === 32)) {
393
+ __compactRuntime.type_error('buy_domain_for',
394
+ 'argument 3 (argument 4 as invoked from Typescript)',
395
+ 'leaf.compact line 109 char 1',
396
+ 'struct ContractAddress<bytes: Bytes<32>>',
397
+ resolver_0)
398
+ }
399
+ if (!(typeof(payment_0) === 'object' && payment_0.nonce.buffer instanceof ArrayBuffer && payment_0.nonce.BYTES_PER_ELEMENT === 1 && payment_0.nonce.length === 32 && payment_0.color.buffer instanceof ArrayBuffer && payment_0.color.BYTES_PER_ELEMENT === 1 && payment_0.color.length === 32 && typeof(payment_0.value) === 'bigint' && payment_0.value >= 0n && payment_0.value <= 340282366920938463463374607431768211455n)) {
400
+ __compactRuntime.type_error('buy_domain_for',
401
+ 'argument 4 (argument 5 as invoked from Typescript)',
402
+ 'leaf.compact line 109 char 1',
403
+ 'struct CoinInfo<nonce: Bytes<32>, color: Bytes<32>, value: Uint<0..340282366920938463463374607431768211455>>',
404
+ payment_0)
405
+ }
406
+ const context = { ...contextOrig_0 };
407
+ const partialProofData = {
408
+ input: {
409
+ value: _descriptor_2.toValue(owner_0).concat(_descriptor_0.toValue(domain_0).concat(_descriptor_3.toValue(resolver_0).concat(_descriptor_9.toValue(payment_0)))),
410
+ alignment: _descriptor_2.alignment().concat(_descriptor_0.alignment().concat(_descriptor_3.alignment().concat(_descriptor_9.alignment())))
411
+ },
412
+ output: undefined,
413
+ publicTranscript: [],
414
+ privateTranscriptOutputs: []
415
+ };
416
+ const result_0 = this._buy_domain_for_0(context,
417
+ partialProofData,
418
+ owner_0,
419
+ domain_0,
420
+ resolver_0,
421
+ payment_0);
422
+ partialProofData.output = { value: [], alignment: [] };
423
+ return { result: result_0, context: context, proofData: partialProofData };
424
+ },
425
+ add_multiple_fields: (...args_1) => {
426
+ if (args_1.length !== 2) {
427
+ throw new __compactRuntime.CompactError(`add_multiple_fields: expected 2 arguments (as invoked from Typescript), received ${args_1.length}`);
428
+ }
429
+ const contextOrig_0 = args_1[0];
430
+ const kvs_0 = args_1[1];
431
+ if (!(typeof(contextOrig_0) === 'object' && contextOrig_0.originalState != undefined && contextOrig_0.transactionContext != undefined)) {
432
+ __compactRuntime.type_error('add_multiple_fields',
433
+ 'argument 1 (as invoked from Typescript)',
434
+ 'leaf.compact line 134 char 1',
435
+ 'CircuitContext',
436
+ contextOrig_0)
437
+ }
438
+ if (!(Array.isArray(kvs_0) && kvs_0.length === 10 && kvs_0.every((t) => typeof(t) === 'object' && typeof(t.is_some) === 'boolean' && Array.isArray(t.value) && t.value.length === 2 && true && true))) {
439
+ __compactRuntime.type_error('add_multiple_fields',
440
+ 'argument 1 (argument 2 as invoked from Typescript)',
441
+ 'leaf.compact line 134 char 1',
442
+ 'Vector<10, struct Maybe<is_some: Boolean, value: [Opaque<"string">, Opaque<"string">]>>',
443
+ kvs_0)
444
+ }
445
+ const context = { ...contextOrig_0 };
446
+ const partialProofData = {
447
+ input: {
448
+ value: _descriptor_12.toValue(kvs_0),
449
+ alignment: _descriptor_12.alignment()
450
+ },
451
+ output: undefined,
452
+ publicTranscript: [],
453
+ privateTranscriptOutputs: []
454
+ };
455
+ const result_0 = this._add_multiple_fields_0(context,
456
+ partialProofData,
457
+ kvs_0);
458
+ partialProofData.output = { value: [], alignment: [] };
459
+ return { result: result_0, context: context, proofData: partialProofData };
460
+ },
461
+ insert_field: (...args_1) => {
462
+ if (args_1.length !== 3) {
463
+ throw new __compactRuntime.CompactError(`insert_field: expected 3 arguments (as invoked from Typescript), received ${args_1.length}`);
464
+ }
465
+ const contextOrig_0 = args_1[0];
466
+ const k_0 = args_1[1];
467
+ const v_0 = args_1[2];
468
+ if (!(typeof(contextOrig_0) === 'object' && contextOrig_0.originalState != undefined && contextOrig_0.transactionContext != undefined)) {
469
+ __compactRuntime.type_error('insert_field',
470
+ 'argument 1 (as invoked from Typescript)',
471
+ 'leaf.compact line 144 char 1',
472
+ 'CircuitContext',
473
+ contextOrig_0)
474
+ }
475
+ const context = { ...contextOrig_0 };
476
+ const partialProofData = {
477
+ input: {
478
+ value: _descriptor_0.toValue(k_0).concat(_descriptor_0.toValue(v_0)),
479
+ alignment: _descriptor_0.alignment().concat(_descriptor_0.alignment())
480
+ },
481
+ output: undefined,
482
+ publicTranscript: [],
483
+ privateTranscriptOutputs: []
484
+ };
485
+ const result_0 = this._insert_field_0(context,
486
+ partialProofData,
487
+ k_0,
488
+ v_0);
489
+ partialProofData.output = { value: [], alignment: [] };
490
+ return { result: result_0, context: context, proofData: partialProofData };
491
+ },
492
+ clear_field: (...args_1) => {
493
+ if (args_1.length !== 2) {
494
+ throw new __compactRuntime.CompactError(`clear_field: expected 2 arguments (as invoked from Typescript), received ${args_1.length}`);
495
+ }
496
+ const contextOrig_0 = args_1[0];
497
+ const k_0 = args_1[1];
498
+ if (!(typeof(contextOrig_0) === 'object' && contextOrig_0.originalState != undefined && contextOrig_0.transactionContext != undefined)) {
499
+ __compactRuntime.type_error('clear_field',
500
+ 'argument 1 (as invoked from Typescript)',
501
+ 'leaf.compact line 149 char 1',
502
+ 'CircuitContext',
503
+ contextOrig_0)
504
+ }
505
+ const context = { ...contextOrig_0 };
506
+ const partialProofData = {
507
+ input: {
508
+ value: _descriptor_0.toValue(k_0),
509
+ alignment: _descriptor_0.alignment()
510
+ },
511
+ output: undefined,
512
+ publicTranscript: [],
513
+ privateTranscriptOutputs: []
514
+ };
515
+ const result_0 = this._clear_field_0(context, partialProofData, k_0);
516
+ partialProofData.output = { value: [], alignment: [] };
517
+ return { result: result_0, context: context, proofData: partialProofData };
518
+ },
519
+ clear_all_fields: (...args_1) => {
520
+ if (args_1.length !== 2) {
521
+ throw new __compactRuntime.CompactError(`clear_all_fields: expected 2 arguments (as invoked from Typescript), received ${args_1.length}`);
522
+ }
523
+ const contextOrig_0 = args_1[0];
524
+ const domain_0 = args_1[1];
525
+ if (!(typeof(contextOrig_0) === 'object' && contextOrig_0.originalState != undefined && contextOrig_0.transactionContext != undefined)) {
526
+ __compactRuntime.type_error('clear_all_fields',
527
+ 'argument 1 (as invoked from Typescript)',
528
+ 'leaf.compact line 154 char 1',
529
+ 'CircuitContext',
530
+ contextOrig_0)
531
+ }
532
+ const context = { ...contextOrig_0 };
533
+ const partialProofData = {
534
+ input: {
535
+ value: _descriptor_0.toValue(domain_0),
536
+ alignment: _descriptor_0.alignment()
537
+ },
538
+ output: undefined,
539
+ publicTranscript: [],
540
+ privateTranscriptOutputs: []
541
+ };
542
+ const result_0 = this._clear_all_fields_0(context,
543
+ partialProofData,
544
+ domain_0);
545
+ partialProofData.output = { value: [], alignment: [] };
546
+ return { result: result_0, context: context, proofData: partialProofData };
547
+ },
548
+ register_domain_for: (...args_1) => {
549
+ if (args_1.length !== 4) {
550
+ throw new __compactRuntime.CompactError(`register_domain_for: expected 4 arguments (as invoked from Typescript), received ${args_1.length}`);
551
+ }
552
+ const contextOrig_0 = args_1[0];
553
+ const owner_0 = args_1[1];
554
+ const domain_0 = args_1[2];
555
+ const resolver_0 = args_1[3];
556
+ if (!(typeof(contextOrig_0) === 'object' && contextOrig_0.originalState != undefined && contextOrig_0.transactionContext != undefined)) {
557
+ __compactRuntime.type_error('register_domain_for',
558
+ 'argument 1 (as invoked from Typescript)',
559
+ 'leaf.compact line 159 char 1',
560
+ 'CircuitContext',
561
+ contextOrig_0)
562
+ }
563
+ if (!(typeof(owner_0) === 'object' && owner_0.bytes.buffer instanceof ArrayBuffer && owner_0.bytes.BYTES_PER_ELEMENT === 1 && owner_0.bytes.length === 32)) {
564
+ __compactRuntime.type_error('register_domain_for',
565
+ 'argument 1 (argument 2 as invoked from Typescript)',
566
+ 'leaf.compact line 159 char 1',
567
+ 'struct ZswapCoinPublicKey<bytes: Bytes<32>>',
568
+ owner_0)
569
+ }
570
+ if (!(typeof(resolver_0) === 'object' && resolver_0.bytes.buffer instanceof ArrayBuffer && resolver_0.bytes.BYTES_PER_ELEMENT === 1 && resolver_0.bytes.length === 32)) {
571
+ __compactRuntime.type_error('register_domain_for',
572
+ 'argument 3 (argument 4 as invoked from Typescript)',
573
+ 'leaf.compact line 159 char 1',
574
+ 'struct ContractAddress<bytes: Bytes<32>>',
575
+ resolver_0)
576
+ }
577
+ const context = { ...contextOrig_0 };
578
+ const partialProofData = {
579
+ input: {
580
+ value: _descriptor_2.toValue(owner_0).concat(_descriptor_0.toValue(domain_0).concat(_descriptor_3.toValue(resolver_0))),
581
+ alignment: _descriptor_2.alignment().concat(_descriptor_0.alignment().concat(_descriptor_3.alignment()))
582
+ },
583
+ output: undefined,
584
+ publicTranscript: [],
585
+ privateTranscriptOutputs: []
586
+ };
587
+ const result_0 = this._register_domain_for_0(context,
588
+ partialProofData,
589
+ owner_0,
590
+ domain_0,
591
+ resolver_0);
592
+ partialProofData.output = { value: [], alignment: [] };
593
+ return { result: result_0, context: context, proofData: partialProofData };
594
+ },
595
+ set_resolver: (...args_1) => {
596
+ if (args_1.length !== 3) {
597
+ throw new __compactRuntime.CompactError(`set_resolver: expected 3 arguments (as invoked from Typescript), received ${args_1.length}`);
598
+ }
599
+ const contextOrig_0 = args_1[0];
600
+ const domain_0 = args_1[1];
601
+ const resolver_0 = args_1[2];
602
+ if (!(typeof(contextOrig_0) === 'object' && contextOrig_0.originalState != undefined && contextOrig_0.transactionContext != undefined)) {
603
+ __compactRuntime.type_error('set_resolver',
604
+ 'argument 1 (as invoked from Typescript)',
605
+ 'leaf.compact line 178 char 1',
606
+ 'CircuitContext',
607
+ contextOrig_0)
608
+ }
609
+ if (!(typeof(resolver_0) === 'object' && resolver_0.bytes.buffer instanceof ArrayBuffer && resolver_0.bytes.BYTES_PER_ELEMENT === 1 && resolver_0.bytes.length === 32)) {
610
+ __compactRuntime.type_error('set_resolver',
611
+ 'argument 2 (argument 3 as invoked from Typescript)',
612
+ 'leaf.compact line 178 char 1',
613
+ 'struct ContractAddress<bytes: Bytes<32>>',
614
+ resolver_0)
615
+ }
616
+ const context = { ...contextOrig_0 };
617
+ const partialProofData = {
618
+ input: {
619
+ value: _descriptor_0.toValue(domain_0).concat(_descriptor_3.toValue(resolver_0)),
620
+ alignment: _descriptor_0.alignment().concat(_descriptor_3.alignment())
621
+ },
622
+ output: undefined,
623
+ publicTranscript: [],
624
+ privateTranscriptOutputs: []
625
+ };
626
+ const result_0 = this._set_resolver_0(context,
627
+ partialProofData,
628
+ domain_0,
629
+ resolver_0);
630
+ partialProofData.output = { value: [], alignment: [] };
631
+ return { result: result_0, context: context, proofData: partialProofData };
632
+ },
633
+ update_domain_target: (...args_1) => {
634
+ if (args_1.length !== 2) {
635
+ throw new __compactRuntime.CompactError(`update_domain_target: expected 2 arguments (as invoked from Typescript), received ${args_1.length}`);
636
+ }
637
+ const contextOrig_0 = args_1[0];
638
+ const new_target_0 = args_1[1];
639
+ if (!(typeof(contextOrig_0) === 'object' && contextOrig_0.originalState != undefined && contextOrig_0.transactionContext != undefined)) {
640
+ __compactRuntime.type_error('update_domain_target',
641
+ 'argument 1 (as invoked from Typescript)',
642
+ 'leaf.compact line 192 char 1',
643
+ 'CircuitContext',
644
+ contextOrig_0)
645
+ }
646
+ if (!(typeof(new_target_0) === 'object' && typeof(new_target_0.is_left) === 'boolean' && typeof(new_target_0.left) === 'object' && new_target_0.left.bytes.buffer instanceof ArrayBuffer && new_target_0.left.bytes.BYTES_PER_ELEMENT === 1 && new_target_0.left.bytes.length === 32 && typeof(new_target_0.right) === 'object' && new_target_0.right.bytes.buffer instanceof ArrayBuffer && new_target_0.right.bytes.BYTES_PER_ELEMENT === 1 && new_target_0.right.bytes.length === 32)) {
647
+ __compactRuntime.type_error('update_domain_target',
648
+ 'argument 1 (argument 2 as invoked from Typescript)',
649
+ 'leaf.compact line 192 char 1',
650
+ 'struct Either<is_left: Boolean, left: struct ZswapCoinPublicKey<bytes: Bytes<32>>, right: struct ContractAddress<bytes: Bytes<32>>>',
651
+ new_target_0)
652
+ }
653
+ const context = { ...contextOrig_0 };
654
+ const partialProofData = {
655
+ input: {
656
+ value: _descriptor_7.toValue(new_target_0),
657
+ alignment: _descriptor_7.alignment()
658
+ },
659
+ output: undefined,
660
+ publicTranscript: [],
661
+ privateTranscriptOutputs: []
662
+ };
663
+ const result_0 = this._update_domain_target_0(context,
664
+ partialProofData,
665
+ new_target_0);
666
+ partialProofData.output = { value: [], alignment: [] };
667
+ return { result: result_0, context: context, proofData: partialProofData };
668
+ },
669
+ transfer_domain: (...args_1) => {
670
+ if (args_1.length !== 3) {
671
+ throw new __compactRuntime.CompactError(`transfer_domain: expected 3 arguments (as invoked from Typescript), received ${args_1.length}`);
672
+ }
673
+ const contextOrig_0 = args_1[0];
674
+ const domain_0 = args_1[1];
675
+ const new_owner_0 = args_1[2];
676
+ if (!(typeof(contextOrig_0) === 'object' && contextOrig_0.originalState != undefined && contextOrig_0.transactionContext != undefined)) {
677
+ __compactRuntime.type_error('transfer_domain',
678
+ 'argument 1 (as invoked from Typescript)',
679
+ 'leaf.compact line 198 char 1',
680
+ 'CircuitContext',
681
+ contextOrig_0)
682
+ }
683
+ if (!(typeof(new_owner_0) === 'object' && new_owner_0.bytes.buffer instanceof ArrayBuffer && new_owner_0.bytes.BYTES_PER_ELEMENT === 1 && new_owner_0.bytes.length === 32)) {
684
+ __compactRuntime.type_error('transfer_domain',
685
+ 'argument 2 (argument 3 as invoked from Typescript)',
686
+ 'leaf.compact line 198 char 1',
687
+ 'struct ZswapCoinPublicKey<bytes: Bytes<32>>',
688
+ new_owner_0)
689
+ }
690
+ const context = { ...contextOrig_0 };
691
+ const partialProofData = {
692
+ input: {
693
+ value: _descriptor_0.toValue(domain_0).concat(_descriptor_2.toValue(new_owner_0)),
694
+ alignment: _descriptor_0.alignment().concat(_descriptor_2.alignment())
695
+ },
696
+ output: undefined,
697
+ publicTranscript: [],
698
+ privateTranscriptOutputs: []
699
+ };
700
+ const result_0 = this._transfer_domain_0(context,
701
+ partialProofData,
702
+ domain_0,
703
+ new_owner_0);
704
+ partialProofData.output = { value: [], alignment: [] };
705
+ return { result: result_0, context: context, proofData: partialProofData };
706
+ },
707
+ change_owner: (...args_1) => {
708
+ if (args_1.length !== 2) {
709
+ throw new __compactRuntime.CompactError(`change_owner: expected 2 arguments (as invoked from Typescript), received ${args_1.length}`);
710
+ }
711
+ const contextOrig_0 = args_1[0];
712
+ const new_owner_0 = args_1[1];
713
+ if (!(typeof(contextOrig_0) === 'object' && contextOrig_0.originalState != undefined && contextOrig_0.transactionContext != undefined)) {
714
+ __compactRuntime.type_error('change_owner',
715
+ 'argument 1 (as invoked from Typescript)',
716
+ 'leaf.compact line 220 char 1',
717
+ 'CircuitContext',
718
+ contextOrig_0)
719
+ }
720
+ if (!(typeof(new_owner_0) === 'object' && new_owner_0.bytes.buffer instanceof ArrayBuffer && new_owner_0.bytes.BYTES_PER_ELEMENT === 1 && new_owner_0.bytes.length === 32)) {
721
+ __compactRuntime.type_error('change_owner',
722
+ 'argument 1 (argument 2 as invoked from Typescript)',
723
+ 'leaf.compact line 220 char 1',
724
+ 'struct ZswapCoinPublicKey<bytes: Bytes<32>>',
725
+ new_owner_0)
726
+ }
727
+ const context = { ...contextOrig_0 };
728
+ const partialProofData = {
729
+ input: {
730
+ value: _descriptor_2.toValue(new_owner_0),
731
+ alignment: _descriptor_2.alignment()
732
+ },
733
+ output: undefined,
734
+ publicTranscript: [],
735
+ privateTranscriptOutputs: []
736
+ };
737
+ const result_0 = this._change_owner_0(context,
738
+ partialProofData,
739
+ new_owner_0);
740
+ partialProofData.output = { value: [], alignment: [] };
741
+ return { result: result_0, context: context, proofData: partialProofData };
742
+ }
743
+ };
744
+ this.impureCircuits = {
745
+ update_color: this.circuits.update_color,
746
+ update_cost: this.circuits.update_cost,
747
+ update_target_and_fields: this.circuits.update_target_and_fields,
748
+ buy_domain_for: this.circuits.buy_domain_for,
749
+ add_multiple_fields: this.circuits.add_multiple_fields,
750
+ insert_field: this.circuits.insert_field,
751
+ clear_field: this.circuits.clear_field,
752
+ clear_all_fields: this.circuits.clear_all_fields,
753
+ register_domain_for: this.circuits.register_domain_for,
754
+ set_resolver: this.circuits.set_resolver,
755
+ update_domain_target: this.circuits.update_domain_target,
756
+ transfer_domain: this.circuits.transfer_domain,
757
+ change_owner: this.circuits.change_owner
758
+ };
759
+ }
760
+ initialState(...args_0) {
761
+ if (args_0.length !== 8) {
762
+ throw new __compactRuntime.CompactError(`Contract state constructor: expected 8 arguments (as invoked from Typescript), received ${args_0.length}`);
763
+ }
764
+ const constructorContext_0 = args_0[0];
765
+ const parent_domain_0 = args_0[1];
766
+ const parent_resolver_0 = args_0[2];
767
+ const target_0 = args_0[3];
768
+ const domain_0 = args_0[4];
769
+ const coin_color_0 = args_0[5];
770
+ const domain_cost_0 = args_0[6];
771
+ const kvs_0 = args_0[7];
772
+ if (typeof(constructorContext_0) !== 'object') {
773
+ throw new __compactRuntime.CompactError(`Contract state constructor: expected 'constructorContext' in argument 1 (as invoked from Typescript) to be an object`);
774
+ }
775
+ if (!('initialZswapLocalState' in constructorContext_0)) {
776
+ throw new __compactRuntime.CompactError(`Contract state constructor: expected 'initialZswapLocalState' in argument 1 (as invoked from Typescript)`);
777
+ }
778
+ if (typeof(constructorContext_0.initialZswapLocalState) !== 'object') {
779
+ throw new __compactRuntime.CompactError(`Contract state constructor: expected 'initialZswapLocalState' in argument 1 (as invoked from Typescript) to be an object`);
780
+ }
781
+ if (!(typeof(parent_domain_0) === 'object' && typeof(parent_domain_0.is_some) === 'boolean' && true)) {
782
+ __compactRuntime.type_error('Contract state constructor',
783
+ 'argument 1 (argument 2 as invoked from Typescript)',
784
+ 'leaf.compact line 53 char 1',
785
+ 'struct Maybe<is_some: Boolean, value: Opaque<"string">>',
786
+ parent_domain_0)
787
+ }
788
+ if (!(typeof(parent_resolver_0) === 'object' && parent_resolver_0.bytes.buffer instanceof ArrayBuffer && parent_resolver_0.bytes.BYTES_PER_ELEMENT === 1 && parent_resolver_0.bytes.length === 32)) {
789
+ __compactRuntime.type_error('Contract state constructor',
790
+ 'argument 2 (argument 3 as invoked from Typescript)',
791
+ 'leaf.compact line 53 char 1',
792
+ 'struct ContractAddress<bytes: Bytes<32>>',
793
+ parent_resolver_0)
794
+ }
795
+ if (!(typeof(target_0) === 'object' && typeof(target_0.is_left) === 'boolean' && typeof(target_0.left) === 'object' && target_0.left.bytes.buffer instanceof ArrayBuffer && target_0.left.bytes.BYTES_PER_ELEMENT === 1 && target_0.left.bytes.length === 32 && typeof(target_0.right) === 'object' && target_0.right.bytes.buffer instanceof ArrayBuffer && target_0.right.bytes.BYTES_PER_ELEMENT === 1 && target_0.right.bytes.length === 32)) {
796
+ __compactRuntime.type_error('Contract state constructor',
797
+ 'argument 3 (argument 4 as invoked from Typescript)',
798
+ 'leaf.compact line 53 char 1',
799
+ 'struct Either<is_left: Boolean, left: struct ZswapCoinPublicKey<bytes: Bytes<32>>, right: struct ContractAddress<bytes: Bytes<32>>>',
800
+ target_0)
801
+ }
802
+ if (!(typeof(domain_0) === 'object' && typeof(domain_0.is_some) === 'boolean' && true)) {
803
+ __compactRuntime.type_error('Contract state constructor',
804
+ 'argument 4 (argument 5 as invoked from Typescript)',
805
+ 'leaf.compact line 53 char 1',
806
+ 'struct Maybe<is_some: Boolean, value: Opaque<"string">>',
807
+ domain_0)
808
+ }
809
+ if (!(coin_color_0.buffer instanceof ArrayBuffer && coin_color_0.BYTES_PER_ELEMENT === 1 && coin_color_0.length === 32)) {
810
+ __compactRuntime.type_error('Contract state constructor',
811
+ 'argument 5 (argument 6 as invoked from Typescript)',
812
+ 'leaf.compact line 53 char 1',
813
+ 'Bytes<32>',
814
+ coin_color_0)
815
+ }
816
+ if (!(typeof(domain_cost_0) === 'bigint' && domain_cost_0 >= 0n && domain_cost_0 <= 18446744073709551615n)) {
817
+ __compactRuntime.type_error('Contract state constructor',
818
+ 'argument 6 (argument 7 as invoked from Typescript)',
819
+ 'leaf.compact line 53 char 1',
820
+ 'Uint<0..18446744073709551615>',
821
+ domain_cost_0)
822
+ }
823
+ if (!(Array.isArray(kvs_0) && kvs_0.length === 10 && kvs_0.every((t) => typeof(t) === 'object' && typeof(t.is_some) === 'boolean' && Array.isArray(t.value) && t.value.length === 2 && true && true))) {
824
+ __compactRuntime.type_error('Contract state constructor',
825
+ 'argument 7 (argument 8 as invoked from Typescript)',
826
+ 'leaf.compact line 53 char 1',
827
+ 'Vector<10, struct Maybe<is_some: Boolean, value: [Opaque<"string">, Opaque<"string">]>>',
828
+ kvs_0)
829
+ }
830
+ const state_0 = new __compactRuntime.ContractState();
831
+ let stateValue_0 = __compactRuntime.StateValue.newArray();
832
+ stateValue_0 = stateValue_0.arrayPush(__compactRuntime.StateValue.newNull());
833
+ stateValue_0 = stateValue_0.arrayPush(__compactRuntime.StateValue.newNull());
834
+ stateValue_0 = stateValue_0.arrayPush(__compactRuntime.StateValue.newNull());
835
+ stateValue_0 = stateValue_0.arrayPush(__compactRuntime.StateValue.newNull());
836
+ stateValue_0 = stateValue_0.arrayPush(__compactRuntime.StateValue.newNull());
837
+ stateValue_0 = stateValue_0.arrayPush(__compactRuntime.StateValue.newNull());
838
+ stateValue_0 = stateValue_0.arrayPush(__compactRuntime.StateValue.newNull());
839
+ stateValue_0 = stateValue_0.arrayPush(__compactRuntime.StateValue.newNull());
840
+ stateValue_0 = stateValue_0.arrayPush(__compactRuntime.StateValue.newNull());
841
+ stateValue_0 = stateValue_0.arrayPush(__compactRuntime.StateValue.newNull());
842
+ state_0.data = stateValue_0;
843
+ state_0.setOperation('update_color', new __compactRuntime.ContractOperation());
844
+ state_0.setOperation('update_cost', new __compactRuntime.ContractOperation());
845
+ state_0.setOperation('update_target_and_fields', new __compactRuntime.ContractOperation());
846
+ state_0.setOperation('buy_domain_for', new __compactRuntime.ContractOperation());
847
+ state_0.setOperation('add_multiple_fields', new __compactRuntime.ContractOperation());
848
+ state_0.setOperation('insert_field', new __compactRuntime.ContractOperation());
849
+ state_0.setOperation('clear_field', new __compactRuntime.ContractOperation());
850
+ state_0.setOperation('clear_all_fields', new __compactRuntime.ContractOperation());
851
+ state_0.setOperation('register_domain_for', new __compactRuntime.ContractOperation());
852
+ state_0.setOperation('set_resolver', new __compactRuntime.ContractOperation());
853
+ state_0.setOperation('update_domain_target', new __compactRuntime.ContractOperation());
854
+ state_0.setOperation('transfer_domain', new __compactRuntime.ContractOperation());
855
+ state_0.setOperation('change_owner', new __compactRuntime.ContractOperation());
856
+ const context = {
857
+ originalState: state_0,
858
+ currentPrivateState: constructorContext_0.initialPrivateState,
859
+ currentZswapLocalState: constructorContext_0.initialZswapLocalState,
860
+ transactionContext: new __compactRuntime.QueryContext(state_0.data, __compactRuntime.dummyContractAddress())
861
+ };
862
+ const partialProofData = {
863
+ input: { value: [], alignment: [] },
864
+ output: undefined,
865
+ publicTranscript: [],
866
+ privateTranscriptOutputs: []
867
+ };
868
+ Contract._query(context,
869
+ partialProofData,
870
+ [
871
+ { push: { storage: false,
872
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_21.toValue(0n),
873
+ alignment: _descriptor_21.alignment() }).encode() } },
874
+ { push: { storage: true,
875
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_20.toValue({ is_some: false, value: '' }),
876
+ alignment: _descriptor_20.alignment() }).encode() } },
877
+ { ins: { cached: false, n: 1 } }]);
878
+ Contract._query(context,
879
+ partialProofData,
880
+ [
881
+ { push: { storage: false,
882
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_21.toValue(1n),
883
+ alignment: _descriptor_21.alignment() }).encode() } },
884
+ { push: { storage: true,
885
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_3.toValue({ bytes: new Uint8Array(32) }),
886
+ alignment: _descriptor_3.alignment() }).encode() } },
887
+ { ins: { cached: false, n: 1 } }]);
888
+ Contract._query(context,
889
+ partialProofData,
890
+ [
891
+ { push: { storage: false,
892
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_21.toValue(2n),
893
+ alignment: _descriptor_21.alignment() }).encode() } },
894
+ { push: { storage: true,
895
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_20.toValue({ is_some: false, value: '' }),
896
+ alignment: _descriptor_20.alignment() }).encode() } },
897
+ { ins: { cached: false, n: 1 } }]);
898
+ Contract._query(context,
899
+ partialProofData,
900
+ [
901
+ { push: { storage: false,
902
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_21.toValue(3n),
903
+ alignment: _descriptor_21.alignment() }).encode() } },
904
+ { push: { storage: true,
905
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_2.toValue({ bytes: new Uint8Array(32) }),
906
+ alignment: _descriptor_2.alignment() }).encode() } },
907
+ { ins: { cached: false, n: 1 } }]);
908
+ Contract._query(context,
909
+ partialProofData,
910
+ [
911
+ { push: { storage: false,
912
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_21.toValue(4n),
913
+ alignment: _descriptor_21.alignment() }).encode() } },
914
+ { push: { storage: true,
915
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_7.toValue({ is_left: false, left: { bytes: new Uint8Array(32) }, right: { bytes: new Uint8Array(32) } }),
916
+ alignment: _descriptor_7.alignment() }).encode() } },
917
+ { ins: { cached: false, n: 1 } }]);
918
+ Contract._query(context,
919
+ partialProofData,
920
+ [
921
+ { push: { storage: false,
922
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_21.toValue(5n),
923
+ alignment: _descriptor_21.alignment() }).encode() } },
924
+ { push: { storage: true,
925
+ value: __compactRuntime.StateValue.newMap(
926
+ new __compactRuntime.StateMap()
927
+ ).encode() } },
928
+ { ins: { cached: false, n: 1 } }]);
929
+ Contract._query(context,
930
+ partialProofData,
931
+ [
932
+ { push: { storage: false,
933
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_21.toValue(6n),
934
+ alignment: _descriptor_21.alignment() }).encode() } },
935
+ { push: { storage: true,
936
+ value: __compactRuntime.StateValue.newMap(
937
+ new __compactRuntime.StateMap()
938
+ ).encode() } },
939
+ { ins: { cached: false, n: 1 } }]);
940
+ Contract._query(context,
941
+ partialProofData,
942
+ [
943
+ { push: { storage: false,
944
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_21.toValue(7n),
945
+ alignment: _descriptor_21.alignment() }).encode() } },
946
+ { push: { storage: true,
947
+ value: __compactRuntime.StateValue.newMap(
948
+ new __compactRuntime.StateMap()
949
+ ).encode() } },
950
+ { ins: { cached: false, n: 1 } }]);
951
+ Contract._query(context,
952
+ partialProofData,
953
+ [
954
+ { push: { storage: false,
955
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_21.toValue(8n),
956
+ alignment: _descriptor_21.alignment() }).encode() } },
957
+ { push: { storage: true,
958
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_1.toValue(new Uint8Array(32)),
959
+ alignment: _descriptor_1.alignment() }).encode() } },
960
+ { ins: { cached: false, n: 1 } }]);
961
+ Contract._query(context,
962
+ partialProofData,
963
+ [
964
+ { push: { storage: false,
965
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_21.toValue(9n),
966
+ alignment: _descriptor_21.alignment() }).encode() } },
967
+ { push: { storage: true,
968
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_6.toValue(0n),
969
+ alignment: _descriptor_6.alignment() }).encode() } },
970
+ { ins: { cached: false, n: 1 } }]);
971
+ const tmp_0 = this._ownPublicKey_0(context, partialProofData);
972
+ Contract._query(context,
973
+ partialProofData,
974
+ [
975
+ { push: { storage: false,
976
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_21.toValue(3n),
977
+ alignment: _descriptor_21.alignment() }).encode() } },
978
+ { push: { storage: true,
979
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_2.toValue(tmp_0),
980
+ alignment: _descriptor_2.alignment() }).encode() } },
981
+ { ins: { cached: false, n: 1 } }]);
982
+ Contract._query(context,
983
+ partialProofData,
984
+ [
985
+ { push: { storage: false,
986
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_21.toValue(0n),
987
+ alignment: _descriptor_21.alignment() }).encode() } },
988
+ { push: { storage: true,
989
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_20.toValue(parent_domain_0),
990
+ alignment: _descriptor_20.alignment() }).encode() } },
991
+ { ins: { cached: false, n: 1 } }]);
992
+ Contract._query(context,
993
+ partialProofData,
994
+ [
995
+ { push: { storage: false,
996
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_21.toValue(1n),
997
+ alignment: _descriptor_21.alignment() }).encode() } },
998
+ { push: { storage: true,
999
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_3.toValue(parent_resolver_0),
1000
+ alignment: _descriptor_3.alignment() }).encode() } },
1001
+ { ins: { cached: false, n: 1 } }]);
1002
+ Contract._query(context,
1003
+ partialProofData,
1004
+ [
1005
+ { push: { storage: false,
1006
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_21.toValue(4n),
1007
+ alignment: _descriptor_21.alignment() }).encode() } },
1008
+ { push: { storage: true,
1009
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_7.toValue(target_0),
1010
+ alignment: _descriptor_7.alignment() }).encode() } },
1011
+ { ins: { cached: false, n: 1 } }]);
1012
+ Contract._query(context,
1013
+ partialProofData,
1014
+ [
1015
+ { push: { storage: false,
1016
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_21.toValue(2n),
1017
+ alignment: _descriptor_21.alignment() }).encode() } },
1018
+ { push: { storage: true,
1019
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_20.toValue(domain_0),
1020
+ alignment: _descriptor_20.alignment() }).encode() } },
1021
+ { ins: { cached: false, n: 1 } }]);
1022
+ Contract._query(context,
1023
+ partialProofData,
1024
+ [
1025
+ { push: { storage: false,
1026
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_21.toValue(8n),
1027
+ alignment: _descriptor_21.alignment() }).encode() } },
1028
+ { push: { storage: true,
1029
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_1.toValue(coin_color_0),
1030
+ alignment: _descriptor_1.alignment() }).encode() } },
1031
+ { ins: { cached: false, n: 1 } }]);
1032
+ Contract._query(context,
1033
+ partialProofData,
1034
+ [
1035
+ { push: { storage: false,
1036
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_21.toValue(9n),
1037
+ alignment: _descriptor_21.alignment() }).encode() } },
1038
+ { push: { storage: true,
1039
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_6.toValue(domain_cost_0),
1040
+ alignment: _descriptor_6.alignment() }).encode() } },
1041
+ { ins: { cached: false, n: 1 } }]);
1042
+ this._folder_0(context,
1043
+ partialProofData,
1044
+ ((context, partialProofData, t_0, kv_0) =>
1045
+ {
1046
+ if (this._equal_0(kv_0, this._none_1())) {
1047
+ } else {
1048
+ const tmp_1 = kv_0.value[0];
1049
+ const tmp_2 = kv_0.value[1];
1050
+ Contract._query(context,
1051
+ partialProofData,
1052
+ [
1053
+ { idx: { cached: false,
1054
+ pushPath: true,
1055
+ path: [
1056
+ { tag: 'value',
1057
+ value: { value: _descriptor_21.toValue(7n),
1058
+ alignment: _descriptor_21.alignment() } }] } },
1059
+ { push: { storage: false,
1060
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_0.toValue(tmp_1),
1061
+ alignment: _descriptor_0.alignment() }).encode() } },
1062
+ { push: { storage: true,
1063
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_0.toValue(tmp_2),
1064
+ alignment: _descriptor_0.alignment() }).encode() } },
1065
+ { ins: { cached: false, n: 1 } },
1066
+ { ins: { cached: true, n: 1 } }]);
1067
+ }
1068
+ return t_0;
1069
+ }),
1070
+ [],
1071
+ kvs_0);
1072
+ state_0.data = context.transactionContext.state;
1073
+ return {
1074
+ currentContractState: state_0,
1075
+ currentPrivateState: context.currentPrivateState,
1076
+ currentZswapLocalState: context.currentZswapLocalState
1077
+ }
1078
+ }
1079
+ _some_0(value_0) { return { is_some: true, value: value_0 }; }
1080
+ _none_0() {
1081
+ return { is_some: false,
1082
+ value:
1083
+ { nonce: new Uint8Array(32), color: new Uint8Array(32), value: 0n } };
1084
+ }
1085
+ _none_1() { return { is_some: false, value: ['', ''] }; }
1086
+ _left_0(value_0) {
1087
+ return { is_left: true, left: value_0, right: { bytes: new Uint8Array(32) } };
1088
+ }
1089
+ _right_0(value_0) {
1090
+ return { is_left: false, left: { bytes: new Uint8Array(32) }, right: value_0 };
1091
+ }
1092
+ _transientHash_0(value_0) {
1093
+ const result_0 = __compactRuntime.transientHash(_descriptor_19, value_0);
1094
+ return result_0;
1095
+ }
1096
+ _persistentHash_0(value_0) {
1097
+ const result_0 = __compactRuntime.persistentHash(_descriptor_18, value_0);
1098
+ return result_0;
1099
+ }
1100
+ _degradeToTransient_0(x_0) {
1101
+ const result_0 = __compactRuntime.degradeToTransient(x_0);
1102
+ return result_0;
1103
+ }
1104
+ _upgradeFromTransient_0(x_0) {
1105
+ const result_0 = __compactRuntime.upgradeFromTransient(x_0);
1106
+ return result_0;
1107
+ }
1108
+ _ownPublicKey_0(context, partialProofData) {
1109
+ const result_0 = __compactRuntime.ownPublicKey(context);
1110
+ partialProofData.privateTranscriptOutputs.push({
1111
+ value: _descriptor_2.toValue(result_0),
1112
+ alignment: _descriptor_2.alignment()
1113
+ });
1114
+ return result_0;
1115
+ }
1116
+ _createZswapInput_0(context, partialProofData, coin_0) {
1117
+ const result_0 = __compactRuntime.createZswapInput(context, coin_0);
1118
+ partialProofData.privateTranscriptOutputs.push({
1119
+ value: [],
1120
+ alignment: []
1121
+ });
1122
+ return result_0;
1123
+ }
1124
+ _createZswapOutput_0(context, partialProofData, coin_0, recipient_0) {
1125
+ const result_0 = __compactRuntime.createZswapOutput(context,
1126
+ coin_0,
1127
+ recipient_0);
1128
+ partialProofData.privateTranscriptOutputs.push({
1129
+ value: [],
1130
+ alignment: []
1131
+ });
1132
+ return result_0;
1133
+ }
1134
+ _receive_0(context, partialProofData, coin_0) {
1135
+ const recipient_0 = this._right_0(_descriptor_3.fromValue(Contract._query(context,
1136
+ partialProofData,
1137
+ [
1138
+ { dup: { n: 2 } },
1139
+ { idx: { cached: true,
1140
+ pushPath: false,
1141
+ path: [
1142
+ { tag: 'value',
1143
+ value: { value: _descriptor_21.toValue(0n),
1144
+ alignment: _descriptor_21.alignment() } }] } },
1145
+ { popeq: { cached: true,
1146
+ result: undefined } }]).value));
1147
+ this._createZswapOutput_0(context, partialProofData, coin_0, recipient_0);
1148
+ const tmp_0 = this._coinCommitment_0(coin_0, recipient_0);
1149
+ Contract._query(context,
1150
+ partialProofData,
1151
+ [
1152
+ { swap: { n: 0 } },
1153
+ { idx: { cached: true,
1154
+ pushPath: true,
1155
+ path: [
1156
+ { tag: 'value',
1157
+ value: { value: _descriptor_21.toValue(1n),
1158
+ alignment: _descriptor_21.alignment() } }] } },
1159
+ { push: { storage: false,
1160
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_1.toValue(tmp_0),
1161
+ alignment: _descriptor_1.alignment() }).encode() } },
1162
+ { push: { storage: false,
1163
+ value: __compactRuntime.StateValue.newNull().encode() } },
1164
+ { ins: { cached: true, n: 2 } },
1165
+ { swap: { n: 0 } }]);
1166
+ return [];
1167
+ }
1168
+ _send_0(context, partialProofData, input_0, recipient_0, value_0) {
1169
+ const selfAddr_0 = _descriptor_3.fromValue(Contract._query(context,
1170
+ partialProofData,
1171
+ [
1172
+ { dup: { n: 2 } },
1173
+ { idx: { cached: true,
1174
+ pushPath: false,
1175
+ path: [
1176
+ { tag: 'value',
1177
+ value: { value: _descriptor_21.toValue(0n),
1178
+ alignment: _descriptor_21.alignment() } }] } },
1179
+ { popeq: { cached: true,
1180
+ result: undefined } }]).value);
1181
+ this._createZswapInput_0(context, partialProofData, input_0);
1182
+ const tmp_0 = this._coinNullifier_0(this._downcastQualifiedCoin_0(input_0),
1183
+ selfAddr_0);
1184
+ Contract._query(context,
1185
+ partialProofData,
1186
+ [
1187
+ { swap: { n: 0 } },
1188
+ { idx: { cached: true,
1189
+ pushPath: true,
1190
+ path: [
1191
+ { tag: 'value',
1192
+ value: { value: _descriptor_21.toValue(0n),
1193
+ alignment: _descriptor_21.alignment() } }] } },
1194
+ { push: { storage: false,
1195
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_1.toValue(tmp_0),
1196
+ alignment: _descriptor_1.alignment() }).encode() } },
1197
+ { push: { storage: false,
1198
+ value: __compactRuntime.StateValue.newNull().encode() } },
1199
+ { ins: { cached: true, n: 2 } },
1200
+ { swap: { n: 0 } }]);
1201
+ let t_0;
1202
+ const change_0 = (t_0 = input_0.value,
1203
+ (__compactRuntime.assert(!(t_0 < value_0),
1204
+ 'result of subtraction would be negative'),
1205
+ t_0 - value_0));
1206
+ const output_0 = { nonce:
1207
+ this._upgradeFromTransient_0(this._transientHash_0([__compactRuntime.convert_Uint8Array_to_bigint(28,
1208
+ new Uint8Array([109, 105, 100, 110, 105, 103, 104, 116, 58, 107, 101, 114, 110, 101, 108, 58, 110, 111, 110, 99, 101, 95, 101, 118, 111, 108, 118, 101])),
1209
+ this._degradeToTransient_0(input_0.nonce)])),
1210
+ color: input_0.color,
1211
+ value: value_0 };
1212
+ this._createZswapOutput_0(context, partialProofData, output_0, recipient_0);
1213
+ const tmp_1 = this._coinCommitment_0(output_0, recipient_0);
1214
+ Contract._query(context,
1215
+ partialProofData,
1216
+ [
1217
+ { swap: { n: 0 } },
1218
+ { idx: { cached: true,
1219
+ pushPath: true,
1220
+ path: [
1221
+ { tag: 'value',
1222
+ value: { value: _descriptor_21.toValue(2n),
1223
+ alignment: _descriptor_21.alignment() } }] } },
1224
+ { push: { storage: false,
1225
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_1.toValue(tmp_1),
1226
+ alignment: _descriptor_1.alignment() }).encode() } },
1227
+ { push: { storage: false,
1228
+ value: __compactRuntime.StateValue.newNull().encode() } },
1229
+ { ins: { cached: true, n: 2 } },
1230
+ { swap: { n: 0 } }]);
1231
+ if (this._equal_1(change_0, 0n)) {
1232
+ return { change: this._none_0(), sent: output_0 };
1233
+ } else {
1234
+ const changeCoin_0 = { nonce:
1235
+ this._upgradeFromTransient_0(this._transientHash_0([__compactRuntime.convert_Uint8Array_to_bigint(30,
1236
+ new Uint8Array([109, 105, 100, 110, 105, 103, 104, 116, 58, 107, 101, 114, 110, 101, 108, 58, 110, 111, 110, 99, 101, 95, 101, 118, 111, 108, 118, 101, 47, 50])),
1237
+ this._degradeToTransient_0(input_0.nonce)])),
1238
+ color: input_0.color,
1239
+ value: change_0 };
1240
+ this._createZswapOutput_0(context,
1241
+ partialProofData,
1242
+ changeCoin_0,
1243
+ this._right_0(selfAddr_0));
1244
+ const cm_0 = this._coinCommitment_0(changeCoin_0,
1245
+ this._right_0(selfAddr_0));
1246
+ Contract._query(context,
1247
+ partialProofData,
1248
+ [
1249
+ { swap: { n: 0 } },
1250
+ { idx: { cached: true,
1251
+ pushPath: true,
1252
+ path: [
1253
+ { tag: 'value',
1254
+ value: { value: _descriptor_21.toValue(2n),
1255
+ alignment: _descriptor_21.alignment() } }] } },
1256
+ { push: { storage: false,
1257
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_1.toValue(cm_0),
1258
+ alignment: _descriptor_1.alignment() }).encode() } },
1259
+ { push: { storage: false,
1260
+ value: __compactRuntime.StateValue.newNull().encode() } },
1261
+ { ins: { cached: true, n: 2 } },
1262
+ { swap: { n: 0 } }]);
1263
+ Contract._query(context,
1264
+ partialProofData,
1265
+ [
1266
+ { swap: { n: 0 } },
1267
+ { idx: { cached: true,
1268
+ pushPath: true,
1269
+ path: [
1270
+ { tag: 'value',
1271
+ value: { value: _descriptor_21.toValue(1n),
1272
+ alignment: _descriptor_21.alignment() } }] } },
1273
+ { push: { storage: false,
1274
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_1.toValue(cm_0),
1275
+ alignment: _descriptor_1.alignment() }).encode() } },
1276
+ { push: { storage: false,
1277
+ value: __compactRuntime.StateValue.newNull().encode() } },
1278
+ { ins: { cached: true, n: 2 } },
1279
+ { swap: { n: 0 } }]);
1280
+ return { change: this._some_0(changeCoin_0), sent: output_0 };
1281
+ }
1282
+ }
1283
+ _sendImmediate_0(context, partialProofData, input_0, target_0, value_0) {
1284
+ return this._send_0(context,
1285
+ partialProofData,
1286
+ this._upcastQualifiedCoin_0(input_0),
1287
+ target_0,
1288
+ value_0);
1289
+ }
1290
+ _downcastQualifiedCoin_0(coin_0) {
1291
+ return { nonce: coin_0.nonce, color: coin_0.color, value: coin_0.value };
1292
+ }
1293
+ _upcastQualifiedCoin_0(coin_0) {
1294
+ return { nonce: coin_0.nonce,
1295
+ color: coin_0.color,
1296
+ value: coin_0.value,
1297
+ mt_index: 0n };
1298
+ }
1299
+ _coinCommitment_0(coin_0, recipient_0) {
1300
+ return this._persistentHash_0({ info: coin_0,
1301
+ dataType: recipient_0.is_left,
1302
+ data:
1303
+ recipient_0.is_left ?
1304
+ recipient_0.left.bytes :
1305
+ recipient_0.right.bytes,
1306
+ domain_sep:
1307
+ new Uint8Array([109, 100, 110, 58, 99, 99]) });
1308
+ }
1309
+ _coinNullifier_0(coin_0, addr_0) {
1310
+ return this._persistentHash_0({ info: coin_0,
1311
+ dataType: false,
1312
+ data: addr_0.bytes,
1313
+ domain_sep:
1314
+ new Uint8Array([109, 100, 110, 58, 99, 110]) });
1315
+ }
1316
+ _update_color_0(context, partialProofData, c_0) {
1317
+ __compactRuntime.assert(this._equal_2(_descriptor_2.fromValue(Contract._query(context,
1318
+ partialProofData,
1319
+ [
1320
+ { dup: { n: 0 } },
1321
+ { idx: { cached: false,
1322
+ pushPath: false,
1323
+ path: [
1324
+ { tag: 'value',
1325
+ value: { value: _descriptor_21.toValue(3n),
1326
+ alignment: _descriptor_21.alignment() } }] } },
1327
+ { popeq: { cached: false,
1328
+ result: undefined } }]).value),
1329
+ this._ownPublicKey_0(context,
1330
+ partialProofData)),
1331
+ 'Not the owner');
1332
+ Contract._query(context,
1333
+ partialProofData,
1334
+ [
1335
+ { push: { storage: false,
1336
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_21.toValue(8n),
1337
+ alignment: _descriptor_21.alignment() }).encode() } },
1338
+ { push: { storage: true,
1339
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_1.toValue(c_0),
1340
+ alignment: _descriptor_1.alignment() }).encode() } },
1341
+ { ins: { cached: false, n: 1 } }]);
1342
+ return [];
1343
+ }
1344
+ _update_cost_0(context, partialProofData, c_0) {
1345
+ __compactRuntime.assert(this._equal_3(_descriptor_2.fromValue(Contract._query(context,
1346
+ partialProofData,
1347
+ [
1348
+ { dup: { n: 0 } },
1349
+ { idx: { cached: false,
1350
+ pushPath: false,
1351
+ path: [
1352
+ { tag: 'value',
1353
+ value: { value: _descriptor_21.toValue(3n),
1354
+ alignment: _descriptor_21.alignment() } }] } },
1355
+ { popeq: { cached: false,
1356
+ result: undefined } }]).value),
1357
+ this._ownPublicKey_0(context,
1358
+ partialProofData)),
1359
+ 'Not the owner');
1360
+ Contract._query(context,
1361
+ partialProofData,
1362
+ [
1363
+ { push: { storage: false,
1364
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_21.toValue(9n),
1365
+ alignment: _descriptor_21.alignment() }).encode() } },
1366
+ { push: { storage: true,
1367
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_6.toValue(c_0),
1368
+ alignment: _descriptor_6.alignment() }).encode() } },
1369
+ { ins: { cached: false, n: 1 } }]);
1370
+ return [];
1371
+ }
1372
+ _update_target_and_fields_0(context, partialProofData, new_target_0, kvs_0) {
1373
+ __compactRuntime.assert(this._equal_4(_descriptor_2.fromValue(Contract._query(context,
1374
+ partialProofData,
1375
+ [
1376
+ { dup: { n: 0 } },
1377
+ { idx: { cached: false,
1378
+ pushPath: false,
1379
+ path: [
1380
+ { tag: 'value',
1381
+ value: { value: _descriptor_21.toValue(3n),
1382
+ alignment: _descriptor_21.alignment() } }] } },
1383
+ { popeq: { cached: false,
1384
+ result: undefined } }]).value),
1385
+ this._ownPublicKey_0(context,
1386
+ partialProofData)),
1387
+ 'Not the domain owner');
1388
+ this._folder_1(context,
1389
+ partialProofData,
1390
+ ((context, partialProofData, t_0, kv_0) =>
1391
+ {
1392
+ if (this._equal_5(kv_0, this._none_1())) {
1393
+ } else {
1394
+ const tmp_0 = kv_0.value[0];
1395
+ const tmp_1 = kv_0.value[1];
1396
+ Contract._query(context,
1397
+ partialProofData,
1398
+ [
1399
+ { idx: { cached: false,
1400
+ pushPath: true,
1401
+ path: [
1402
+ { tag: 'value',
1403
+ value: { value: _descriptor_21.toValue(7n),
1404
+ alignment: _descriptor_21.alignment() } }] } },
1405
+ { push: { storage: false,
1406
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_0.toValue(tmp_0),
1407
+ alignment: _descriptor_0.alignment() }).encode() } },
1408
+ { push: { storage: true,
1409
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_0.toValue(tmp_1),
1410
+ alignment: _descriptor_0.alignment() }).encode() } },
1411
+ { ins: { cached: false, n: 1 } },
1412
+ { ins: { cached: true, n: 1 } }]);
1413
+ }
1414
+ return t_0;
1415
+ }),
1416
+ [],
1417
+ kvs_0);
1418
+ Contract._query(context,
1419
+ partialProofData,
1420
+ [
1421
+ { push: { storage: false,
1422
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_21.toValue(4n),
1423
+ alignment: _descriptor_21.alignment() }).encode() } },
1424
+ { push: { storage: true,
1425
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_7.toValue(new_target_0),
1426
+ alignment: _descriptor_7.alignment() }).encode() } },
1427
+ { ins: { cached: false, n: 1 } }]);
1428
+ return [];
1429
+ }
1430
+ _buy_domain_for_0(context,
1431
+ partialProofData,
1432
+ owner_0,
1433
+ domain_0,
1434
+ resolver_0,
1435
+ payment_0)
1436
+ {
1437
+ __compactRuntime.assert(!_descriptor_5.fromValue(Contract._query(context,
1438
+ partialProofData,
1439
+ [
1440
+ { dup: { n: 0 } },
1441
+ { idx: { cached: false,
1442
+ pushPath: false,
1443
+ path: [
1444
+ { tag: 'value',
1445
+ value: { value: _descriptor_21.toValue(5n),
1446
+ alignment: _descriptor_21.alignment() } }] } },
1447
+ { push: { storage: false,
1448
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_0.toValue(domain_0),
1449
+ alignment: _descriptor_0.alignment() }).encode() } },
1450
+ 'member',
1451
+ { popeq: { cached: true,
1452
+ result: undefined } }]).value),
1453
+ 'Domain already exists');
1454
+ const d_payment_0 = payment_0;
1455
+ __compactRuntime.assert(this._equal_6(d_payment_0.value,
1456
+ _descriptor_6.fromValue(Contract._query(context,
1457
+ partialProofData,
1458
+ [
1459
+ { dup: { n: 0 } },
1460
+ { idx: { cached: false,
1461
+ pushPath: false,
1462
+ path: [
1463
+ { tag: 'value',
1464
+ value: { value: _descriptor_21.toValue(9n),
1465
+ alignment: _descriptor_21.alignment() } }] } },
1466
+ { popeq: { cached: false,
1467
+ result: undefined } }]).value)),
1468
+ 'Wrong amount');
1469
+ __compactRuntime.assert(this._equal_7(d_payment_0.color,
1470
+ _descriptor_1.fromValue(Contract._query(context,
1471
+ partialProofData,
1472
+ [
1473
+ { dup: { n: 0 } },
1474
+ { idx: { cached: false,
1475
+ pushPath: false,
1476
+ path: [
1477
+ { tag: 'value',
1478
+ value: { value: _descriptor_21.toValue(8n),
1479
+ alignment: _descriptor_21.alignment() } }] } },
1480
+ { popeq: { cached: false,
1481
+ result: undefined } }]).value)),
1482
+ 'Wrong coin');
1483
+ this._receive_0(context, partialProofData, d_payment_0);
1484
+ this._sendImmediate_0(context,
1485
+ partialProofData,
1486
+ d_payment_0,
1487
+ this._left_0(_descriptor_2.fromValue(Contract._query(context,
1488
+ partialProofData,
1489
+ [
1490
+ { dup: { n: 0 } },
1491
+ { idx: { cached: false,
1492
+ pushPath: false,
1493
+ path: [
1494
+ { tag: 'value',
1495
+ value: { value: _descriptor_21.toValue(3n),
1496
+ alignment: _descriptor_21.alignment() } }] } },
1497
+ { popeq: { cached: false,
1498
+ result: undefined } }]).value)),
1499
+ _descriptor_6.fromValue(Contract._query(context,
1500
+ partialProofData,
1501
+ [
1502
+ { dup: { n: 0 } },
1503
+ { idx: { cached: false,
1504
+ pushPath: false,
1505
+ path: [
1506
+ { tag: 'value',
1507
+ value: { value: _descriptor_21.toValue(9n),
1508
+ alignment: _descriptor_21.alignment() } }] } },
1509
+ { popeq: { cached: false,
1510
+ result: undefined } }]).value));
1511
+ const d_owner_0 = owner_0;
1512
+ const domain_data_0 = { owner: d_owner_0, resolver: resolver_0 };
1513
+ Contract._query(context,
1514
+ partialProofData,
1515
+ [
1516
+ { idx: { cached: false,
1517
+ pushPath: true,
1518
+ path: [
1519
+ { tag: 'value',
1520
+ value: { value: _descriptor_21.toValue(5n),
1521
+ alignment: _descriptor_21.alignment() } }] } },
1522
+ { push: { storage: false,
1523
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_0.toValue(domain_0),
1524
+ alignment: _descriptor_0.alignment() }).encode() } },
1525
+ { push: { storage: true,
1526
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_4.toValue(domain_data_0),
1527
+ alignment: _descriptor_4.alignment() }).encode() } },
1528
+ { ins: { cached: false, n: 1 } },
1529
+ { ins: { cached: true, n: 1 } }]);
1530
+ if (!_descriptor_5.fromValue(Contract._query(context,
1531
+ partialProofData,
1532
+ [
1533
+ { dup: { n: 0 } },
1534
+ { idx: { cached: false,
1535
+ pushPath: false,
1536
+ path: [
1537
+ { tag: 'value',
1538
+ value: { value: _descriptor_21.toValue(6n),
1539
+ alignment: _descriptor_21.alignment() } }] } },
1540
+ { push: { storage: false,
1541
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_2.toValue(d_owner_0),
1542
+ alignment: _descriptor_2.alignment() }).encode() } },
1543
+ 'member',
1544
+ { popeq: { cached: true,
1545
+ result: undefined } }]).value))
1546
+ {
1547
+ Contract._query(context,
1548
+ partialProofData,
1549
+ [
1550
+ { idx: { cached: false,
1551
+ pushPath: true,
1552
+ path: [
1553
+ { tag: 'value',
1554
+ value: { value: _descriptor_21.toValue(6n),
1555
+ alignment: _descriptor_21.alignment() } }] } },
1556
+ { push: { storage: false,
1557
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_2.toValue(d_owner_0),
1558
+ alignment: _descriptor_2.alignment() }).encode() } },
1559
+ { push: { storage: true,
1560
+ value: __compactRuntime.StateValue.newMap(
1561
+ new __compactRuntime.StateMap()
1562
+ ).encode() } },
1563
+ { ins: { cached: false, n: 1 } },
1564
+ { ins: { cached: true, n: 1 } }]);
1565
+ }
1566
+ Contract._query(context,
1567
+ partialProofData,
1568
+ [
1569
+ { idx: { cached: false,
1570
+ pushPath: true,
1571
+ path: [
1572
+ { tag: 'value',
1573
+ value: { value: _descriptor_21.toValue(6n),
1574
+ alignment: _descriptor_21.alignment() } },
1575
+ { tag: 'value',
1576
+ value: { value: _descriptor_2.toValue(d_owner_0),
1577
+ alignment: _descriptor_2.alignment() } }] } },
1578
+ { push: { storage: false,
1579
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_0.toValue(domain_0),
1580
+ alignment: _descriptor_0.alignment() }).encode() } },
1581
+ { push: { storage: true,
1582
+ value: __compactRuntime.StateValue.newNull().encode() } },
1583
+ { ins: { cached: false, n: 1 } },
1584
+ { ins: { cached: true, n: 2 } }]);
1585
+ return [];
1586
+ }
1587
+ _add_multiple_fields_0(context, partialProofData, kvs_0) {
1588
+ __compactRuntime.assert(this._equal_8(_descriptor_2.fromValue(Contract._query(context,
1589
+ partialProofData,
1590
+ [
1591
+ { dup: { n: 0 } },
1592
+ { idx: { cached: false,
1593
+ pushPath: false,
1594
+ path: [
1595
+ { tag: 'value',
1596
+ value: { value: _descriptor_21.toValue(3n),
1597
+ alignment: _descriptor_21.alignment() } }] } },
1598
+ { popeq: { cached: false,
1599
+ result: undefined } }]).value),
1600
+ this._ownPublicKey_0(context,
1601
+ partialProofData)),
1602
+ 'Not the domain owner');
1603
+ this._folder_2(context,
1604
+ partialProofData,
1605
+ ((context, partialProofData, t_0, kv_0) =>
1606
+ {
1607
+ if (this._equal_9(kv_0, this._none_1())) {
1608
+ } else {
1609
+ const tmp_0 = kv_0.value[0];
1610
+ const tmp_1 = kv_0.value[1];
1611
+ Contract._query(context,
1612
+ partialProofData,
1613
+ [
1614
+ { idx: { cached: false,
1615
+ pushPath: true,
1616
+ path: [
1617
+ { tag: 'value',
1618
+ value: { value: _descriptor_21.toValue(7n),
1619
+ alignment: _descriptor_21.alignment() } }] } },
1620
+ { push: { storage: false,
1621
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_0.toValue(tmp_0),
1622
+ alignment: _descriptor_0.alignment() }).encode() } },
1623
+ { push: { storage: true,
1624
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_0.toValue(tmp_1),
1625
+ alignment: _descriptor_0.alignment() }).encode() } },
1626
+ { ins: { cached: false, n: 1 } },
1627
+ { ins: { cached: true, n: 1 } }]);
1628
+ }
1629
+ return t_0;
1630
+ }),
1631
+ [],
1632
+ kvs_0);
1633
+ return [];
1634
+ }
1635
+ _insert_field_0(context, partialProofData, k_0, v_0) {
1636
+ __compactRuntime.assert(this._equal_10(_descriptor_2.fromValue(Contract._query(context,
1637
+ partialProofData,
1638
+ [
1639
+ { dup: { n: 0 } },
1640
+ { idx: { cached: false,
1641
+ pushPath: false,
1642
+ path: [
1643
+ { tag: 'value',
1644
+ value: { value: _descriptor_21.toValue(3n),
1645
+ alignment: _descriptor_21.alignment() } }] } },
1646
+ { popeq: { cached: false,
1647
+ result: undefined } }]).value),
1648
+ this._ownPublicKey_0(context,
1649
+ partialProofData)),
1650
+ 'Not the domain owner');
1651
+ Contract._query(context,
1652
+ partialProofData,
1653
+ [
1654
+ { idx: { cached: false,
1655
+ pushPath: true,
1656
+ path: [
1657
+ { tag: 'value',
1658
+ value: { value: _descriptor_21.toValue(7n),
1659
+ alignment: _descriptor_21.alignment() } }] } },
1660
+ { push: { storage: false,
1661
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_0.toValue(k_0),
1662
+ alignment: _descriptor_0.alignment() }).encode() } },
1663
+ { push: { storage: true,
1664
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_0.toValue(v_0),
1665
+ alignment: _descriptor_0.alignment() }).encode() } },
1666
+ { ins: { cached: false, n: 1 } },
1667
+ { ins: { cached: true, n: 1 } }]);
1668
+ return [];
1669
+ }
1670
+ _clear_field_0(context, partialProofData, k_0) {
1671
+ __compactRuntime.assert(this._equal_11(_descriptor_2.fromValue(Contract._query(context,
1672
+ partialProofData,
1673
+ [
1674
+ { dup: { n: 0 } },
1675
+ { idx: { cached: false,
1676
+ pushPath: false,
1677
+ path: [
1678
+ { tag: 'value',
1679
+ value: { value: _descriptor_21.toValue(3n),
1680
+ alignment: _descriptor_21.alignment() } }] } },
1681
+ { popeq: { cached: false,
1682
+ result: undefined } }]).value),
1683
+ this._ownPublicKey_0(context,
1684
+ partialProofData)),
1685
+ 'Not the domain owner');
1686
+ Contract._query(context,
1687
+ partialProofData,
1688
+ [
1689
+ { idx: { cached: false,
1690
+ pushPath: true,
1691
+ path: [
1692
+ { tag: 'value',
1693
+ value: { value: _descriptor_21.toValue(7n),
1694
+ alignment: _descriptor_21.alignment() } }] } },
1695
+ { push: { storage: false,
1696
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_0.toValue(k_0),
1697
+ alignment: _descriptor_0.alignment() }).encode() } },
1698
+ { rem: { cached: false } },
1699
+ { ins: { cached: true, n: 1 } }]);
1700
+ return [];
1701
+ }
1702
+ _clear_all_fields_0(context, partialProofData, domain_0) {
1703
+ __compactRuntime.assert(this._equal_12(_descriptor_2.fromValue(Contract._query(context,
1704
+ partialProofData,
1705
+ [
1706
+ { dup: { n: 0 } },
1707
+ { idx: { cached: false,
1708
+ pushPath: false,
1709
+ path: [
1710
+ { tag: 'value',
1711
+ value: { value: _descriptor_21.toValue(3n),
1712
+ alignment: _descriptor_21.alignment() } }] } },
1713
+ { popeq: { cached: false,
1714
+ result: undefined } }]).value),
1715
+ this._ownPublicKey_0(context,
1716
+ partialProofData)),
1717
+ 'Not the domain owner');
1718
+ Contract._query(context,
1719
+ partialProofData,
1720
+ [
1721
+ { push: { storage: false,
1722
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_21.toValue(7n),
1723
+ alignment: _descriptor_21.alignment() }).encode() } },
1724
+ { push: { storage: true,
1725
+ value: __compactRuntime.StateValue.newMap(
1726
+ new __compactRuntime.StateMap()
1727
+ ).encode() } },
1728
+ { ins: { cached: false, n: 1 } }]);
1729
+ return [];
1730
+ }
1731
+ _register_domain_for_0(context,
1732
+ partialProofData,
1733
+ owner_0,
1734
+ domain_0,
1735
+ resolver_0)
1736
+ {
1737
+ __compactRuntime.assert(!_descriptor_5.fromValue(Contract._query(context,
1738
+ partialProofData,
1739
+ [
1740
+ { dup: { n: 0 } },
1741
+ { idx: { cached: false,
1742
+ pushPath: false,
1743
+ path: [
1744
+ { tag: 'value',
1745
+ value: { value: _descriptor_21.toValue(5n),
1746
+ alignment: _descriptor_21.alignment() } }] } },
1747
+ { push: { storage: false,
1748
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_0.toValue(domain_0),
1749
+ alignment: _descriptor_0.alignment() }).encode() } },
1750
+ 'member',
1751
+ { popeq: { cached: true,
1752
+ result: undefined } }]).value),
1753
+ 'Domain already exists');
1754
+ __compactRuntime.assert(this._equal_13(_descriptor_2.fromValue(Contract._query(context,
1755
+ partialProofData,
1756
+ [
1757
+ { dup: { n: 0 } },
1758
+ { idx: { cached: false,
1759
+ pushPath: false,
1760
+ path: [
1761
+ { tag: 'value',
1762
+ value: { value: _descriptor_21.toValue(3n),
1763
+ alignment: _descriptor_21.alignment() } }] } },
1764
+ { popeq: { cached: false,
1765
+ result: undefined } }]).value),
1766
+ this._ownPublicKey_0(context,
1767
+ partialProofData)),
1768
+ 'Not the domain owner');
1769
+ const d_owner_0 = owner_0;
1770
+ const domain_data_0 = { owner: d_owner_0, resolver: resolver_0 };
1771
+ Contract._query(context,
1772
+ partialProofData,
1773
+ [
1774
+ { idx: { cached: false,
1775
+ pushPath: true,
1776
+ path: [
1777
+ { tag: 'value',
1778
+ value: { value: _descriptor_21.toValue(5n),
1779
+ alignment: _descriptor_21.alignment() } }] } },
1780
+ { push: { storage: false,
1781
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_0.toValue(domain_0),
1782
+ alignment: _descriptor_0.alignment() }).encode() } },
1783
+ { push: { storage: true,
1784
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_4.toValue(domain_data_0),
1785
+ alignment: _descriptor_4.alignment() }).encode() } },
1786
+ { ins: { cached: false, n: 1 } },
1787
+ { ins: { cached: true, n: 1 } }]);
1788
+ if (!_descriptor_5.fromValue(Contract._query(context,
1789
+ partialProofData,
1790
+ [
1791
+ { dup: { n: 0 } },
1792
+ { idx: { cached: false,
1793
+ pushPath: false,
1794
+ path: [
1795
+ { tag: 'value',
1796
+ value: { value: _descriptor_21.toValue(6n),
1797
+ alignment: _descriptor_21.alignment() } }] } },
1798
+ { push: { storage: false,
1799
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_2.toValue(d_owner_0),
1800
+ alignment: _descriptor_2.alignment() }).encode() } },
1801
+ 'member',
1802
+ { popeq: { cached: true,
1803
+ result: undefined } }]).value))
1804
+ {
1805
+ Contract._query(context,
1806
+ partialProofData,
1807
+ [
1808
+ { idx: { cached: false,
1809
+ pushPath: true,
1810
+ path: [
1811
+ { tag: 'value',
1812
+ value: { value: _descriptor_21.toValue(6n),
1813
+ alignment: _descriptor_21.alignment() } }] } },
1814
+ { push: { storage: false,
1815
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_2.toValue(d_owner_0),
1816
+ alignment: _descriptor_2.alignment() }).encode() } },
1817
+ { push: { storage: true,
1818
+ value: __compactRuntime.StateValue.newMap(
1819
+ new __compactRuntime.StateMap()
1820
+ ).encode() } },
1821
+ { ins: { cached: false, n: 1 } },
1822
+ { ins: { cached: true, n: 1 } }]);
1823
+ }
1824
+ Contract._query(context,
1825
+ partialProofData,
1826
+ [
1827
+ { idx: { cached: false,
1828
+ pushPath: true,
1829
+ path: [
1830
+ { tag: 'value',
1831
+ value: { value: _descriptor_21.toValue(6n),
1832
+ alignment: _descriptor_21.alignment() } },
1833
+ { tag: 'value',
1834
+ value: { value: _descriptor_2.toValue(d_owner_0),
1835
+ alignment: _descriptor_2.alignment() } }] } },
1836
+ { push: { storage: false,
1837
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_0.toValue(domain_0),
1838
+ alignment: _descriptor_0.alignment() }).encode() } },
1839
+ { push: { storage: true,
1840
+ value: __compactRuntime.StateValue.newNull().encode() } },
1841
+ { ins: { cached: false, n: 1 } },
1842
+ { ins: { cached: true, n: 2 } }]);
1843
+ return [];
1844
+ }
1845
+ _set_resolver_0(context, partialProofData, domain_0, resolver_0) {
1846
+ __compactRuntime.assert(_descriptor_5.fromValue(Contract._query(context,
1847
+ partialProofData,
1848
+ [
1849
+ { dup: { n: 0 } },
1850
+ { idx: { cached: false,
1851
+ pushPath: false,
1852
+ path: [
1853
+ { tag: 'value',
1854
+ value: { value: _descriptor_21.toValue(5n),
1855
+ alignment: _descriptor_21.alignment() } }] } },
1856
+ { push: { storage: false,
1857
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_0.toValue(domain_0),
1858
+ alignment: _descriptor_0.alignment() }).encode() } },
1859
+ 'member',
1860
+ { popeq: { cached: true,
1861
+ result: undefined } }]).value),
1862
+ 'Domain does not exist');
1863
+ const current_data_0 = _descriptor_4.fromValue(Contract._query(context,
1864
+ partialProofData,
1865
+ [
1866
+ { dup: { n: 0 } },
1867
+ { idx: { cached: false,
1868
+ pushPath: false,
1869
+ path: [
1870
+ { tag: 'value',
1871
+ value: { value: _descriptor_21.toValue(5n),
1872
+ alignment: _descriptor_21.alignment() } }] } },
1873
+ { idx: { cached: false,
1874
+ pushPath: false,
1875
+ path: [
1876
+ { tag: 'value',
1877
+ value: { value: _descriptor_0.toValue(domain_0),
1878
+ alignment: _descriptor_0.alignment() } }] } },
1879
+ { popeq: { cached: false,
1880
+ result: undefined } }]).value);
1881
+ __compactRuntime.assert(this._equal_14(current_data_0.owner,
1882
+ this._ownPublicKey_0(context,
1883
+ partialProofData)),
1884
+ 'Not the domain owner');
1885
+ const new_data_0 = { owner: current_data_0.owner, resolver: resolver_0 };
1886
+ Contract._query(context,
1887
+ partialProofData,
1888
+ [
1889
+ { idx: { cached: false,
1890
+ pushPath: true,
1891
+ path: [
1892
+ { tag: 'value',
1893
+ value: { value: _descriptor_21.toValue(5n),
1894
+ alignment: _descriptor_21.alignment() } }] } },
1895
+ { push: { storage: false,
1896
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_0.toValue(domain_0),
1897
+ alignment: _descriptor_0.alignment() }).encode() } },
1898
+ { push: { storage: true,
1899
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_4.toValue(new_data_0),
1900
+ alignment: _descriptor_4.alignment() }).encode() } },
1901
+ { ins: { cached: false, n: 1 } },
1902
+ { ins: { cached: true, n: 1 } }]);
1903
+ return [];
1904
+ }
1905
+ _update_domain_target_0(context, partialProofData, new_target_0) {
1906
+ __compactRuntime.assert(this._equal_15(_descriptor_2.fromValue(Contract._query(context,
1907
+ partialProofData,
1908
+ [
1909
+ { dup: { n: 0 } },
1910
+ { idx: { cached: false,
1911
+ pushPath: false,
1912
+ path: [
1913
+ { tag: 'value',
1914
+ value: { value: _descriptor_21.toValue(3n),
1915
+ alignment: _descriptor_21.alignment() } }] } },
1916
+ { popeq: { cached: false,
1917
+ result: undefined } }]).value),
1918
+ this._ownPublicKey_0(context,
1919
+ partialProofData)),
1920
+ 'Not the contract owner');
1921
+ Contract._query(context,
1922
+ partialProofData,
1923
+ [
1924
+ { push: { storage: false,
1925
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_21.toValue(4n),
1926
+ alignment: _descriptor_21.alignment() }).encode() } },
1927
+ { push: { storage: true,
1928
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_7.toValue(new_target_0),
1929
+ alignment: _descriptor_7.alignment() }).encode() } },
1930
+ { ins: { cached: false, n: 1 } }]);
1931
+ return [];
1932
+ }
1933
+ _transfer_domain_0(context, partialProofData, domain_0, new_owner_0) {
1934
+ __compactRuntime.assert(_descriptor_5.fromValue(Contract._query(context,
1935
+ partialProofData,
1936
+ [
1937
+ { dup: { n: 0 } },
1938
+ { idx: { cached: false,
1939
+ pushPath: false,
1940
+ path: [
1941
+ { tag: 'value',
1942
+ value: { value: _descriptor_21.toValue(5n),
1943
+ alignment: _descriptor_21.alignment() } }] } },
1944
+ { push: { storage: false,
1945
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_0.toValue(domain_0),
1946
+ alignment: _descriptor_0.alignment() }).encode() } },
1947
+ 'member',
1948
+ { popeq: { cached: true,
1949
+ result: undefined } }]).value),
1950
+ 'Domain does not exist');
1951
+ const current_data_0 = _descriptor_4.fromValue(Contract._query(context,
1952
+ partialProofData,
1953
+ [
1954
+ { dup: { n: 0 } },
1955
+ { idx: { cached: false,
1956
+ pushPath: false,
1957
+ path: [
1958
+ { tag: 'value',
1959
+ value: { value: _descriptor_21.toValue(5n),
1960
+ alignment: _descriptor_21.alignment() } }] } },
1961
+ { idx: { cached: false,
1962
+ pushPath: false,
1963
+ path: [
1964
+ { tag: 'value',
1965
+ value: { value: _descriptor_0.toValue(domain_0),
1966
+ alignment: _descriptor_0.alignment() } }] } },
1967
+ { popeq: { cached: false,
1968
+ result: undefined } }]).value);
1969
+ __compactRuntime.assert(this._equal_16(current_data_0.owner,
1970
+ this._ownPublicKey_0(context,
1971
+ partialProofData)),
1972
+ 'Not the domain owner');
1973
+ const new_data_0 = { owner: new_owner_0, resolver: current_data_0.resolver };
1974
+ Contract._query(context,
1975
+ partialProofData,
1976
+ [
1977
+ { idx: { cached: false,
1978
+ pushPath: true,
1979
+ path: [
1980
+ { tag: 'value',
1981
+ value: { value: _descriptor_21.toValue(5n),
1982
+ alignment: _descriptor_21.alignment() } }] } },
1983
+ { push: { storage: false,
1984
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_0.toValue(domain_0),
1985
+ alignment: _descriptor_0.alignment() }).encode() } },
1986
+ { push: { storage: true,
1987
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_4.toValue(new_data_0),
1988
+ alignment: _descriptor_4.alignment() }).encode() } },
1989
+ { ins: { cached: false, n: 1 } },
1990
+ { ins: { cached: true, n: 1 } }]);
1991
+ const tmp_0 = this._ownPublicKey_0(context, partialProofData);
1992
+ Contract._query(context,
1993
+ partialProofData,
1994
+ [
1995
+ { idx: { cached: false,
1996
+ pushPath: true,
1997
+ path: [
1998
+ { tag: 'value',
1999
+ value: { value: _descriptor_21.toValue(6n),
2000
+ alignment: _descriptor_21.alignment() } },
2001
+ { tag: 'value',
2002
+ value: { value: _descriptor_2.toValue(tmp_0),
2003
+ alignment: _descriptor_2.alignment() } }] } },
2004
+ { push: { storage: false,
2005
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_0.toValue(domain_0),
2006
+ alignment: _descriptor_0.alignment() }).encode() } },
2007
+ { rem: { cached: false } },
2008
+ { ins: { cached: true, n: 2 } }]);
2009
+ if (!_descriptor_5.fromValue(Contract._query(context,
2010
+ partialProofData,
2011
+ [
2012
+ { dup: { n: 0 } },
2013
+ { idx: { cached: false,
2014
+ pushPath: false,
2015
+ path: [
2016
+ { tag: 'value',
2017
+ value: { value: _descriptor_21.toValue(6n),
2018
+ alignment: _descriptor_21.alignment() } }] } },
2019
+ { push: { storage: false,
2020
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_2.toValue(new_owner_0),
2021
+ alignment: _descriptor_2.alignment() }).encode() } },
2022
+ 'member',
2023
+ { popeq: { cached: true,
2024
+ result: undefined } }]).value))
2025
+ {
2026
+ Contract._query(context,
2027
+ partialProofData,
2028
+ [
2029
+ { idx: { cached: false,
2030
+ pushPath: true,
2031
+ path: [
2032
+ { tag: 'value',
2033
+ value: { value: _descriptor_21.toValue(6n),
2034
+ alignment: _descriptor_21.alignment() } }] } },
2035
+ { push: { storage: false,
2036
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_2.toValue(new_owner_0),
2037
+ alignment: _descriptor_2.alignment() }).encode() } },
2038
+ { push: { storage: true,
2039
+ value: __compactRuntime.StateValue.newMap(
2040
+ new __compactRuntime.StateMap()
2041
+ ).encode() } },
2042
+ { ins: { cached: false, n: 1 } },
2043
+ { ins: { cached: true, n: 1 } }]);
2044
+ }
2045
+ Contract._query(context,
2046
+ partialProofData,
2047
+ [
2048
+ { idx: { cached: false,
2049
+ pushPath: true,
2050
+ path: [
2051
+ { tag: 'value',
2052
+ value: { value: _descriptor_21.toValue(6n),
2053
+ alignment: _descriptor_21.alignment() } },
2054
+ { tag: 'value',
2055
+ value: { value: _descriptor_2.toValue(new_owner_0),
2056
+ alignment: _descriptor_2.alignment() } }] } },
2057
+ { push: { storage: false,
2058
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_0.toValue(domain_0),
2059
+ alignment: _descriptor_0.alignment() }).encode() } },
2060
+ { push: { storage: true,
2061
+ value: __compactRuntime.StateValue.newNull().encode() } },
2062
+ { ins: { cached: false, n: 1 } },
2063
+ { ins: { cached: true, n: 2 } }]);
2064
+ return [];
2065
+ }
2066
+ _change_owner_0(context, partialProofData, new_owner_0) {
2067
+ __compactRuntime.assert(this._equal_17(_descriptor_2.fromValue(Contract._query(context,
2068
+ partialProofData,
2069
+ [
2070
+ { dup: { n: 0 } },
2071
+ { idx: { cached: false,
2072
+ pushPath: false,
2073
+ path: [
2074
+ { tag: 'value',
2075
+ value: { value: _descriptor_21.toValue(3n),
2076
+ alignment: _descriptor_21.alignment() } }] } },
2077
+ { popeq: { cached: false,
2078
+ result: undefined } }]).value),
2079
+ this._ownPublicKey_0(context,
2080
+ partialProofData)),
2081
+ 'Not the contract owner');
2082
+ Contract._query(context,
2083
+ partialProofData,
2084
+ [
2085
+ { push: { storage: false,
2086
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_21.toValue(3n),
2087
+ alignment: _descriptor_21.alignment() }).encode() } },
2088
+ { push: { storage: true,
2089
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_2.toValue(new_owner_0),
2090
+ alignment: _descriptor_2.alignment() }).encode() } },
2091
+ { ins: { cached: false, n: 1 } }]);
2092
+ return [];
2093
+ }
2094
+ _equal_0(x0, y0) {
2095
+ {
2096
+ let x1 = x0.is_some;
2097
+ let y1 = y0.is_some;
2098
+ if (x1 !== y1) { return false; }
2099
+ }
2100
+ {
2101
+ let x1 = x0.value;
2102
+ let y1 = y0.value;
2103
+ {
2104
+ let x2 = x1[0];
2105
+ let y2 = y1[0];
2106
+ if (x2 !== y2) { return false; }
2107
+ }
2108
+ {
2109
+ let x2 = x1[1];
2110
+ let y2 = y1[1];
2111
+ if (x2 !== y2) { return false; }
2112
+ }
2113
+ }
2114
+ return true;
2115
+ }
2116
+ _folder_0(context, partialProofData, f, x, a0) {
2117
+ for (let i = 0; i < 10; i++) { x = f(context, partialProofData, x, a0[i]) }
2118
+ return x;
2119
+ }
2120
+ _equal_1(x0, y0) {
2121
+ if (x0 !== y0) { return false; }
2122
+ return true;
2123
+ }
2124
+ _equal_2(x0, y0) {
2125
+ {
2126
+ let x1 = x0.bytes;
2127
+ let y1 = y0.bytes;
2128
+ if (!x1.every((x, i) => y1[i] === x)) { return false; }
2129
+ }
2130
+ return true;
2131
+ }
2132
+ _equal_3(x0, y0) {
2133
+ {
2134
+ let x1 = x0.bytes;
2135
+ let y1 = y0.bytes;
2136
+ if (!x1.every((x, i) => y1[i] === x)) { return false; }
2137
+ }
2138
+ return true;
2139
+ }
2140
+ _equal_4(x0, y0) {
2141
+ {
2142
+ let x1 = x0.bytes;
2143
+ let y1 = y0.bytes;
2144
+ if (!x1.every((x, i) => y1[i] === x)) { return false; }
2145
+ }
2146
+ return true;
2147
+ }
2148
+ _equal_5(x0, y0) {
2149
+ {
2150
+ let x1 = x0.is_some;
2151
+ let y1 = y0.is_some;
2152
+ if (x1 !== y1) { return false; }
2153
+ }
2154
+ {
2155
+ let x1 = x0.value;
2156
+ let y1 = y0.value;
2157
+ {
2158
+ let x2 = x1[0];
2159
+ let y2 = y1[0];
2160
+ if (x2 !== y2) { return false; }
2161
+ }
2162
+ {
2163
+ let x2 = x1[1];
2164
+ let y2 = y1[1];
2165
+ if (x2 !== y2) { return false; }
2166
+ }
2167
+ }
2168
+ return true;
2169
+ }
2170
+ _folder_1(context, partialProofData, f, x, a0) {
2171
+ for (let i = 0; i < 10; i++) { x = f(context, partialProofData, x, a0[i]) }
2172
+ return x;
2173
+ }
2174
+ _equal_6(x0, y0) {
2175
+ if (x0 !== y0) { return false; }
2176
+ return true;
2177
+ }
2178
+ _equal_7(x0, y0) {
2179
+ if (!x0.every((x, i) => y0[i] === x)) { return false; }
2180
+ return true;
2181
+ }
2182
+ _equal_8(x0, y0) {
2183
+ {
2184
+ let x1 = x0.bytes;
2185
+ let y1 = y0.bytes;
2186
+ if (!x1.every((x, i) => y1[i] === x)) { return false; }
2187
+ }
2188
+ return true;
2189
+ }
2190
+ _equal_9(x0, y0) {
2191
+ {
2192
+ let x1 = x0.is_some;
2193
+ let y1 = y0.is_some;
2194
+ if (x1 !== y1) { return false; }
2195
+ }
2196
+ {
2197
+ let x1 = x0.value;
2198
+ let y1 = y0.value;
2199
+ {
2200
+ let x2 = x1[0];
2201
+ let y2 = y1[0];
2202
+ if (x2 !== y2) { return false; }
2203
+ }
2204
+ {
2205
+ let x2 = x1[1];
2206
+ let y2 = y1[1];
2207
+ if (x2 !== y2) { return false; }
2208
+ }
2209
+ }
2210
+ return true;
2211
+ }
2212
+ _folder_2(context, partialProofData, f, x, a0) {
2213
+ for (let i = 0; i < 10; i++) { x = f(context, partialProofData, x, a0[i]) }
2214
+ return x;
2215
+ }
2216
+ _equal_10(x0, y0) {
2217
+ {
2218
+ let x1 = x0.bytes;
2219
+ let y1 = y0.bytes;
2220
+ if (!x1.every((x, i) => y1[i] === x)) { return false; }
2221
+ }
2222
+ return true;
2223
+ }
2224
+ _equal_11(x0, y0) {
2225
+ {
2226
+ let x1 = x0.bytes;
2227
+ let y1 = y0.bytes;
2228
+ if (!x1.every((x, i) => y1[i] === x)) { return false; }
2229
+ }
2230
+ return true;
2231
+ }
2232
+ _equal_12(x0, y0) {
2233
+ {
2234
+ let x1 = x0.bytes;
2235
+ let y1 = y0.bytes;
2236
+ if (!x1.every((x, i) => y1[i] === x)) { return false; }
2237
+ }
2238
+ return true;
2239
+ }
2240
+ _equal_13(x0, y0) {
2241
+ {
2242
+ let x1 = x0.bytes;
2243
+ let y1 = y0.bytes;
2244
+ if (!x1.every((x, i) => y1[i] === x)) { return false; }
2245
+ }
2246
+ return true;
2247
+ }
2248
+ _equal_14(x0, y0) {
2249
+ {
2250
+ let x1 = x0.bytes;
2251
+ let y1 = y0.bytes;
2252
+ if (!x1.every((x, i) => y1[i] === x)) { return false; }
2253
+ }
2254
+ return true;
2255
+ }
2256
+ _equal_15(x0, y0) {
2257
+ {
2258
+ let x1 = x0.bytes;
2259
+ let y1 = y0.bytes;
2260
+ if (!x1.every((x, i) => y1[i] === x)) { return false; }
2261
+ }
2262
+ return true;
2263
+ }
2264
+ _equal_16(x0, y0) {
2265
+ {
2266
+ let x1 = x0.bytes;
2267
+ let y1 = y0.bytes;
2268
+ if (!x1.every((x, i) => y1[i] === x)) { return false; }
2269
+ }
2270
+ return true;
2271
+ }
2272
+ _equal_17(x0, y0) {
2273
+ {
2274
+ let x1 = x0.bytes;
2275
+ let y1 = y0.bytes;
2276
+ if (!x1.every((x, i) => y1[i] === x)) { return false; }
2277
+ }
2278
+ return true;
2279
+ }
2280
+ static _query(context, partialProofData, prog) {
2281
+ var res;
2282
+ try {
2283
+ res = context.transactionContext.query(prog, __compactRuntime.CostModel.dummyCostModel());
2284
+ } catch (err) {
2285
+ throw new __compactRuntime.CompactError(err.toString());
2286
+ }
2287
+ context.transactionContext = res.context;
2288
+ var reads = res.events.filter((e) => e.tag === 'read');
2289
+ var i = 0;
2290
+ partialProofData.publicTranscript = partialProofData.publicTranscript.concat(prog.map((op) => {
2291
+ if(typeof(op) === 'object' && 'popeq' in op) {
2292
+ return { popeq: {
2293
+ ...op.popeq,
2294
+ result: reads[i++].content,
2295
+ } };
2296
+ } else {
2297
+ return op;
2298
+ }
2299
+ }));
2300
+ if(res.events.length == 1 && res.events[0].tag === 'read') {
2301
+ return res.events[0].content;
2302
+ } else {
2303
+ return res.events;
2304
+ }
2305
+ }
2306
+ }
2307
+ function ledger(state) {
2308
+ const context = {
2309
+ originalState: state,
2310
+ transactionContext: new __compactRuntime.QueryContext(state, __compactRuntime.dummyContractAddress())
2311
+ };
2312
+ const partialProofData = {
2313
+ input: { value: [], alignment: [] },
2314
+ output: undefined,
2315
+ publicTranscript: [],
2316
+ privateTranscriptOutputs: []
2317
+ };
2318
+ return {
2319
+ get PARENT_DOMAIN() {
2320
+ return _descriptor_20.fromValue(Contract._query(context,
2321
+ partialProofData,
2322
+ [
2323
+ { dup: { n: 0 } },
2324
+ { idx: { cached: false,
2325
+ pushPath: false,
2326
+ path: [
2327
+ { tag: 'value',
2328
+ value: { value: _descriptor_21.toValue(0n),
2329
+ alignment: _descriptor_21.alignment() } }] } },
2330
+ { popeq: { cached: false,
2331
+ result: undefined } }]).value);
2332
+ },
2333
+ get PARENT_RESOLVER() {
2334
+ return _descriptor_3.fromValue(Contract._query(context,
2335
+ partialProofData,
2336
+ [
2337
+ { dup: { n: 0 } },
2338
+ { idx: { cached: false,
2339
+ pushPath: false,
2340
+ path: [
2341
+ { tag: 'value',
2342
+ value: { value: _descriptor_21.toValue(1n),
2343
+ alignment: _descriptor_21.alignment() } }] } },
2344
+ { popeq: { cached: false,
2345
+ result: undefined } }]).value);
2346
+ },
2347
+ get DOMAIN() {
2348
+ return _descriptor_20.fromValue(Contract._query(context,
2349
+ partialProofData,
2350
+ [
2351
+ { dup: { n: 0 } },
2352
+ { idx: { cached: false,
2353
+ pushPath: false,
2354
+ path: [
2355
+ { tag: 'value',
2356
+ value: { value: _descriptor_21.toValue(2n),
2357
+ alignment: _descriptor_21.alignment() } }] } },
2358
+ { popeq: { cached: false,
2359
+ result: undefined } }]).value);
2360
+ },
2361
+ get DOMAIN_OWNER() {
2362
+ return _descriptor_2.fromValue(Contract._query(context,
2363
+ partialProofData,
2364
+ [
2365
+ { dup: { n: 0 } },
2366
+ { idx: { cached: false,
2367
+ pushPath: false,
2368
+ path: [
2369
+ { tag: 'value',
2370
+ value: { value: _descriptor_21.toValue(3n),
2371
+ alignment: _descriptor_21.alignment() } }] } },
2372
+ { popeq: { cached: false,
2373
+ result: undefined } }]).value);
2374
+ },
2375
+ get DOMAIN_TARGET() {
2376
+ return _descriptor_7.fromValue(Contract._query(context,
2377
+ partialProofData,
2378
+ [
2379
+ { dup: { n: 0 } },
2380
+ { idx: { cached: false,
2381
+ pushPath: false,
2382
+ path: [
2383
+ { tag: 'value',
2384
+ value: { value: _descriptor_21.toValue(4n),
2385
+ alignment: _descriptor_21.alignment() } }] } },
2386
+ { popeq: { cached: false,
2387
+ result: undefined } }]).value);
2388
+ },
2389
+ domains: {
2390
+ isEmpty(...args_0) {
2391
+ if (args_0.length !== 0) {
2392
+ throw new __compactRuntime.CompactError(`isEmpty: expected 0 arguments, received ${args_0.length}`);
2393
+ }
2394
+ return _descriptor_5.fromValue(Contract._query(context,
2395
+ partialProofData,
2396
+ [
2397
+ { dup: { n: 0 } },
2398
+ { idx: { cached: false,
2399
+ pushPath: false,
2400
+ path: [
2401
+ { tag: 'value',
2402
+ value: { value: _descriptor_21.toValue(5n),
2403
+ alignment: _descriptor_21.alignment() } }] } },
2404
+ 'size',
2405
+ { push: { storage: false,
2406
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_6.toValue(0n),
2407
+ alignment: _descriptor_6.alignment() }).encode() } },
2408
+ 'eq',
2409
+ { popeq: { cached: true,
2410
+ result: undefined } }]).value);
2411
+ },
2412
+ size(...args_0) {
2413
+ if (args_0.length !== 0) {
2414
+ throw new __compactRuntime.CompactError(`size: expected 0 arguments, received ${args_0.length}`);
2415
+ }
2416
+ return _descriptor_6.fromValue(Contract._query(context,
2417
+ partialProofData,
2418
+ [
2419
+ { dup: { n: 0 } },
2420
+ { idx: { cached: false,
2421
+ pushPath: false,
2422
+ path: [
2423
+ { tag: 'value',
2424
+ value: { value: _descriptor_21.toValue(5n),
2425
+ alignment: _descriptor_21.alignment() } }] } },
2426
+ 'size',
2427
+ { popeq: { cached: true,
2428
+ result: undefined } }]).value);
2429
+ },
2430
+ member(...args_0) {
2431
+ if (args_0.length !== 1) {
2432
+ throw new __compactRuntime.CompactError(`member: expected 1 argument, received ${args_0.length}`);
2433
+ }
2434
+ const key_0 = args_0[0];
2435
+ return _descriptor_5.fromValue(Contract._query(context,
2436
+ partialProofData,
2437
+ [
2438
+ { dup: { n: 0 } },
2439
+ { idx: { cached: false,
2440
+ pushPath: false,
2441
+ path: [
2442
+ { tag: 'value',
2443
+ value: { value: _descriptor_21.toValue(5n),
2444
+ alignment: _descriptor_21.alignment() } }] } },
2445
+ { push: { storage: false,
2446
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_0.toValue(key_0),
2447
+ alignment: _descriptor_0.alignment() }).encode() } },
2448
+ 'member',
2449
+ { popeq: { cached: true,
2450
+ result: undefined } }]).value);
2451
+ },
2452
+ lookup(...args_0) {
2453
+ if (args_0.length !== 1) {
2454
+ throw new __compactRuntime.CompactError(`lookup: expected 1 argument, received ${args_0.length}`);
2455
+ }
2456
+ const key_0 = args_0[0];
2457
+ return _descriptor_4.fromValue(Contract._query(context,
2458
+ partialProofData,
2459
+ [
2460
+ { dup: { n: 0 } },
2461
+ { idx: { cached: false,
2462
+ pushPath: false,
2463
+ path: [
2464
+ { tag: 'value',
2465
+ value: { value: _descriptor_21.toValue(5n),
2466
+ alignment: _descriptor_21.alignment() } }] } },
2467
+ { idx: { cached: false,
2468
+ pushPath: false,
2469
+ path: [
2470
+ { tag: 'value',
2471
+ value: { value: _descriptor_0.toValue(key_0),
2472
+ alignment: _descriptor_0.alignment() } }] } },
2473
+ { popeq: { cached: false,
2474
+ result: undefined } }]).value);
2475
+ },
2476
+ [Symbol.iterator](...args_0) {
2477
+ if (args_0.length !== 0) {
2478
+ throw new __compactRuntime.CompactError(`iter: expected 0 arguments, received ${args_0.length}`);
2479
+ }
2480
+ const self_0 = state.asArray()[5];
2481
+ return self_0.asMap().keys().map( (key) => { const value = self_0.asMap().get(key).asCell(); return [ _descriptor_0.fromValue(key.value), _descriptor_4.fromValue(value.value) ]; })[Symbol.iterator]();
2482
+ }
2483
+ },
2484
+ domains_owned: {
2485
+ isEmpty(...args_0) {
2486
+ if (args_0.length !== 0) {
2487
+ throw new __compactRuntime.CompactError(`isEmpty: expected 0 arguments, received ${args_0.length}`);
2488
+ }
2489
+ return _descriptor_5.fromValue(Contract._query(context,
2490
+ partialProofData,
2491
+ [
2492
+ { dup: { n: 0 } },
2493
+ { idx: { cached: false,
2494
+ pushPath: false,
2495
+ path: [
2496
+ { tag: 'value',
2497
+ value: { value: _descriptor_21.toValue(6n),
2498
+ alignment: _descriptor_21.alignment() } }] } },
2499
+ 'size',
2500
+ { push: { storage: false,
2501
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_6.toValue(0n),
2502
+ alignment: _descriptor_6.alignment() }).encode() } },
2503
+ 'eq',
2504
+ { popeq: { cached: true,
2505
+ result: undefined } }]).value);
2506
+ },
2507
+ size(...args_0) {
2508
+ if (args_0.length !== 0) {
2509
+ throw new __compactRuntime.CompactError(`size: expected 0 arguments, received ${args_0.length}`);
2510
+ }
2511
+ return _descriptor_6.fromValue(Contract._query(context,
2512
+ partialProofData,
2513
+ [
2514
+ { dup: { n: 0 } },
2515
+ { idx: { cached: false,
2516
+ pushPath: false,
2517
+ path: [
2518
+ { tag: 'value',
2519
+ value: { value: _descriptor_21.toValue(6n),
2520
+ alignment: _descriptor_21.alignment() } }] } },
2521
+ 'size',
2522
+ { popeq: { cached: true,
2523
+ result: undefined } }]).value);
2524
+ },
2525
+ member(...args_0) {
2526
+ if (args_0.length !== 1) {
2527
+ throw new __compactRuntime.CompactError(`member: expected 1 argument, received ${args_0.length}`);
2528
+ }
2529
+ const key_0 = args_0[0];
2530
+ if (!(typeof(key_0) === 'object' && key_0.bytes.buffer instanceof ArrayBuffer && key_0.bytes.BYTES_PER_ELEMENT === 1 && key_0.bytes.length === 32)) {
2531
+ __compactRuntime.type_error('member',
2532
+ 'argument 1',
2533
+ 'leaf.compact line 41 char 1',
2534
+ 'struct ZswapCoinPublicKey<bytes: Bytes<32>>',
2535
+ key_0)
2536
+ }
2537
+ return _descriptor_5.fromValue(Contract._query(context,
2538
+ partialProofData,
2539
+ [
2540
+ { dup: { n: 0 } },
2541
+ { idx: { cached: false,
2542
+ pushPath: false,
2543
+ path: [
2544
+ { tag: 'value',
2545
+ value: { value: _descriptor_21.toValue(6n),
2546
+ alignment: _descriptor_21.alignment() } }] } },
2547
+ { push: { storage: false,
2548
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_2.toValue(key_0),
2549
+ alignment: _descriptor_2.alignment() }).encode() } },
2550
+ 'member',
2551
+ { popeq: { cached: true,
2552
+ result: undefined } }]).value);
2553
+ },
2554
+ lookup(...args_0) {
2555
+ if (args_0.length !== 1) {
2556
+ throw new __compactRuntime.CompactError(`lookup: expected 1 argument, received ${args_0.length}`);
2557
+ }
2558
+ const key_0 = args_0[0];
2559
+ if (!(typeof(key_0) === 'object' && key_0.bytes.buffer instanceof ArrayBuffer && key_0.bytes.BYTES_PER_ELEMENT === 1 && key_0.bytes.length === 32)) {
2560
+ __compactRuntime.type_error('lookup',
2561
+ 'argument 1',
2562
+ 'leaf.compact line 41 char 1',
2563
+ 'struct ZswapCoinPublicKey<bytes: Bytes<32>>',
2564
+ key_0)
2565
+ }
2566
+ if (state.asArray()[6].asMap().get({ value: _descriptor_2.toValue(key_0),
2567
+ alignment: _descriptor_2.alignment() }) === undefined) {
2568
+ throw new __compactRuntime.CompactError(`Map value undefined for ${key_0}`);
2569
+ }
2570
+ return {
2571
+ isEmpty(...args_1) {
2572
+ if (args_1.length !== 0) {
2573
+ throw new __compactRuntime.CompactError(`isEmpty: expected 0 arguments, received ${args_1.length}`);
2574
+ }
2575
+ return _descriptor_5.fromValue(Contract._query(context,
2576
+ partialProofData,
2577
+ [
2578
+ { dup: { n: 0 } },
2579
+ { idx: { cached: false,
2580
+ pushPath: false,
2581
+ path: [
2582
+ { tag: 'value',
2583
+ value: { value: _descriptor_21.toValue(6n),
2584
+ alignment: _descriptor_21.alignment() } },
2585
+ { tag: 'value',
2586
+ value: { value: _descriptor_2.toValue(key_0),
2587
+ alignment: _descriptor_2.alignment() } }] } },
2588
+ 'size',
2589
+ { push: { storage: false,
2590
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_6.toValue(0n),
2591
+ alignment: _descriptor_6.alignment() }).encode() } },
2592
+ 'eq',
2593
+ { popeq: { cached: true,
2594
+ result: undefined } }]).value);
2595
+ },
2596
+ size(...args_1) {
2597
+ if (args_1.length !== 0) {
2598
+ throw new __compactRuntime.CompactError(`size: expected 0 arguments, received ${args_1.length}`);
2599
+ }
2600
+ return _descriptor_6.fromValue(Contract._query(context,
2601
+ partialProofData,
2602
+ [
2603
+ { dup: { n: 0 } },
2604
+ { idx: { cached: false,
2605
+ pushPath: false,
2606
+ path: [
2607
+ { tag: 'value',
2608
+ value: { value: _descriptor_21.toValue(6n),
2609
+ alignment: _descriptor_21.alignment() } },
2610
+ { tag: 'value',
2611
+ value: { value: _descriptor_2.toValue(key_0),
2612
+ alignment: _descriptor_2.alignment() } }] } },
2613
+ 'size',
2614
+ { popeq: { cached: true,
2615
+ result: undefined } }]).value);
2616
+ },
2617
+ member(...args_1) {
2618
+ if (args_1.length !== 1) {
2619
+ throw new __compactRuntime.CompactError(`member: expected 1 argument, received ${args_1.length}`);
2620
+ }
2621
+ const elem_0 = args_1[0];
2622
+ return _descriptor_5.fromValue(Contract._query(context,
2623
+ partialProofData,
2624
+ [
2625
+ { dup: { n: 0 } },
2626
+ { idx: { cached: false,
2627
+ pushPath: false,
2628
+ path: [
2629
+ { tag: 'value',
2630
+ value: { value: _descriptor_21.toValue(6n),
2631
+ alignment: _descriptor_21.alignment() } },
2632
+ { tag: 'value',
2633
+ value: { value: _descriptor_2.toValue(key_0),
2634
+ alignment: _descriptor_2.alignment() } }] } },
2635
+ { push: { storage: false,
2636
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_0.toValue(elem_0),
2637
+ alignment: _descriptor_0.alignment() }).encode() } },
2638
+ 'member',
2639
+ { popeq: { cached: true,
2640
+ result: undefined } }]).value);
2641
+ },
2642
+ [Symbol.iterator](...args_1) {
2643
+ if (args_1.length !== 0) {
2644
+ throw new __compactRuntime.CompactError(`iter: expected 0 arguments, received ${args_1.length}`);
2645
+ }
2646
+ const self_0 = state.asArray()[6].asMap().get({ value: _descriptor_2.toValue(key_0),
2647
+ alignment: _descriptor_2.alignment() });
2648
+ return self_0.asMap().keys().map((elem) => _descriptor_0.fromValue(elem.value))[Symbol.iterator]();
2649
+ }
2650
+ }
2651
+ }
2652
+ },
2653
+ fields: {
2654
+ isEmpty(...args_0) {
2655
+ if (args_0.length !== 0) {
2656
+ throw new __compactRuntime.CompactError(`isEmpty: expected 0 arguments, received ${args_0.length}`);
2657
+ }
2658
+ return _descriptor_5.fromValue(Contract._query(context,
2659
+ partialProofData,
2660
+ [
2661
+ { dup: { n: 0 } },
2662
+ { idx: { cached: false,
2663
+ pushPath: false,
2664
+ path: [
2665
+ { tag: 'value',
2666
+ value: { value: _descriptor_21.toValue(7n),
2667
+ alignment: _descriptor_21.alignment() } }] } },
2668
+ 'size',
2669
+ { push: { storage: false,
2670
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_6.toValue(0n),
2671
+ alignment: _descriptor_6.alignment() }).encode() } },
2672
+ 'eq',
2673
+ { popeq: { cached: true,
2674
+ result: undefined } }]).value);
2675
+ },
2676
+ size(...args_0) {
2677
+ if (args_0.length !== 0) {
2678
+ throw new __compactRuntime.CompactError(`size: expected 0 arguments, received ${args_0.length}`);
2679
+ }
2680
+ return _descriptor_6.fromValue(Contract._query(context,
2681
+ partialProofData,
2682
+ [
2683
+ { dup: { n: 0 } },
2684
+ { idx: { cached: false,
2685
+ pushPath: false,
2686
+ path: [
2687
+ { tag: 'value',
2688
+ value: { value: _descriptor_21.toValue(7n),
2689
+ alignment: _descriptor_21.alignment() } }] } },
2690
+ 'size',
2691
+ { popeq: { cached: true,
2692
+ result: undefined } }]).value);
2693
+ },
2694
+ member(...args_0) {
2695
+ if (args_0.length !== 1) {
2696
+ throw new __compactRuntime.CompactError(`member: expected 1 argument, received ${args_0.length}`);
2697
+ }
2698
+ const key_0 = args_0[0];
2699
+ return _descriptor_5.fromValue(Contract._query(context,
2700
+ partialProofData,
2701
+ [
2702
+ { dup: { n: 0 } },
2703
+ { idx: { cached: false,
2704
+ pushPath: false,
2705
+ path: [
2706
+ { tag: 'value',
2707
+ value: { value: _descriptor_21.toValue(7n),
2708
+ alignment: _descriptor_21.alignment() } }] } },
2709
+ { push: { storage: false,
2710
+ value: __compactRuntime.StateValue.newCell({ value: _descriptor_0.toValue(key_0),
2711
+ alignment: _descriptor_0.alignment() }).encode() } },
2712
+ 'member',
2713
+ { popeq: { cached: true,
2714
+ result: undefined } }]).value);
2715
+ },
2716
+ lookup(...args_0) {
2717
+ if (args_0.length !== 1) {
2718
+ throw new __compactRuntime.CompactError(`lookup: expected 1 argument, received ${args_0.length}`);
2719
+ }
2720
+ const key_0 = args_0[0];
2721
+ return _descriptor_0.fromValue(Contract._query(context,
2722
+ partialProofData,
2723
+ [
2724
+ { dup: { n: 0 } },
2725
+ { idx: { cached: false,
2726
+ pushPath: false,
2727
+ path: [
2728
+ { tag: 'value',
2729
+ value: { value: _descriptor_21.toValue(7n),
2730
+ alignment: _descriptor_21.alignment() } }] } },
2731
+ { idx: { cached: false,
2732
+ pushPath: false,
2733
+ path: [
2734
+ { tag: 'value',
2735
+ value: { value: _descriptor_0.toValue(key_0),
2736
+ alignment: _descriptor_0.alignment() } }] } },
2737
+ { popeq: { cached: false,
2738
+ result: undefined } }]).value);
2739
+ },
2740
+ [Symbol.iterator](...args_0) {
2741
+ if (args_0.length !== 0) {
2742
+ throw new __compactRuntime.CompactError(`iter: expected 0 arguments, received ${args_0.length}`);
2743
+ }
2744
+ const self_0 = state.asArray()[7];
2745
+ return self_0.asMap().keys().map( (key) => { const value = self_0.asMap().get(key).asCell(); return [ _descriptor_0.fromValue(key.value), _descriptor_0.fromValue(value.value) ]; })[Symbol.iterator]();
2746
+ }
2747
+ },
2748
+ get COIN_COLOR() {
2749
+ return _descriptor_1.fromValue(Contract._query(context,
2750
+ partialProofData,
2751
+ [
2752
+ { dup: { n: 0 } },
2753
+ { idx: { cached: false,
2754
+ pushPath: false,
2755
+ path: [
2756
+ { tag: 'value',
2757
+ value: { value: _descriptor_21.toValue(8n),
2758
+ alignment: _descriptor_21.alignment() } }] } },
2759
+ { popeq: { cached: false,
2760
+ result: undefined } }]).value);
2761
+ },
2762
+ get DOMAIN_COST() {
2763
+ return _descriptor_6.fromValue(Contract._query(context,
2764
+ partialProofData,
2765
+ [
2766
+ { dup: { n: 0 } },
2767
+ { idx: { cached: false,
2768
+ pushPath: false,
2769
+ path: [
2770
+ { tag: 'value',
2771
+ value: { value: _descriptor_21.toValue(9n),
2772
+ alignment: _descriptor_21.alignment() } }] } },
2773
+ { popeq: { cached: false,
2774
+ result: undefined } }]).value);
2775
+ }
2776
+ };
2777
+ }
2778
+ const _emptyContext = {
2779
+ originalState: new __compactRuntime.ContractState(),
2780
+ transactionContext: new __compactRuntime.QueryContext(new __compactRuntime.ContractState().data, __compactRuntime.dummyContractAddress())
2781
+ };
2782
+ const _dummyContract = new Contract({ });
2783
+ const pureCircuits = {};
2784
+ const contractReferenceLocations = { tag: 'publicLedgerArray', indices: { } };
2785
+ exports.Contract = Contract;
2786
+ exports.ledger = ledger;
2787
+ exports.pureCircuits = pureCircuits;
2788
+ exports.contractReferenceLocations = contractReferenceLocations;
2789
+ //# sourceMappingURL=index.cjs.map