@midnames/sdk 0.2.0 → 1.0.0

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