@midnames/sdk 1.0.1 → 1.0.4

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