@vocdoni/proto 1.14.4 → 1.14.8

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.
@@ -2072,11 +2072,11 @@ function proofArbo_KeyTypeToJSON(object) {
2072
2072
  }
2073
2073
  function createBaseVoteEnvelope() {
2074
2074
  return {
2075
- nonce: new Uint8Array(),
2076
- processId: new Uint8Array(),
2075
+ nonce: new Uint8Array(0),
2076
+ processId: new Uint8Array(0),
2077
2077
  proof: void 0,
2078
- votePackage: new Uint8Array(),
2079
- nullifier: new Uint8Array(),
2078
+ votePackage: new Uint8Array(0),
2079
+ nullifier: new Uint8Array(0),
2080
2080
  encryptionKeyIndexes: []
2081
2081
  };
2082
2082
  }
@@ -2112,41 +2112,41 @@ var VoteEnvelope = {
2112
2112
  const tag = reader.uint32();
2113
2113
  switch (tag >>> 3) {
2114
2114
  case 1:
2115
- if (tag != 10) {
2115
+ if (tag !== 10) {
2116
2116
  break;
2117
2117
  }
2118
2118
  message.nonce = reader.bytes();
2119
2119
  continue;
2120
2120
  case 2:
2121
- if (tag != 18) {
2121
+ if (tag !== 18) {
2122
2122
  break;
2123
2123
  }
2124
2124
  message.processId = reader.bytes();
2125
2125
  continue;
2126
2126
  case 3:
2127
- if (tag != 26) {
2127
+ if (tag !== 26) {
2128
2128
  break;
2129
2129
  }
2130
2130
  message.proof = Proof.decode(reader, reader.uint32());
2131
2131
  continue;
2132
2132
  case 4:
2133
- if (tag != 34) {
2133
+ if (tag !== 34) {
2134
2134
  break;
2135
2135
  }
2136
2136
  message.votePackage = reader.bytes();
2137
2137
  continue;
2138
2138
  case 5:
2139
- if (tag != 42) {
2139
+ if (tag !== 42) {
2140
2140
  break;
2141
2141
  }
2142
2142
  message.nullifier = reader.bytes();
2143
2143
  continue;
2144
2144
  case 6:
2145
- if (tag == 48) {
2145
+ if (tag === 48) {
2146
2146
  message.encryptionKeyIndexes.push(reader.uint32());
2147
2147
  continue;
2148
2148
  }
2149
- if (tag == 50) {
2149
+ if (tag === 50) {
2150
2150
  const end2 = reader.uint32() + reader.pos;
2151
2151
  while (reader.pos < end2) {
2152
2152
  message.encryptionKeyIndexes.push(reader.uint32());
@@ -2155,7 +2155,7 @@ var VoteEnvelope = {
2155
2155
  }
2156
2156
  break;
2157
2157
  }
2158
- if ((tag & 7) == 4 || tag == 0) {
2158
+ if ((tag & 7) === 4 || tag === 0) {
2159
2159
  break;
2160
2160
  }
2161
2161
  reader.skipType(tag & 7);
@@ -2164,25 +2164,33 @@ var VoteEnvelope = {
2164
2164
  },
2165
2165
  fromJSON(object) {
2166
2166
  return {
2167
- nonce: isSet(object.nonce) ? bytesFromBase64(object.nonce) : new Uint8Array(),
2168
- processId: isSet(object.processId) ? bytesFromBase64(object.processId) : new Uint8Array(),
2167
+ nonce: isSet(object.nonce) ? bytesFromBase64(object.nonce) : new Uint8Array(0),
2168
+ processId: isSet(object.processId) ? bytesFromBase64(object.processId) : new Uint8Array(0),
2169
2169
  proof: isSet(object.proof) ? Proof.fromJSON(object.proof) : void 0,
2170
- votePackage: isSet(object.votePackage) ? bytesFromBase64(object.votePackage) : new Uint8Array(),
2171
- nullifier: isSet(object.nullifier) ? bytesFromBase64(object.nullifier) : new Uint8Array(),
2170
+ votePackage: isSet(object.votePackage) ? bytesFromBase64(object.votePackage) : new Uint8Array(0),
2171
+ nullifier: isSet(object.nullifier) ? bytesFromBase64(object.nullifier) : new Uint8Array(0),
2172
2172
  encryptionKeyIndexes: Array.isArray(object?.encryptionKeyIndexes) ? object.encryptionKeyIndexes.map((e) => Number(e)) : []
2173
2173
  };
2174
2174
  },
2175
2175
  toJSON(message) {
2176
2176
  const obj = {};
2177
- message.nonce !== void 0 && (obj.nonce = base64FromBytes(message.nonce !== void 0 ? message.nonce : new Uint8Array()));
2178
- message.processId !== void 0 && (obj.processId = base64FromBytes(message.processId !== void 0 ? message.processId : new Uint8Array()));
2179
- message.proof !== void 0 && (obj.proof = message.proof ? Proof.toJSON(message.proof) : void 0);
2180
- message.votePackage !== void 0 && (obj.votePackage = base64FromBytes(message.votePackage !== void 0 ? message.votePackage : new Uint8Array()));
2181
- message.nullifier !== void 0 && (obj.nullifier = base64FromBytes(message.nullifier !== void 0 ? message.nullifier : new Uint8Array()));
2182
- if (message.encryptionKeyIndexes) {
2177
+ if (message.nonce.length !== 0) {
2178
+ obj.nonce = base64FromBytes(message.nonce);
2179
+ }
2180
+ if (message.processId.length !== 0) {
2181
+ obj.processId = base64FromBytes(message.processId);
2182
+ }
2183
+ if (message.proof !== void 0) {
2184
+ obj.proof = Proof.toJSON(message.proof);
2185
+ }
2186
+ if (message.votePackage.length !== 0) {
2187
+ obj.votePackage = base64FromBytes(message.votePackage);
2188
+ }
2189
+ if (message.nullifier.length !== 0) {
2190
+ obj.nullifier = base64FromBytes(message.nullifier);
2191
+ }
2192
+ if (message.encryptionKeyIndexes?.length) {
2183
2193
  obj.encryptionKeyIndexes = message.encryptionKeyIndexes.map((e) => Math.round(e));
2184
- } else {
2185
- obj.encryptionKeyIndexes = [];
2186
2194
  }
2187
2195
  return obj;
2188
2196
  },
@@ -2191,11 +2199,11 @@ var VoteEnvelope = {
2191
2199
  },
2192
2200
  fromPartial(object) {
2193
2201
  const message = createBaseVoteEnvelope();
2194
- message.nonce = object.nonce ?? new Uint8Array();
2195
- message.processId = object.processId ?? new Uint8Array();
2202
+ message.nonce = object.nonce ?? new Uint8Array(0);
2203
+ message.processId = object.processId ?? new Uint8Array(0);
2196
2204
  message.proof = object.proof !== void 0 && object.proof !== null ? Proof.fromPartial(object.proof) : void 0;
2197
- message.votePackage = object.votePackage ?? new Uint8Array();
2198
- message.nullifier = object.nullifier ?? new Uint8Array();
2205
+ message.votePackage = object.votePackage ?? new Uint8Array(0);
2206
+ message.nullifier = object.nullifier ?? new Uint8Array(0);
2199
2207
  message.encryptionKeyIndexes = object.encryptionKeyIndexes?.map((e) => e) || [];
2200
2208
  return message;
2201
2209
  }
@@ -2215,7 +2223,7 @@ var Census = {
2215
2223
  const tag = reader.uint32();
2216
2224
  switch (tag >>> 3) {
2217
2225
  }
2218
- if ((tag & 7) == 4 || tag == 0) {
2226
+ if ((tag & 7) === 4 || tag === 0) {
2219
2227
  break;
2220
2228
  }
2221
2229
  reader.skipType(tag & 7);
@@ -2278,19 +2286,19 @@ var Proof = {
2278
2286
  const tag = reader.uint32();
2279
2287
  switch (tag >>> 3) {
2280
2288
  case 1:
2281
- if (tag != 10) {
2289
+ if (tag !== 10) {
2282
2290
  break;
2283
2291
  }
2284
2292
  message.payload = { $case: "graviton", graviton: ProofGraviton.decode(reader, reader.uint32()) };
2285
2293
  continue;
2286
2294
  case 2:
2287
- if (tag != 18) {
2295
+ if (tag !== 18) {
2288
2296
  break;
2289
2297
  }
2290
2298
  message.payload = { $case: "iden3", iden3: ProofIden3.decode(reader, reader.uint32()) };
2291
2299
  continue;
2292
2300
  case 3:
2293
- if (tag != 26) {
2301
+ if (tag !== 26) {
2294
2302
  break;
2295
2303
  }
2296
2304
  message.payload = {
@@ -2299,7 +2307,7 @@ var Proof = {
2299
2307
  };
2300
2308
  continue;
2301
2309
  case 4:
2302
- if (tag != 34) {
2310
+ if (tag !== 34) {
2303
2311
  break;
2304
2312
  }
2305
2313
  message.payload = {
@@ -2308,31 +2316,31 @@ var Proof = {
2308
2316
  };
2309
2317
  continue;
2310
2318
  case 5:
2311
- if (tag != 42) {
2319
+ if (tag !== 42) {
2312
2320
  break;
2313
2321
  }
2314
2322
  message.payload = { $case: "ca", ca: ProofCA.decode(reader, reader.uint32()) };
2315
2323
  continue;
2316
2324
  case 6:
2317
- if (tag != 50) {
2325
+ if (tag !== 50) {
2318
2326
  break;
2319
2327
  }
2320
2328
  message.payload = { $case: "arbo", arbo: ProofArbo.decode(reader, reader.uint32()) };
2321
2329
  continue;
2322
2330
  case 7:
2323
- if (tag != 58) {
2331
+ if (tag !== 58) {
2324
2332
  break;
2325
2333
  }
2326
2334
  message.payload = { $case: "zkSnark", zkSnark: ProofZkSNARK.decode(reader, reader.uint32()) };
2327
2335
  continue;
2328
2336
  case 8:
2329
- if (tag != 66) {
2337
+ if (tag !== 66) {
2330
2338
  break;
2331
2339
  }
2332
2340
  message.payload = { $case: "minimeStorage", minimeStorage: ProofMinime.decode(reader, reader.uint32()) };
2333
2341
  continue;
2334
2342
  }
2335
- if ((tag & 7) == 4 || tag == 0) {
2343
+ if ((tag & 7) === 4 || tag === 0) {
2336
2344
  break;
2337
2345
  }
2338
2346
  reader.skipType(tag & 7);
@@ -2346,14 +2354,30 @@ var Proof = {
2346
2354
  },
2347
2355
  toJSON(message) {
2348
2356
  const obj = {};
2349
- message.payload?.$case === "graviton" && (obj.graviton = message.payload?.graviton ? ProofGraviton.toJSON(message.payload?.graviton) : void 0);
2350
- message.payload?.$case === "iden3" && (obj.iden3 = message.payload?.iden3 ? ProofIden3.toJSON(message.payload?.iden3) : void 0);
2351
- message.payload?.$case === "ethereumStorage" && (obj.ethereumStorage = message.payload?.ethereumStorage ? ProofEthereumStorage.toJSON(message.payload?.ethereumStorage) : void 0);
2352
- message.payload?.$case === "ethereumAccount" && (obj.ethereumAccount = message.payload?.ethereumAccount ? ProofEthereumAccount.toJSON(message.payload?.ethereumAccount) : void 0);
2353
- message.payload?.$case === "ca" && (obj.ca = message.payload?.ca ? ProofCA.toJSON(message.payload?.ca) : void 0);
2354
- message.payload?.$case === "arbo" && (obj.arbo = message.payload?.arbo ? ProofArbo.toJSON(message.payload?.arbo) : void 0);
2355
- message.payload?.$case === "zkSnark" && (obj.zkSnark = message.payload?.zkSnark ? ProofZkSNARK.toJSON(message.payload?.zkSnark) : void 0);
2356
- message.payload?.$case === "minimeStorage" && (obj.minimeStorage = message.payload?.minimeStorage ? ProofMinime.toJSON(message.payload?.minimeStorage) : void 0);
2357
+ if (message.payload?.$case === "graviton") {
2358
+ obj.graviton = ProofGraviton.toJSON(message.payload.graviton);
2359
+ }
2360
+ if (message.payload?.$case === "iden3") {
2361
+ obj.iden3 = ProofIden3.toJSON(message.payload.iden3);
2362
+ }
2363
+ if (message.payload?.$case === "ethereumStorage") {
2364
+ obj.ethereumStorage = ProofEthereumStorage.toJSON(message.payload.ethereumStorage);
2365
+ }
2366
+ if (message.payload?.$case === "ethereumAccount") {
2367
+ obj.ethereumAccount = ProofEthereumAccount.toJSON(message.payload.ethereumAccount);
2368
+ }
2369
+ if (message.payload?.$case === "ca") {
2370
+ obj.ca = ProofCA.toJSON(message.payload.ca);
2371
+ }
2372
+ if (message.payload?.$case === "arbo") {
2373
+ obj.arbo = ProofArbo.toJSON(message.payload.arbo);
2374
+ }
2375
+ if (message.payload?.$case === "zkSnark") {
2376
+ obj.zkSnark = ProofZkSNARK.toJSON(message.payload.zkSnark);
2377
+ }
2378
+ if (message.payload?.$case === "minimeStorage") {
2379
+ obj.minimeStorage = ProofMinime.toJSON(message.payload.minimeStorage);
2380
+ }
2357
2381
  return obj;
2358
2382
  },
2359
2383
  create(base) {
@@ -2398,7 +2422,7 @@ var Proof = {
2398
2422
  }
2399
2423
  };
2400
2424
  function createBaseProofGraviton() {
2401
- return { siblings: new Uint8Array() };
2425
+ return { siblings: new Uint8Array(0) };
2402
2426
  }
2403
2427
  var ProofGraviton = {
2404
2428
  encode(message, writer = import_minimal.default.Writer.create()) {
@@ -2415,13 +2439,13 @@ var ProofGraviton = {
2415
2439
  const tag = reader.uint32();
2416
2440
  switch (tag >>> 3) {
2417
2441
  case 1:
2418
- if (tag != 10) {
2442
+ if (tag !== 10) {
2419
2443
  break;
2420
2444
  }
2421
2445
  message.siblings = reader.bytes();
2422
2446
  continue;
2423
2447
  }
2424
- if ((tag & 7) == 4 || tag == 0) {
2448
+ if ((tag & 7) === 4 || tag === 0) {
2425
2449
  break;
2426
2450
  }
2427
2451
  reader.skipType(tag & 7);
@@ -2429,11 +2453,13 @@ var ProofGraviton = {
2429
2453
  return message;
2430
2454
  },
2431
2455
  fromJSON(object) {
2432
- return { siblings: isSet(object.siblings) ? bytesFromBase64(object.siblings) : new Uint8Array() };
2456
+ return { siblings: isSet(object.siblings) ? bytesFromBase64(object.siblings) : new Uint8Array(0) };
2433
2457
  },
2434
2458
  toJSON(message) {
2435
2459
  const obj = {};
2436
- message.siblings !== void 0 && (obj.siblings = base64FromBytes(message.siblings !== void 0 ? message.siblings : new Uint8Array()));
2460
+ if (message.siblings.length !== 0) {
2461
+ obj.siblings = base64FromBytes(message.siblings);
2462
+ }
2437
2463
  return obj;
2438
2464
  },
2439
2465
  create(base) {
@@ -2441,12 +2467,12 @@ var ProofGraviton = {
2441
2467
  },
2442
2468
  fromPartial(object) {
2443
2469
  const message = createBaseProofGraviton();
2444
- message.siblings = object.siblings ?? new Uint8Array();
2470
+ message.siblings = object.siblings ?? new Uint8Array(0);
2445
2471
  return message;
2446
2472
  }
2447
2473
  };
2448
2474
  function createBaseProofIden3() {
2449
- return { siblings: new Uint8Array() };
2475
+ return { siblings: new Uint8Array(0) };
2450
2476
  }
2451
2477
  var ProofIden3 = {
2452
2478
  encode(message, writer = import_minimal.default.Writer.create()) {
@@ -2463,13 +2489,13 @@ var ProofIden3 = {
2463
2489
  const tag = reader.uint32();
2464
2490
  switch (tag >>> 3) {
2465
2491
  case 1:
2466
- if (tag != 10) {
2492
+ if (tag !== 10) {
2467
2493
  break;
2468
2494
  }
2469
2495
  message.siblings = reader.bytes();
2470
2496
  continue;
2471
2497
  }
2472
- if ((tag & 7) == 4 || tag == 0) {
2498
+ if ((tag & 7) === 4 || tag === 0) {
2473
2499
  break;
2474
2500
  }
2475
2501
  reader.skipType(tag & 7);
@@ -2477,11 +2503,13 @@ var ProofIden3 = {
2477
2503
  return message;
2478
2504
  },
2479
2505
  fromJSON(object) {
2480
- return { siblings: isSet(object.siblings) ? bytesFromBase64(object.siblings) : new Uint8Array() };
2506
+ return { siblings: isSet(object.siblings) ? bytesFromBase64(object.siblings) : new Uint8Array(0) };
2481
2507
  },
2482
2508
  toJSON(message) {
2483
2509
  const obj = {};
2484
- message.siblings !== void 0 && (obj.siblings = base64FromBytes(message.siblings !== void 0 ? message.siblings : new Uint8Array()));
2510
+ if (message.siblings.length !== 0) {
2511
+ obj.siblings = base64FromBytes(message.siblings);
2512
+ }
2485
2513
  return obj;
2486
2514
  },
2487
2515
  create(base) {
@@ -2489,12 +2517,12 @@ var ProofIden3 = {
2489
2517
  },
2490
2518
  fromPartial(object) {
2491
2519
  const message = createBaseProofIden3();
2492
- message.siblings = object.siblings ?? new Uint8Array();
2520
+ message.siblings = object.siblings ?? new Uint8Array(0);
2493
2521
  return message;
2494
2522
  }
2495
2523
  };
2496
2524
  function createBaseProofEthereumStorage() {
2497
- return { key: new Uint8Array(), value: new Uint8Array(), siblings: [] };
2525
+ return { key: new Uint8Array(0), value: new Uint8Array(0), siblings: [] };
2498
2526
  }
2499
2527
  var ProofEthereumStorage = {
2500
2528
  encode(message, writer = import_minimal.default.Writer.create()) {
@@ -2517,25 +2545,25 @@ var ProofEthereumStorage = {
2517
2545
  const tag = reader.uint32();
2518
2546
  switch (tag >>> 3) {
2519
2547
  case 1:
2520
- if (tag != 10) {
2548
+ if (tag !== 10) {
2521
2549
  break;
2522
2550
  }
2523
2551
  message.key = reader.bytes();
2524
2552
  continue;
2525
2553
  case 2:
2526
- if (tag != 18) {
2554
+ if (tag !== 18) {
2527
2555
  break;
2528
2556
  }
2529
2557
  message.value = reader.bytes();
2530
2558
  continue;
2531
2559
  case 3:
2532
- if (tag != 26) {
2560
+ if (tag !== 26) {
2533
2561
  break;
2534
2562
  }
2535
2563
  message.siblings.push(reader.bytes());
2536
2564
  continue;
2537
2565
  }
2538
- if ((tag & 7) == 4 || tag == 0) {
2566
+ if ((tag & 7) === 4 || tag === 0) {
2539
2567
  break;
2540
2568
  }
2541
2569
  reader.skipType(tag & 7);
@@ -2544,19 +2572,21 @@ var ProofEthereumStorage = {
2544
2572
  },
2545
2573
  fromJSON(object) {
2546
2574
  return {
2547
- key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(),
2548
- value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(),
2575
+ key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(0),
2576
+ value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(0),
2549
2577
  siblings: Array.isArray(object?.siblings) ? object.siblings.map((e) => bytesFromBase64(e)) : []
2550
2578
  };
2551
2579
  },
2552
2580
  toJSON(message) {
2553
2581
  const obj = {};
2554
- message.key !== void 0 && (obj.key = base64FromBytes(message.key !== void 0 ? message.key : new Uint8Array()));
2555
- message.value !== void 0 && (obj.value = base64FromBytes(message.value !== void 0 ? message.value : new Uint8Array()));
2556
- if (message.siblings) {
2557
- obj.siblings = message.siblings.map((e) => base64FromBytes(e !== void 0 ? e : new Uint8Array()));
2558
- } else {
2559
- obj.siblings = [];
2582
+ if (message.key.length !== 0) {
2583
+ obj.key = base64FromBytes(message.key);
2584
+ }
2585
+ if (message.value.length !== 0) {
2586
+ obj.value = base64FromBytes(message.value);
2587
+ }
2588
+ if (message.siblings?.length) {
2589
+ obj.siblings = message.siblings.map((e) => base64FromBytes(e));
2560
2590
  }
2561
2591
  return obj;
2562
2592
  },
@@ -2565,18 +2595,18 @@ var ProofEthereumStorage = {
2565
2595
  },
2566
2596
  fromPartial(object) {
2567
2597
  const message = createBaseProofEthereumStorage();
2568
- message.key = object.key ?? new Uint8Array();
2569
- message.value = object.value ?? new Uint8Array();
2598
+ message.key = object.key ?? new Uint8Array(0);
2599
+ message.value = object.value ?? new Uint8Array(0);
2570
2600
  message.siblings = object.siblings?.map((e) => e) || [];
2571
2601
  return message;
2572
2602
  }
2573
2603
  };
2574
2604
  function createBaseProofEthereumAccount() {
2575
2605
  return {
2576
- nonce: new Uint8Array(),
2577
- balance: new Uint8Array(),
2578
- storageHash: new Uint8Array(),
2579
- codeHash: new Uint8Array(),
2606
+ nonce: new Uint8Array(0),
2607
+ balance: new Uint8Array(0),
2608
+ storageHash: new Uint8Array(0),
2609
+ codeHash: new Uint8Array(0),
2580
2610
  siblings: []
2581
2611
  };
2582
2612
  }
@@ -2607,37 +2637,37 @@ var ProofEthereumAccount = {
2607
2637
  const tag = reader.uint32();
2608
2638
  switch (tag >>> 3) {
2609
2639
  case 1:
2610
- if (tag != 10) {
2640
+ if (tag !== 10) {
2611
2641
  break;
2612
2642
  }
2613
2643
  message.nonce = reader.bytes();
2614
2644
  continue;
2615
2645
  case 2:
2616
- if (tag != 18) {
2646
+ if (tag !== 18) {
2617
2647
  break;
2618
2648
  }
2619
2649
  message.balance = reader.bytes();
2620
2650
  continue;
2621
2651
  case 3:
2622
- if (tag != 26) {
2652
+ if (tag !== 26) {
2623
2653
  break;
2624
2654
  }
2625
2655
  message.storageHash = reader.bytes();
2626
2656
  continue;
2627
2657
  case 4:
2628
- if (tag != 34) {
2658
+ if (tag !== 34) {
2629
2659
  break;
2630
2660
  }
2631
2661
  message.codeHash = reader.bytes();
2632
2662
  continue;
2633
2663
  case 5:
2634
- if (tag != 42) {
2664
+ if (tag !== 42) {
2635
2665
  break;
2636
2666
  }
2637
2667
  message.siblings.push(reader.bytes());
2638
2668
  continue;
2639
2669
  }
2640
- if ((tag & 7) == 4 || tag == 0) {
2670
+ if ((tag & 7) === 4 || tag === 0) {
2641
2671
  break;
2642
2672
  }
2643
2673
  reader.skipType(tag & 7);
@@ -2646,23 +2676,29 @@ var ProofEthereumAccount = {
2646
2676
  },
2647
2677
  fromJSON(object) {
2648
2678
  return {
2649
- nonce: isSet(object.nonce) ? bytesFromBase64(object.nonce) : new Uint8Array(),
2650
- balance: isSet(object.balance) ? bytesFromBase64(object.balance) : new Uint8Array(),
2651
- storageHash: isSet(object.storageHash) ? bytesFromBase64(object.storageHash) : new Uint8Array(),
2652
- codeHash: isSet(object.codeHash) ? bytesFromBase64(object.codeHash) : new Uint8Array(),
2679
+ nonce: isSet(object.nonce) ? bytesFromBase64(object.nonce) : new Uint8Array(0),
2680
+ balance: isSet(object.balance) ? bytesFromBase64(object.balance) : new Uint8Array(0),
2681
+ storageHash: isSet(object.storageHash) ? bytesFromBase64(object.storageHash) : new Uint8Array(0),
2682
+ codeHash: isSet(object.codeHash) ? bytesFromBase64(object.codeHash) : new Uint8Array(0),
2653
2683
  siblings: Array.isArray(object?.siblings) ? object.siblings.map((e) => bytesFromBase64(e)) : []
2654
2684
  };
2655
2685
  },
2656
2686
  toJSON(message) {
2657
2687
  const obj = {};
2658
- message.nonce !== void 0 && (obj.nonce = base64FromBytes(message.nonce !== void 0 ? message.nonce : new Uint8Array()));
2659
- message.balance !== void 0 && (obj.balance = base64FromBytes(message.balance !== void 0 ? message.balance : new Uint8Array()));
2660
- message.storageHash !== void 0 && (obj.storageHash = base64FromBytes(message.storageHash !== void 0 ? message.storageHash : new Uint8Array()));
2661
- message.codeHash !== void 0 && (obj.codeHash = base64FromBytes(message.codeHash !== void 0 ? message.codeHash : new Uint8Array()));
2662
- if (message.siblings) {
2663
- obj.siblings = message.siblings.map((e) => base64FromBytes(e !== void 0 ? e : new Uint8Array()));
2664
- } else {
2665
- obj.siblings = [];
2688
+ if (message.nonce.length !== 0) {
2689
+ obj.nonce = base64FromBytes(message.nonce);
2690
+ }
2691
+ if (message.balance.length !== 0) {
2692
+ obj.balance = base64FromBytes(message.balance);
2693
+ }
2694
+ if (message.storageHash.length !== 0) {
2695
+ obj.storageHash = base64FromBytes(message.storageHash);
2696
+ }
2697
+ if (message.codeHash.length !== 0) {
2698
+ obj.codeHash = base64FromBytes(message.codeHash);
2699
+ }
2700
+ if (message.siblings?.length) {
2701
+ obj.siblings = message.siblings.map((e) => base64FromBytes(e));
2666
2702
  }
2667
2703
  return obj;
2668
2704
  },
@@ -2671,10 +2707,10 @@ var ProofEthereumAccount = {
2671
2707
  },
2672
2708
  fromPartial(object) {
2673
2709
  const message = createBaseProofEthereumAccount();
2674
- message.nonce = object.nonce ?? new Uint8Array();
2675
- message.balance = object.balance ?? new Uint8Array();
2676
- message.storageHash = object.storageHash ?? new Uint8Array();
2677
- message.codeHash = object.codeHash ?? new Uint8Array();
2710
+ message.nonce = object.nonce ?? new Uint8Array(0);
2711
+ message.balance = object.balance ?? new Uint8Array(0);
2712
+ message.storageHash = object.storageHash ?? new Uint8Array(0);
2713
+ message.codeHash = object.codeHash ?? new Uint8Array(0);
2678
2714
  message.siblings = object.siblings?.map((e) => e) || [];
2679
2715
  return message;
2680
2716
  }
@@ -2700,19 +2736,19 @@ var ProofMinime = {
2700
2736
  const tag = reader.uint32();
2701
2737
  switch (tag >>> 3) {
2702
2738
  case 1:
2703
- if (tag != 10) {
2739
+ if (tag !== 10) {
2704
2740
  break;
2705
2741
  }
2706
2742
  message.proofPrevBlock = ProofEthereumStorage.decode(reader, reader.uint32());
2707
2743
  continue;
2708
2744
  case 2:
2709
- if (tag != 18) {
2745
+ if (tag !== 18) {
2710
2746
  break;
2711
2747
  }
2712
2748
  message.proofNextBlock = ProofEthereumStorage.decode(reader, reader.uint32());
2713
2749
  continue;
2714
2750
  }
2715
- if ((tag & 7) == 4 || tag == 0) {
2751
+ if ((tag & 7) === 4 || tag === 0) {
2716
2752
  break;
2717
2753
  }
2718
2754
  reader.skipType(tag & 7);
@@ -2727,8 +2763,12 @@ var ProofMinime = {
2727
2763
  },
2728
2764
  toJSON(message) {
2729
2765
  const obj = {};
2730
- message.proofPrevBlock !== void 0 && (obj.proofPrevBlock = message.proofPrevBlock ? ProofEthereumStorage.toJSON(message.proofPrevBlock) : void 0);
2731
- message.proofNextBlock !== void 0 && (obj.proofNextBlock = message.proofNextBlock ? ProofEthereumStorage.toJSON(message.proofNextBlock) : void 0);
2766
+ if (message.proofPrevBlock !== void 0) {
2767
+ obj.proofPrevBlock = ProofEthereumStorage.toJSON(message.proofPrevBlock);
2768
+ }
2769
+ if (message.proofNextBlock !== void 0) {
2770
+ obj.proofNextBlock = ProofEthereumStorage.toJSON(message.proofNextBlock);
2771
+ }
2732
2772
  return obj;
2733
2773
  },
2734
2774
  create(base) {
@@ -2742,7 +2782,7 @@ var ProofMinime = {
2742
2782
  }
2743
2783
  };
2744
2784
  function createBaseProofCA() {
2745
- return { type: 0, bundle: void 0, signature: new Uint8Array() };
2785
+ return { type: 0, bundle: void 0, signature: new Uint8Array(0) };
2746
2786
  }
2747
2787
  var ProofCA = {
2748
2788
  encode(message, writer = import_minimal.default.Writer.create()) {
@@ -2765,25 +2805,25 @@ var ProofCA = {
2765
2805
  const tag = reader.uint32();
2766
2806
  switch (tag >>> 3) {
2767
2807
  case 1:
2768
- if (tag != 8) {
2808
+ if (tag !== 8) {
2769
2809
  break;
2770
2810
  }
2771
2811
  message.type = reader.int32();
2772
2812
  continue;
2773
2813
  case 2:
2774
- if (tag != 18) {
2814
+ if (tag !== 18) {
2775
2815
  break;
2776
2816
  }
2777
2817
  message.bundle = CAbundle.decode(reader, reader.uint32());
2778
2818
  continue;
2779
2819
  case 3:
2780
- if (tag != 26) {
2820
+ if (tag !== 26) {
2781
2821
  break;
2782
2822
  }
2783
2823
  message.signature = reader.bytes();
2784
2824
  continue;
2785
2825
  }
2786
- if ((tag & 7) == 4 || tag == 0) {
2826
+ if ((tag & 7) === 4 || tag === 0) {
2787
2827
  break;
2788
2828
  }
2789
2829
  reader.skipType(tag & 7);
@@ -2794,14 +2834,20 @@ var ProofCA = {
2794
2834
  return {
2795
2835
  type: isSet(object.type) ? proofCA_TypeFromJSON(object.type) : 0,
2796
2836
  bundle: isSet(object.bundle) ? CAbundle.fromJSON(object.bundle) : void 0,
2797
- signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array()
2837
+ signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array(0)
2798
2838
  };
2799
2839
  },
2800
2840
  toJSON(message) {
2801
2841
  const obj = {};
2802
- message.type !== void 0 && (obj.type = proofCA_TypeToJSON(message.type));
2803
- message.bundle !== void 0 && (obj.bundle = message.bundle ? CAbundle.toJSON(message.bundle) : void 0);
2804
- message.signature !== void 0 && (obj.signature = base64FromBytes(message.signature !== void 0 ? message.signature : new Uint8Array()));
2842
+ if (message.type !== 0) {
2843
+ obj.type = proofCA_TypeToJSON(message.type);
2844
+ }
2845
+ if (message.bundle !== void 0) {
2846
+ obj.bundle = CAbundle.toJSON(message.bundle);
2847
+ }
2848
+ if (message.signature.length !== 0) {
2849
+ obj.signature = base64FromBytes(message.signature);
2850
+ }
2805
2851
  return obj;
2806
2852
  },
2807
2853
  create(base) {
@@ -2811,12 +2857,12 @@ var ProofCA = {
2811
2857
  const message = createBaseProofCA();
2812
2858
  message.type = object.type ?? 0;
2813
2859
  message.bundle = object.bundle !== void 0 && object.bundle !== null ? CAbundle.fromPartial(object.bundle) : void 0;
2814
- message.signature = object.signature ?? new Uint8Array();
2860
+ message.signature = object.signature ?? new Uint8Array(0);
2815
2861
  return message;
2816
2862
  }
2817
2863
  };
2818
2864
  function createBaseCAbundle() {
2819
- return { processId: new Uint8Array(), address: new Uint8Array() };
2865
+ return { processId: new Uint8Array(0), address: new Uint8Array(0) };
2820
2866
  }
2821
2867
  var CAbundle = {
2822
2868
  encode(message, writer = import_minimal.default.Writer.create()) {
@@ -2836,19 +2882,19 @@ var CAbundle = {
2836
2882
  const tag = reader.uint32();
2837
2883
  switch (tag >>> 3) {
2838
2884
  case 1:
2839
- if (tag != 10) {
2885
+ if (tag !== 10) {
2840
2886
  break;
2841
2887
  }
2842
2888
  message.processId = reader.bytes();
2843
2889
  continue;
2844
2890
  case 2:
2845
- if (tag != 18) {
2891
+ if (tag !== 18) {
2846
2892
  break;
2847
2893
  }
2848
2894
  message.address = reader.bytes();
2849
2895
  continue;
2850
2896
  }
2851
- if ((tag & 7) == 4 || tag == 0) {
2897
+ if ((tag & 7) === 4 || tag === 0) {
2852
2898
  break;
2853
2899
  }
2854
2900
  reader.skipType(tag & 7);
@@ -2857,14 +2903,18 @@ var CAbundle = {
2857
2903
  },
2858
2904
  fromJSON(object) {
2859
2905
  return {
2860
- processId: isSet(object.processId) ? bytesFromBase64(object.processId) : new Uint8Array(),
2861
- address: isSet(object.address) ? bytesFromBase64(object.address) : new Uint8Array()
2906
+ processId: isSet(object.processId) ? bytesFromBase64(object.processId) : new Uint8Array(0),
2907
+ address: isSet(object.address) ? bytesFromBase64(object.address) : new Uint8Array(0)
2862
2908
  };
2863
2909
  },
2864
2910
  toJSON(message) {
2865
2911
  const obj = {};
2866
- message.processId !== void 0 && (obj.processId = base64FromBytes(message.processId !== void 0 ? message.processId : new Uint8Array()));
2867
- message.address !== void 0 && (obj.address = base64FromBytes(message.address !== void 0 ? message.address : new Uint8Array()));
2912
+ if (message.processId.length !== 0) {
2913
+ obj.processId = base64FromBytes(message.processId);
2914
+ }
2915
+ if (message.address.length !== 0) {
2916
+ obj.address = base64FromBytes(message.address);
2917
+ }
2868
2918
  return obj;
2869
2919
  },
2870
2920
  create(base) {
@@ -2872,18 +2922,18 @@ var CAbundle = {
2872
2922
  },
2873
2923
  fromPartial(object) {
2874
2924
  const message = createBaseCAbundle();
2875
- message.processId = object.processId ?? new Uint8Array();
2876
- message.address = object.address ?? new Uint8Array();
2925
+ message.processId = object.processId ?? new Uint8Array(0);
2926
+ message.address = object.address ?? new Uint8Array(0);
2877
2927
  return message;
2878
2928
  }
2879
2929
  };
2880
2930
  function createBaseProofArbo() {
2881
2931
  return {
2882
2932
  type: 0,
2883
- siblings: new Uint8Array(),
2884
- leafWeight: new Uint8Array(),
2933
+ siblings: new Uint8Array(0),
2934
+ leafWeight: new Uint8Array(0),
2885
2935
  keyType: 0,
2886
- votingWeight: new Uint8Array()
2936
+ votingWeight: new Uint8Array(0)
2887
2937
  };
2888
2938
  }
2889
2939
  var ProofArbo = {
@@ -2913,37 +2963,37 @@ var ProofArbo = {
2913
2963
  const tag = reader.uint32();
2914
2964
  switch (tag >>> 3) {
2915
2965
  case 1:
2916
- if (tag != 8) {
2966
+ if (tag !== 8) {
2917
2967
  break;
2918
2968
  }
2919
2969
  message.type = reader.int32();
2920
2970
  continue;
2921
2971
  case 2:
2922
- if (tag != 18) {
2972
+ if (tag !== 18) {
2923
2973
  break;
2924
2974
  }
2925
2975
  message.siblings = reader.bytes();
2926
2976
  continue;
2927
2977
  case 3:
2928
- if (tag != 26) {
2978
+ if (tag !== 26) {
2929
2979
  break;
2930
2980
  }
2931
2981
  message.leafWeight = reader.bytes();
2932
2982
  continue;
2933
2983
  case 4:
2934
- if (tag != 32) {
2984
+ if (tag !== 32) {
2935
2985
  break;
2936
2986
  }
2937
2987
  message.keyType = reader.int32();
2938
2988
  continue;
2939
2989
  case 5:
2940
- if (tag != 42) {
2990
+ if (tag !== 42) {
2941
2991
  break;
2942
2992
  }
2943
2993
  message.votingWeight = reader.bytes();
2944
2994
  continue;
2945
2995
  }
2946
- if ((tag & 7) == 4 || tag == 0) {
2996
+ if ((tag & 7) === 4 || tag === 0) {
2947
2997
  break;
2948
2998
  }
2949
2999
  reader.skipType(tag & 7);
@@ -2953,21 +3003,29 @@ var ProofArbo = {
2953
3003
  fromJSON(object) {
2954
3004
  return {
2955
3005
  type: isSet(object.type) ? proofArbo_TypeFromJSON(object.type) : 0,
2956
- siblings: isSet(object.siblings) ? bytesFromBase64(object.siblings) : new Uint8Array(),
2957
- leafWeight: isSet(object.leafWeight) ? bytesFromBase64(object.leafWeight) : new Uint8Array(),
3006
+ siblings: isSet(object.siblings) ? bytesFromBase64(object.siblings) : new Uint8Array(0),
3007
+ leafWeight: isSet(object.leafWeight) ? bytesFromBase64(object.leafWeight) : new Uint8Array(0),
2958
3008
  keyType: isSet(object.keyType) ? proofArbo_KeyTypeFromJSON(object.keyType) : 0,
2959
- votingWeight: isSet(object.votingWeight) ? bytesFromBase64(object.votingWeight) : new Uint8Array()
3009
+ votingWeight: isSet(object.votingWeight) ? bytesFromBase64(object.votingWeight) : new Uint8Array(0)
2960
3010
  };
2961
3011
  },
2962
3012
  toJSON(message) {
2963
3013
  const obj = {};
2964
- message.type !== void 0 && (obj.type = proofArbo_TypeToJSON(message.type));
2965
- message.siblings !== void 0 && (obj.siblings = base64FromBytes(message.siblings !== void 0 ? message.siblings : new Uint8Array()));
2966
- message.leafWeight !== void 0 && (obj.leafWeight = base64FromBytes(message.leafWeight !== void 0 ? message.leafWeight : new Uint8Array()));
2967
- message.keyType !== void 0 && (obj.keyType = proofArbo_KeyTypeToJSON(message.keyType));
2968
- message.votingWeight !== void 0 && (obj.votingWeight = base64FromBytes(
2969
- message.votingWeight !== void 0 ? message.votingWeight : new Uint8Array()
2970
- ));
3014
+ if (message.type !== 0) {
3015
+ obj.type = proofArbo_TypeToJSON(message.type);
3016
+ }
3017
+ if (message.siblings.length !== 0) {
3018
+ obj.siblings = base64FromBytes(message.siblings);
3019
+ }
3020
+ if (message.leafWeight.length !== 0) {
3021
+ obj.leafWeight = base64FromBytes(message.leafWeight);
3022
+ }
3023
+ if (message.keyType !== 0) {
3024
+ obj.keyType = proofArbo_KeyTypeToJSON(message.keyType);
3025
+ }
3026
+ if (message.votingWeight.length !== 0) {
3027
+ obj.votingWeight = base64FromBytes(message.votingWeight);
3028
+ }
2971
3029
  return obj;
2972
3030
  },
2973
3031
  create(base) {
@@ -2976,10 +3034,10 @@ var ProofArbo = {
2976
3034
  fromPartial(object) {
2977
3035
  const message = createBaseProofArbo();
2978
3036
  message.type = object.type ?? 0;
2979
- message.siblings = object.siblings ?? new Uint8Array();
2980
- message.leafWeight = object.leafWeight ?? new Uint8Array();
3037
+ message.siblings = object.siblings ?? new Uint8Array(0);
3038
+ message.leafWeight = object.leafWeight ?? new Uint8Array(0);
2981
3039
  message.keyType = object.keyType ?? 0;
2982
- message.votingWeight = object.votingWeight ?? new Uint8Array();
3040
+ message.votingWeight = object.votingWeight ?? new Uint8Array(0);
2983
3041
  return message;
2984
3042
  }
2985
3043
  };
@@ -3013,37 +3071,37 @@ var ProofZkSNARK = {
3013
3071
  const tag = reader.uint32();
3014
3072
  switch (tag >>> 3) {
3015
3073
  case 1:
3016
- if (tag != 8) {
3074
+ if (tag !== 8) {
3017
3075
  break;
3018
3076
  }
3019
3077
  message.circuitParametersIndex = reader.int32();
3020
3078
  continue;
3021
3079
  case 2:
3022
- if (tag != 18) {
3080
+ if (tag !== 18) {
3023
3081
  break;
3024
3082
  }
3025
3083
  message.a.push(reader.string());
3026
3084
  continue;
3027
3085
  case 3:
3028
- if (tag != 26) {
3086
+ if (tag !== 26) {
3029
3087
  break;
3030
3088
  }
3031
3089
  message.b.push(reader.string());
3032
3090
  continue;
3033
3091
  case 4:
3034
- if (tag != 34) {
3092
+ if (tag !== 34) {
3035
3093
  break;
3036
3094
  }
3037
3095
  message.c.push(reader.string());
3038
3096
  continue;
3039
3097
  case 5:
3040
- if (tag != 42) {
3098
+ if (tag !== 42) {
3041
3099
  break;
3042
3100
  }
3043
3101
  message.publicInputs.push(reader.string());
3044
3102
  continue;
3045
3103
  }
3046
- if ((tag & 7) == 4 || tag == 0) {
3104
+ if ((tag & 7) === 4 || tag === 0) {
3047
3105
  break;
3048
3106
  }
3049
3107
  reader.skipType(tag & 7);
@@ -3061,26 +3119,20 @@ var ProofZkSNARK = {
3061
3119
  },
3062
3120
  toJSON(message) {
3063
3121
  const obj = {};
3064
- message.circuitParametersIndex !== void 0 && (obj.circuitParametersIndex = Math.round(message.circuitParametersIndex));
3065
- if (message.a) {
3066
- obj.a = message.a.map((e) => e);
3067
- } else {
3068
- obj.a = [];
3069
- }
3070
- if (message.b) {
3071
- obj.b = message.b.map((e) => e);
3072
- } else {
3073
- obj.b = [];
3074
- }
3075
- if (message.c) {
3076
- obj.c = message.c.map((e) => e);
3077
- } else {
3078
- obj.c = [];
3079
- }
3080
- if (message.publicInputs) {
3081
- obj.publicInputs = message.publicInputs.map((e) => e);
3082
- } else {
3083
- obj.publicInputs = [];
3122
+ if (message.circuitParametersIndex !== 0) {
3123
+ obj.circuitParametersIndex = Math.round(message.circuitParametersIndex);
3124
+ }
3125
+ if (message.a?.length) {
3126
+ obj.a = message.a;
3127
+ }
3128
+ if (message.b?.length) {
3129
+ obj.b = message.b;
3130
+ }
3131
+ if (message.c?.length) {
3132
+ obj.c = message.c;
3133
+ }
3134
+ if (message.publicInputs?.length) {
3135
+ obj.publicInputs = message.publicInputs;
3084
3136
  }
3085
3137
  return obj;
3086
3138
  },
@@ -3127,37 +3179,37 @@ var Account = {
3127
3179
  const tag = reader.uint32();
3128
3180
  switch (tag >>> 3) {
3129
3181
  case 1:
3130
- if (tag != 8) {
3182
+ if (tag !== 8) {
3131
3183
  break;
3132
3184
  }
3133
3185
  message.balance = longToNumber(reader.uint64());
3134
3186
  continue;
3135
3187
  case 2:
3136
- if (tag != 16) {
3188
+ if (tag !== 16) {
3137
3189
  break;
3138
3190
  }
3139
3191
  message.nonce = reader.uint32();
3140
3192
  continue;
3141
3193
  case 3:
3142
- if (tag != 26) {
3194
+ if (tag !== 26) {
3143
3195
  break;
3144
3196
  }
3145
3197
  message.infoURI = reader.string();
3146
3198
  continue;
3147
3199
  case 4:
3148
- if (tag != 34) {
3200
+ if (tag !== 34) {
3149
3201
  break;
3150
3202
  }
3151
3203
  message.delegateAddrs.push(reader.bytes());
3152
3204
  continue;
3153
3205
  case 5:
3154
- if (tag != 40) {
3206
+ if (tag !== 40) {
3155
3207
  break;
3156
3208
  }
3157
3209
  message.processIndex = reader.uint32();
3158
3210
  continue;
3159
3211
  }
3160
- if ((tag & 7) == 4 || tag == 0) {
3212
+ if ((tag & 7) === 4 || tag === 0) {
3161
3213
  break;
3162
3214
  }
3163
3215
  reader.skipType(tag & 7);
@@ -3175,15 +3227,21 @@ var Account = {
3175
3227
  },
3176
3228
  toJSON(message) {
3177
3229
  const obj = {};
3178
- message.balance !== void 0 && (obj.balance = Math.round(message.balance));
3179
- message.nonce !== void 0 && (obj.nonce = Math.round(message.nonce));
3180
- message.infoURI !== void 0 && (obj.infoURI = message.infoURI);
3181
- if (message.delegateAddrs) {
3182
- obj.delegateAddrs = message.delegateAddrs.map((e) => base64FromBytes(e !== void 0 ? e : new Uint8Array()));
3183
- } else {
3184
- obj.delegateAddrs = [];
3185
- }
3186
- message.processIndex !== void 0 && (obj.processIndex = Math.round(message.processIndex));
3230
+ if (message.balance !== 0) {
3231
+ obj.balance = Math.round(message.balance);
3232
+ }
3233
+ if (message.nonce !== 0) {
3234
+ obj.nonce = Math.round(message.nonce);
3235
+ }
3236
+ if (message.infoURI !== "") {
3237
+ obj.infoURI = message.infoURI;
3238
+ }
3239
+ if (message.delegateAddrs?.length) {
3240
+ obj.delegateAddrs = message.delegateAddrs.map((e) => base64FromBytes(e));
3241
+ }
3242
+ if (message.processIndex !== 0) {
3243
+ obj.processIndex = Math.round(message.processIndex);
3244
+ }
3187
3245
  return obj;
3188
3246
  },
3189
3247
  create(base) {
@@ -3200,7 +3258,7 @@ var Account = {
3200
3258
  }
3201
3259
  };
3202
3260
  function createBaseTreasurer() {
3203
- return { address: new Uint8Array(), nonce: 0 };
3261
+ return { address: new Uint8Array(0), nonce: 0 };
3204
3262
  }
3205
3263
  var Treasurer = {
3206
3264
  encode(message, writer = import_minimal.default.Writer.create()) {
@@ -3220,19 +3278,19 @@ var Treasurer = {
3220
3278
  const tag = reader.uint32();
3221
3279
  switch (tag >>> 3) {
3222
3280
  case 1:
3223
- if (tag != 10) {
3281
+ if (tag !== 10) {
3224
3282
  break;
3225
3283
  }
3226
3284
  message.address = reader.bytes();
3227
3285
  continue;
3228
3286
  case 2:
3229
- if (tag != 16) {
3287
+ if (tag !== 16) {
3230
3288
  break;
3231
3289
  }
3232
3290
  message.nonce = reader.uint32();
3233
3291
  continue;
3234
3292
  }
3235
- if ((tag & 7) == 4 || tag == 0) {
3293
+ if ((tag & 7) === 4 || tag === 0) {
3236
3294
  break;
3237
3295
  }
3238
3296
  reader.skipType(tag & 7);
@@ -3241,14 +3299,18 @@ var Treasurer = {
3241
3299
  },
3242
3300
  fromJSON(object) {
3243
3301
  return {
3244
- address: isSet(object.address) ? bytesFromBase64(object.address) : new Uint8Array(),
3302
+ address: isSet(object.address) ? bytesFromBase64(object.address) : new Uint8Array(0),
3245
3303
  nonce: isSet(object.nonce) ? Number(object.nonce) : 0
3246
3304
  };
3247
3305
  },
3248
3306
  toJSON(message) {
3249
3307
  const obj = {};
3250
- message.address !== void 0 && (obj.address = base64FromBytes(message.address !== void 0 ? message.address : new Uint8Array()));
3251
- message.nonce !== void 0 && (obj.nonce = Math.round(message.nonce));
3308
+ if (message.address.length !== 0) {
3309
+ obj.address = base64FromBytes(message.address);
3310
+ }
3311
+ if (message.nonce !== 0) {
3312
+ obj.nonce = Math.round(message.nonce);
3313
+ }
3252
3314
  return obj;
3253
3315
  },
3254
3316
  create(base) {
@@ -3256,7 +3318,7 @@ var Treasurer = {
3256
3318
  },
3257
3319
  fromPartial(object) {
3258
3320
  const message = createBaseTreasurer();
3259
- message.address = object.address ?? new Uint8Array();
3321
+ message.address = object.address ?? new Uint8Array(0);
3260
3322
  message.nonce = object.nonce ?? 0;
3261
3323
  return message;
3262
3324
  }
@@ -3311,49 +3373,49 @@ var Tx = {
3311
3373
  const tag = reader.uint32();
3312
3374
  switch (tag >>> 3) {
3313
3375
  case 1:
3314
- if (tag != 10) {
3376
+ if (tag !== 10) {
3315
3377
  break;
3316
3378
  }
3317
3379
  message.payload = { $case: "vote", vote: VoteEnvelope.decode(reader, reader.uint32()) };
3318
3380
  continue;
3319
3381
  case 2:
3320
- if (tag != 18) {
3382
+ if (tag !== 18) {
3321
3383
  break;
3322
3384
  }
3323
3385
  message.payload = { $case: "newProcess", newProcess: NewProcessTx.decode(reader, reader.uint32()) };
3324
3386
  continue;
3325
3387
  case 3:
3326
- if (tag != 26) {
3388
+ if (tag !== 26) {
3327
3389
  break;
3328
3390
  }
3329
3391
  message.payload = { $case: "admin", admin: AdminTx.decode(reader, reader.uint32()) };
3330
3392
  continue;
3331
3393
  case 4:
3332
- if (tag != 34) {
3394
+ if (tag !== 34) {
3333
3395
  break;
3334
3396
  }
3335
3397
  message.payload = { $case: "setProcess", setProcess: SetProcessTx.decode(reader, reader.uint32()) };
3336
3398
  continue;
3337
3399
  case 5:
3338
- if (tag != 42) {
3400
+ if (tag !== 42) {
3339
3401
  break;
3340
3402
  }
3341
3403
  message.payload = { $case: "registerKey", registerKey: RegisterKeyTx.decode(reader, reader.uint32()) };
3342
3404
  continue;
3343
3405
  case 6:
3344
- if (tag != 50) {
3406
+ if (tag !== 50) {
3345
3407
  break;
3346
3408
  }
3347
3409
  message.payload = { $case: "mintTokens", mintTokens: MintTokensTx.decode(reader, reader.uint32()) };
3348
3410
  continue;
3349
3411
  case 7:
3350
- if (tag != 58) {
3412
+ if (tag !== 58) {
3351
3413
  break;
3352
3414
  }
3353
3415
  message.payload = { $case: "sendTokens", sendTokens: SendTokensTx.decode(reader, reader.uint32()) };
3354
3416
  continue;
3355
3417
  case 8:
3356
- if (tag != 66) {
3418
+ if (tag !== 66) {
3357
3419
  break;
3358
3420
  }
3359
3421
  message.payload = {
@@ -3362,25 +3424,25 @@ var Tx = {
3362
3424
  };
3363
3425
  continue;
3364
3426
  case 9:
3365
- if (tag != 74) {
3427
+ if (tag !== 74) {
3366
3428
  break;
3367
3429
  }
3368
3430
  message.payload = { $case: "setAccount", setAccount: SetAccountTx.decode(reader, reader.uint32()) };
3369
3431
  continue;
3370
3432
  case 10:
3371
- if (tag != 82) {
3433
+ if (tag !== 82) {
3372
3434
  break;
3373
3435
  }
3374
3436
  message.payload = { $case: "collectFaucet", collectFaucet: CollectFaucetTx.decode(reader, reader.uint32()) };
3375
3437
  continue;
3376
3438
  case 11:
3377
- if (tag != 90) {
3439
+ if (tag !== 90) {
3378
3440
  break;
3379
3441
  }
3380
3442
  message.payload = { $case: "setKeykeeper", setKeykeeper: SetKeykeeperTx.decode(reader, reader.uint32()) };
3381
3443
  continue;
3382
3444
  }
3383
- if ((tag & 7) == 4 || tag == 0) {
3445
+ if ((tag & 7) === 4 || tag === 0) {
3384
3446
  break;
3385
3447
  }
3386
3448
  reader.skipType(tag & 7);
@@ -3397,17 +3459,39 @@ var Tx = {
3397
3459
  },
3398
3460
  toJSON(message) {
3399
3461
  const obj = {};
3400
- message.payload?.$case === "vote" && (obj.vote = message.payload?.vote ? VoteEnvelope.toJSON(message.payload?.vote) : void 0);
3401
- message.payload?.$case === "newProcess" && (obj.newProcess = message.payload?.newProcess ? NewProcessTx.toJSON(message.payload?.newProcess) : void 0);
3402
- message.payload?.$case === "admin" && (obj.admin = message.payload?.admin ? AdminTx.toJSON(message.payload?.admin) : void 0);
3403
- message.payload?.$case === "setProcess" && (obj.setProcess = message.payload?.setProcess ? SetProcessTx.toJSON(message.payload?.setProcess) : void 0);
3404
- message.payload?.$case === "registerKey" && (obj.registerKey = message.payload?.registerKey ? RegisterKeyTx.toJSON(message.payload?.registerKey) : void 0);
3405
- message.payload?.$case === "mintTokens" && (obj.mintTokens = message.payload?.mintTokens ? MintTokensTx.toJSON(message.payload?.mintTokens) : void 0);
3406
- message.payload?.$case === "sendTokens" && (obj.sendTokens = message.payload?.sendTokens ? SendTokensTx.toJSON(message.payload?.sendTokens) : void 0);
3407
- message.payload?.$case === "setTransactionCosts" && (obj.setTransactionCosts = message.payload?.setTransactionCosts ? SetTransactionCostsTx.toJSON(message.payload?.setTransactionCosts) : void 0);
3408
- message.payload?.$case === "setAccount" && (obj.setAccount = message.payload?.setAccount ? SetAccountTx.toJSON(message.payload?.setAccount) : void 0);
3409
- message.payload?.$case === "collectFaucet" && (obj.collectFaucet = message.payload?.collectFaucet ? CollectFaucetTx.toJSON(message.payload?.collectFaucet) : void 0);
3410
- message.payload?.$case === "setKeykeeper" && (obj.setKeykeeper = message.payload?.setKeykeeper ? SetKeykeeperTx.toJSON(message.payload?.setKeykeeper) : void 0);
3462
+ if (message.payload?.$case === "vote") {
3463
+ obj.vote = VoteEnvelope.toJSON(message.payload.vote);
3464
+ }
3465
+ if (message.payload?.$case === "newProcess") {
3466
+ obj.newProcess = NewProcessTx.toJSON(message.payload.newProcess);
3467
+ }
3468
+ if (message.payload?.$case === "admin") {
3469
+ obj.admin = AdminTx.toJSON(message.payload.admin);
3470
+ }
3471
+ if (message.payload?.$case === "setProcess") {
3472
+ obj.setProcess = SetProcessTx.toJSON(message.payload.setProcess);
3473
+ }
3474
+ if (message.payload?.$case === "registerKey") {
3475
+ obj.registerKey = RegisterKeyTx.toJSON(message.payload.registerKey);
3476
+ }
3477
+ if (message.payload?.$case === "mintTokens") {
3478
+ obj.mintTokens = MintTokensTx.toJSON(message.payload.mintTokens);
3479
+ }
3480
+ if (message.payload?.$case === "sendTokens") {
3481
+ obj.sendTokens = SendTokensTx.toJSON(message.payload.sendTokens);
3482
+ }
3483
+ if (message.payload?.$case === "setTransactionCosts") {
3484
+ obj.setTransactionCosts = SetTransactionCostsTx.toJSON(message.payload.setTransactionCosts);
3485
+ }
3486
+ if (message.payload?.$case === "setAccount") {
3487
+ obj.setAccount = SetAccountTx.toJSON(message.payload.setAccount);
3488
+ }
3489
+ if (message.payload?.$case === "collectFaucet") {
3490
+ obj.collectFaucet = CollectFaucetTx.toJSON(message.payload.collectFaucet);
3491
+ }
3492
+ if (message.payload?.$case === "setKeykeeper") {
3493
+ obj.setKeykeeper = SetKeykeeperTx.toJSON(message.payload.setKeykeeper);
3494
+ }
3411
3495
  return obj;
3412
3496
  },
3413
3497
  create(base) {
@@ -3461,7 +3545,7 @@ var Tx = {
3461
3545
  }
3462
3546
  };
3463
3547
  function createBaseSignedTx() {
3464
- return { tx: new Uint8Array(), signature: void 0 };
3548
+ return { tx: new Uint8Array(0), signature: void 0 };
3465
3549
  }
3466
3550
  var SignedTx = {
3467
3551
  encode(message, writer = import_minimal.default.Writer.create()) {
@@ -3481,19 +3565,19 @@ var SignedTx = {
3481
3565
  const tag = reader.uint32();
3482
3566
  switch (tag >>> 3) {
3483
3567
  case 1:
3484
- if (tag != 10) {
3568
+ if (tag !== 10) {
3485
3569
  break;
3486
3570
  }
3487
3571
  message.tx = reader.bytes();
3488
3572
  continue;
3489
3573
  case 2:
3490
- if (tag != 18) {
3574
+ if (tag !== 18) {
3491
3575
  break;
3492
3576
  }
3493
3577
  message.signature = reader.bytes();
3494
3578
  continue;
3495
3579
  }
3496
- if ((tag & 7) == 4 || tag == 0) {
3580
+ if ((tag & 7) === 4 || tag === 0) {
3497
3581
  break;
3498
3582
  }
3499
3583
  reader.skipType(tag & 7);
@@ -3502,14 +3586,18 @@ var SignedTx = {
3502
3586
  },
3503
3587
  fromJSON(object) {
3504
3588
  return {
3505
- tx: isSet(object.tx) ? bytesFromBase64(object.tx) : new Uint8Array(),
3589
+ tx: isSet(object.tx) ? bytesFromBase64(object.tx) : new Uint8Array(0),
3506
3590
  signature: isSet(object.signature) ? bytesFromBase64(object.signature) : void 0
3507
3591
  };
3508
3592
  },
3509
3593
  toJSON(message) {
3510
3594
  const obj = {};
3511
- message.tx !== void 0 && (obj.tx = base64FromBytes(message.tx !== void 0 ? message.tx : new Uint8Array()));
3512
- message.signature !== void 0 && (obj.signature = message.signature !== void 0 ? base64FromBytes(message.signature) : void 0);
3595
+ if (message.tx.length !== 0) {
3596
+ obj.tx = base64FromBytes(message.tx);
3597
+ }
3598
+ if (message.signature !== void 0) {
3599
+ obj.signature = base64FromBytes(message.signature);
3600
+ }
3513
3601
  return obj;
3514
3602
  },
3515
3603
  create(base) {
@@ -3517,7 +3605,7 @@ var SignedTx = {
3517
3605
  },
3518
3606
  fromPartial(object) {
3519
3607
  const message = createBaseSignedTx();
3520
- message.tx = object.tx ?? new Uint8Array();
3608
+ message.tx = object.tx ?? new Uint8Array(0);
3521
3609
  message.signature = object.signature ?? void 0;
3522
3610
  return message;
3523
3611
  }
@@ -3546,25 +3634,25 @@ var NewProcessTx = {
3546
3634
  const tag = reader.uint32();
3547
3635
  switch (tag >>> 3) {
3548
3636
  case 1:
3549
- if (tag != 8) {
3637
+ if (tag !== 8) {
3550
3638
  break;
3551
3639
  }
3552
3640
  message.txtype = reader.int32();
3553
3641
  continue;
3554
3642
  case 2:
3555
- if (tag != 16) {
3643
+ if (tag !== 16) {
3556
3644
  break;
3557
3645
  }
3558
3646
  message.nonce = reader.uint32();
3559
3647
  continue;
3560
3648
  case 3:
3561
- if (tag != 26) {
3649
+ if (tag !== 26) {
3562
3650
  break;
3563
3651
  }
3564
3652
  message.process = Process.decode(reader, reader.uint32());
3565
3653
  continue;
3566
3654
  }
3567
- if ((tag & 7) == 4 || tag == 0) {
3655
+ if ((tag & 7) === 4 || tag === 0) {
3568
3656
  break;
3569
3657
  }
3570
3658
  reader.skipType(tag & 7);
@@ -3580,9 +3668,15 @@ var NewProcessTx = {
3580
3668
  },
3581
3669
  toJSON(message) {
3582
3670
  const obj = {};
3583
- message.txtype !== void 0 && (obj.txtype = txTypeToJSON(message.txtype));
3584
- message.nonce !== void 0 && (obj.nonce = Math.round(message.nonce));
3585
- message.process !== void 0 && (obj.process = message.process ? Process.toJSON(message.process) : void 0);
3671
+ if (message.txtype !== 0) {
3672
+ obj.txtype = txTypeToJSON(message.txtype);
3673
+ }
3674
+ if (message.nonce !== 0) {
3675
+ obj.nonce = Math.round(message.nonce);
3676
+ }
3677
+ if (message.process !== void 0) {
3678
+ obj.process = Process.toJSON(message.process);
3679
+ }
3586
3680
  return obj;
3587
3681
  },
3588
3682
  create(base) {
@@ -3600,7 +3694,7 @@ function createBaseSetProcessTx() {
3600
3694
  return {
3601
3695
  txtype: 0,
3602
3696
  nonce: 0,
3603
- processId: new Uint8Array(),
3697
+ processId: new Uint8Array(0),
3604
3698
  status: void 0,
3605
3699
  questionIndex: void 0,
3606
3700
  censusRoot: void 0,
@@ -3648,61 +3742,61 @@ var SetProcessTx = {
3648
3742
  const tag = reader.uint32();
3649
3743
  switch (tag >>> 3) {
3650
3744
  case 1:
3651
- if (tag != 8) {
3745
+ if (tag !== 8) {
3652
3746
  break;
3653
3747
  }
3654
3748
  message.txtype = reader.int32();
3655
3749
  continue;
3656
3750
  case 2:
3657
- if (tag != 16) {
3751
+ if (tag !== 16) {
3658
3752
  break;
3659
3753
  }
3660
3754
  message.nonce = reader.uint32();
3661
3755
  continue;
3662
3756
  case 3:
3663
- if (tag != 26) {
3757
+ if (tag !== 26) {
3664
3758
  break;
3665
3759
  }
3666
3760
  message.processId = reader.bytes();
3667
3761
  continue;
3668
3762
  case 4:
3669
- if (tag != 32) {
3763
+ if (tag !== 32) {
3670
3764
  break;
3671
3765
  }
3672
3766
  message.status = reader.int32();
3673
3767
  continue;
3674
3768
  case 5:
3675
- if (tag != 40) {
3769
+ if (tag !== 40) {
3676
3770
  break;
3677
3771
  }
3678
3772
  message.questionIndex = reader.uint32();
3679
3773
  continue;
3680
3774
  case 6:
3681
- if (tag != 50) {
3775
+ if (tag !== 50) {
3682
3776
  break;
3683
3777
  }
3684
3778
  message.censusRoot = reader.bytes();
3685
3779
  continue;
3686
3780
  case 7:
3687
- if (tag != 58) {
3781
+ if (tag !== 58) {
3688
3782
  break;
3689
3783
  }
3690
3784
  message.censusURI = reader.string();
3691
3785
  continue;
3692
3786
  case 8:
3693
- if (tag != 66) {
3787
+ if (tag !== 66) {
3694
3788
  break;
3695
3789
  }
3696
3790
  message.proof = Proof.decode(reader, reader.uint32());
3697
3791
  continue;
3698
3792
  case 9:
3699
- if (tag != 74) {
3793
+ if (tag !== 74) {
3700
3794
  break;
3701
3795
  }
3702
3796
  message.results = ProcessResult.decode(reader, reader.uint32());
3703
3797
  continue;
3704
3798
  }
3705
- if ((tag & 7) == 4 || tag == 0) {
3799
+ if ((tag & 7) === 4 || tag === 0) {
3706
3800
  break;
3707
3801
  }
3708
3802
  reader.skipType(tag & 7);
@@ -3713,7 +3807,7 @@ var SetProcessTx = {
3713
3807
  return {
3714
3808
  txtype: isSet(object.txtype) ? txTypeFromJSON(object.txtype) : 0,
3715
3809
  nonce: isSet(object.nonce) ? Number(object.nonce) : 0,
3716
- processId: isSet(object.processId) ? bytesFromBase64(object.processId) : new Uint8Array(),
3810
+ processId: isSet(object.processId) ? bytesFromBase64(object.processId) : new Uint8Array(0),
3717
3811
  status: isSet(object.status) ? processStatusFromJSON(object.status) : void 0,
3718
3812
  questionIndex: isSet(object.questionIndex) ? Number(object.questionIndex) : void 0,
3719
3813
  censusRoot: isSet(object.censusRoot) ? bytesFromBase64(object.censusRoot) : void 0,
@@ -3724,15 +3818,33 @@ var SetProcessTx = {
3724
3818
  },
3725
3819
  toJSON(message) {
3726
3820
  const obj = {};
3727
- message.txtype !== void 0 && (obj.txtype = txTypeToJSON(message.txtype));
3728
- message.nonce !== void 0 && (obj.nonce = Math.round(message.nonce));
3729
- message.processId !== void 0 && (obj.processId = base64FromBytes(message.processId !== void 0 ? message.processId : new Uint8Array()));
3730
- message.status !== void 0 && (obj.status = message.status !== void 0 ? processStatusToJSON(message.status) : void 0);
3731
- message.questionIndex !== void 0 && (obj.questionIndex = Math.round(message.questionIndex));
3732
- message.censusRoot !== void 0 && (obj.censusRoot = message.censusRoot !== void 0 ? base64FromBytes(message.censusRoot) : void 0);
3733
- message.censusURI !== void 0 && (obj.censusURI = message.censusURI);
3734
- message.proof !== void 0 && (obj.proof = message.proof ? Proof.toJSON(message.proof) : void 0);
3735
- message.results !== void 0 && (obj.results = message.results ? ProcessResult.toJSON(message.results) : void 0);
3821
+ if (message.txtype !== 0) {
3822
+ obj.txtype = txTypeToJSON(message.txtype);
3823
+ }
3824
+ if (message.nonce !== 0) {
3825
+ obj.nonce = Math.round(message.nonce);
3826
+ }
3827
+ if (message.processId.length !== 0) {
3828
+ obj.processId = base64FromBytes(message.processId);
3829
+ }
3830
+ if (message.status !== void 0) {
3831
+ obj.status = processStatusToJSON(message.status);
3832
+ }
3833
+ if (message.questionIndex !== void 0) {
3834
+ obj.questionIndex = Math.round(message.questionIndex);
3835
+ }
3836
+ if (message.censusRoot !== void 0) {
3837
+ obj.censusRoot = base64FromBytes(message.censusRoot);
3838
+ }
3839
+ if (message.censusURI !== void 0) {
3840
+ obj.censusURI = message.censusURI;
3841
+ }
3842
+ if (message.proof !== void 0) {
3843
+ obj.proof = Proof.toJSON(message.proof);
3844
+ }
3845
+ if (message.results !== void 0) {
3846
+ obj.results = ProcessResult.toJSON(message.results);
3847
+ }
3736
3848
  return obj;
3737
3849
  },
3738
3850
  create(base) {
@@ -3742,7 +3854,7 @@ var SetProcessTx = {
3742
3854
  const message = createBaseSetProcessTx();
3743
3855
  message.txtype = object.txtype ?? 0;
3744
3856
  message.nonce = object.nonce ?? 0;
3745
- message.processId = object.processId ?? new Uint8Array();
3857
+ message.processId = object.processId ?? new Uint8Array(0);
3746
3858
  message.status = object.status ?? void 0;
3747
3859
  message.questionIndex = object.questionIndex ?? void 0;
3748
3860
  message.censusRoot = object.censusRoot ?? void 0;
@@ -3755,7 +3867,7 @@ var SetProcessTx = {
3755
3867
  function createBaseAdminTx() {
3756
3868
  return {
3757
3869
  txtype: 0,
3758
- processId: new Uint8Array(),
3870
+ processId: new Uint8Array(0),
3759
3871
  address: void 0,
3760
3872
  encryptionPrivateKey: void 0,
3761
3873
  encryptionPublicKey: void 0,
@@ -3804,61 +3916,61 @@ var AdminTx = {
3804
3916
  const tag = reader.uint32();
3805
3917
  switch (tag >>> 3) {
3806
3918
  case 1:
3807
- if (tag != 8) {
3919
+ if (tag !== 8) {
3808
3920
  break;
3809
3921
  }
3810
3922
  message.txtype = reader.int32();
3811
3923
  continue;
3812
3924
  case 2:
3813
- if (tag != 18) {
3925
+ if (tag !== 18) {
3814
3926
  break;
3815
3927
  }
3816
3928
  message.processId = reader.bytes();
3817
3929
  continue;
3818
3930
  case 3:
3819
- if (tag != 26) {
3931
+ if (tag !== 26) {
3820
3932
  break;
3821
3933
  }
3822
3934
  message.address = reader.bytes();
3823
3935
  continue;
3824
3936
  case 5:
3825
- if (tag != 42) {
3937
+ if (tag !== 42) {
3826
3938
  break;
3827
3939
  }
3828
3940
  message.encryptionPrivateKey = reader.bytes();
3829
3941
  continue;
3830
3942
  case 6:
3831
- if (tag != 50) {
3943
+ if (tag !== 50) {
3832
3944
  break;
3833
3945
  }
3834
3946
  message.encryptionPublicKey = reader.bytes();
3835
3947
  continue;
3836
3948
  case 7:
3837
- if (tag != 56) {
3949
+ if (tag !== 56) {
3838
3950
  break;
3839
3951
  }
3840
3952
  message.keyIndex = reader.uint32();
3841
3953
  continue;
3842
3954
  case 8:
3843
- if (tag != 64) {
3955
+ if (tag !== 64) {
3844
3956
  break;
3845
3957
  }
3846
3958
  message.power = longToNumber(reader.uint64());
3847
3959
  continue;
3848
3960
  case 9:
3849
- if (tag != 74) {
3961
+ if (tag !== 74) {
3850
3962
  break;
3851
3963
  }
3852
3964
  message.publicKey = reader.bytes();
3853
3965
  continue;
3854
3966
  case 11:
3855
- if (tag != 88) {
3967
+ if (tag !== 88) {
3856
3968
  break;
3857
3969
  }
3858
3970
  message.nonce = reader.uint32();
3859
3971
  continue;
3860
3972
  }
3861
- if ((tag & 7) == 4 || tag == 0) {
3973
+ if ((tag & 7) === 4 || tag === 0) {
3862
3974
  break;
3863
3975
  }
3864
3976
  reader.skipType(tag & 7);
@@ -3868,7 +3980,7 @@ var AdminTx = {
3868
3980
  fromJSON(object) {
3869
3981
  return {
3870
3982
  txtype: isSet(object.txtype) ? txTypeFromJSON(object.txtype) : 0,
3871
- processId: isSet(object.processId) ? bytesFromBase64(object.processId) : new Uint8Array(),
3983
+ processId: isSet(object.processId) ? bytesFromBase64(object.processId) : new Uint8Array(0),
3872
3984
  address: isSet(object.address) ? bytesFromBase64(object.address) : void 0,
3873
3985
  encryptionPrivateKey: isSet(object.encryptionPrivateKey) ? bytesFromBase64(object.encryptionPrivateKey) : void 0,
3874
3986
  encryptionPublicKey: isSet(object.encryptionPublicKey) ? bytesFromBase64(object.encryptionPublicKey) : void 0,
@@ -3880,15 +3992,33 @@ var AdminTx = {
3880
3992
  },
3881
3993
  toJSON(message) {
3882
3994
  const obj = {};
3883
- message.txtype !== void 0 && (obj.txtype = txTypeToJSON(message.txtype));
3884
- message.processId !== void 0 && (obj.processId = base64FromBytes(message.processId !== void 0 ? message.processId : new Uint8Array()));
3885
- message.address !== void 0 && (obj.address = message.address !== void 0 ? base64FromBytes(message.address) : void 0);
3886
- message.encryptionPrivateKey !== void 0 && (obj.encryptionPrivateKey = message.encryptionPrivateKey !== void 0 ? base64FromBytes(message.encryptionPrivateKey) : void 0);
3887
- message.encryptionPublicKey !== void 0 && (obj.encryptionPublicKey = message.encryptionPublicKey !== void 0 ? base64FromBytes(message.encryptionPublicKey) : void 0);
3888
- message.keyIndex !== void 0 && (obj.keyIndex = Math.round(message.keyIndex));
3889
- message.power !== void 0 && (obj.power = Math.round(message.power));
3890
- message.publicKey !== void 0 && (obj.publicKey = message.publicKey !== void 0 ? base64FromBytes(message.publicKey) : void 0);
3891
- message.nonce !== void 0 && (obj.nonce = Math.round(message.nonce));
3995
+ if (message.txtype !== 0) {
3996
+ obj.txtype = txTypeToJSON(message.txtype);
3997
+ }
3998
+ if (message.processId.length !== 0) {
3999
+ obj.processId = base64FromBytes(message.processId);
4000
+ }
4001
+ if (message.address !== void 0) {
4002
+ obj.address = base64FromBytes(message.address);
4003
+ }
4004
+ if (message.encryptionPrivateKey !== void 0) {
4005
+ obj.encryptionPrivateKey = base64FromBytes(message.encryptionPrivateKey);
4006
+ }
4007
+ if (message.encryptionPublicKey !== void 0) {
4008
+ obj.encryptionPublicKey = base64FromBytes(message.encryptionPublicKey);
4009
+ }
4010
+ if (message.keyIndex !== void 0) {
4011
+ obj.keyIndex = Math.round(message.keyIndex);
4012
+ }
4013
+ if (message.power !== void 0) {
4014
+ obj.power = Math.round(message.power);
4015
+ }
4016
+ if (message.publicKey !== void 0) {
4017
+ obj.publicKey = base64FromBytes(message.publicKey);
4018
+ }
4019
+ if (message.nonce !== 0) {
4020
+ obj.nonce = Math.round(message.nonce);
4021
+ }
3892
4022
  return obj;
3893
4023
  },
3894
4024
  create(base) {
@@ -3897,7 +4027,7 @@ var AdminTx = {
3897
4027
  fromPartial(object) {
3898
4028
  const message = createBaseAdminTx();
3899
4029
  message.txtype = object.txtype ?? 0;
3900
- message.processId = object.processId ?? new Uint8Array();
4030
+ message.processId = object.processId ?? new Uint8Array(0);
3901
4031
  message.address = object.address ?? void 0;
3902
4032
  message.encryptionPrivateKey = object.encryptionPrivateKey ?? void 0;
3903
4033
  message.encryptionPublicKey = object.encryptionPublicKey ?? void 0;
@@ -3909,7 +4039,7 @@ var AdminTx = {
3909
4039
  }
3910
4040
  };
3911
4041
  function createBaseRegisterKeyTx() {
3912
- return { nonce: 0, processId: new Uint8Array(), proof: void 0, newKey: new Uint8Array(), weight: "" };
4042
+ return { nonce: 0, processId: new Uint8Array(0), proof: void 0, newKey: new Uint8Array(0), weight: "" };
3913
4043
  }
3914
4044
  var RegisterKeyTx = {
3915
4045
  encode(message, writer = import_minimal.default.Writer.create()) {
@@ -3938,37 +4068,37 @@ var RegisterKeyTx = {
3938
4068
  const tag = reader.uint32();
3939
4069
  switch (tag >>> 3) {
3940
4070
  case 1:
3941
- if (tag != 8) {
4071
+ if (tag !== 8) {
3942
4072
  break;
3943
4073
  }
3944
4074
  message.nonce = reader.uint32();
3945
4075
  continue;
3946
4076
  case 2:
3947
- if (tag != 18) {
4077
+ if (tag !== 18) {
3948
4078
  break;
3949
4079
  }
3950
4080
  message.processId = reader.bytes();
3951
4081
  continue;
3952
4082
  case 3:
3953
- if (tag != 26) {
4083
+ if (tag !== 26) {
3954
4084
  break;
3955
4085
  }
3956
4086
  message.proof = Proof.decode(reader, reader.uint32());
3957
4087
  continue;
3958
4088
  case 4:
3959
- if (tag != 34) {
4089
+ if (tag !== 34) {
3960
4090
  break;
3961
4091
  }
3962
4092
  message.newKey = reader.bytes();
3963
4093
  continue;
3964
4094
  case 5:
3965
- if (tag != 42) {
4095
+ if (tag !== 42) {
3966
4096
  break;
3967
4097
  }
3968
4098
  message.weight = reader.string();
3969
4099
  continue;
3970
4100
  }
3971
- if ((tag & 7) == 4 || tag == 0) {
4101
+ if ((tag & 7) === 4 || tag === 0) {
3972
4102
  break;
3973
4103
  }
3974
4104
  reader.skipType(tag & 7);
@@ -3978,19 +4108,29 @@ var RegisterKeyTx = {
3978
4108
  fromJSON(object) {
3979
4109
  return {
3980
4110
  nonce: isSet(object.nonce) ? Number(object.nonce) : 0,
3981
- processId: isSet(object.processId) ? bytesFromBase64(object.processId) : new Uint8Array(),
4111
+ processId: isSet(object.processId) ? bytesFromBase64(object.processId) : new Uint8Array(0),
3982
4112
  proof: isSet(object.proof) ? Proof.fromJSON(object.proof) : void 0,
3983
- newKey: isSet(object.newKey) ? bytesFromBase64(object.newKey) : new Uint8Array(),
4113
+ newKey: isSet(object.newKey) ? bytesFromBase64(object.newKey) : new Uint8Array(0),
3984
4114
  weight: isSet(object.weight) ? String(object.weight) : ""
3985
4115
  };
3986
4116
  },
3987
4117
  toJSON(message) {
3988
4118
  const obj = {};
3989
- message.nonce !== void 0 && (obj.nonce = Math.round(message.nonce));
3990
- message.processId !== void 0 && (obj.processId = base64FromBytes(message.processId !== void 0 ? message.processId : new Uint8Array()));
3991
- message.proof !== void 0 && (obj.proof = message.proof ? Proof.toJSON(message.proof) : void 0);
3992
- message.newKey !== void 0 && (obj.newKey = base64FromBytes(message.newKey !== void 0 ? message.newKey : new Uint8Array()));
3993
- message.weight !== void 0 && (obj.weight = message.weight);
4119
+ if (message.nonce !== 0) {
4120
+ obj.nonce = Math.round(message.nonce);
4121
+ }
4122
+ if (message.processId.length !== 0) {
4123
+ obj.processId = base64FromBytes(message.processId);
4124
+ }
4125
+ if (message.proof !== void 0) {
4126
+ obj.proof = Proof.toJSON(message.proof);
4127
+ }
4128
+ if (message.newKey.length !== 0) {
4129
+ obj.newKey = base64FromBytes(message.newKey);
4130
+ }
4131
+ if (message.weight !== "") {
4132
+ obj.weight = message.weight;
4133
+ }
3994
4134
  return obj;
3995
4135
  },
3996
4136
  create(base) {
@@ -3999,15 +4139,15 @@ var RegisterKeyTx = {
3999
4139
  fromPartial(object) {
4000
4140
  const message = createBaseRegisterKeyTx();
4001
4141
  message.nonce = object.nonce ?? 0;
4002
- message.processId = object.processId ?? new Uint8Array();
4142
+ message.processId = object.processId ?? new Uint8Array(0);
4003
4143
  message.proof = object.proof !== void 0 && object.proof !== null ? Proof.fromPartial(object.proof) : void 0;
4004
- message.newKey = object.newKey ?? new Uint8Array();
4144
+ message.newKey = object.newKey ?? new Uint8Array(0);
4005
4145
  message.weight = object.weight ?? "";
4006
4146
  return message;
4007
4147
  }
4008
4148
  };
4009
4149
  function createBaseMintTokensTx() {
4010
- return { txtype: 0, nonce: 0, to: new Uint8Array(), value: 0 };
4150
+ return { txtype: 0, nonce: 0, to: new Uint8Array(0), value: 0 };
4011
4151
  }
4012
4152
  var MintTokensTx = {
4013
4153
  encode(message, writer = import_minimal.default.Writer.create()) {
@@ -4033,31 +4173,31 @@ var MintTokensTx = {
4033
4173
  const tag = reader.uint32();
4034
4174
  switch (tag >>> 3) {
4035
4175
  case 1:
4036
- if (tag != 8) {
4176
+ if (tag !== 8) {
4037
4177
  break;
4038
4178
  }
4039
4179
  message.txtype = reader.int32();
4040
4180
  continue;
4041
4181
  case 2:
4042
- if (tag != 16) {
4182
+ if (tag !== 16) {
4043
4183
  break;
4044
4184
  }
4045
4185
  message.nonce = reader.uint32();
4046
4186
  continue;
4047
4187
  case 3:
4048
- if (tag != 26) {
4188
+ if (tag !== 26) {
4049
4189
  break;
4050
4190
  }
4051
4191
  message.to = reader.bytes();
4052
4192
  continue;
4053
4193
  case 4:
4054
- if (tag != 32) {
4194
+ if (tag !== 32) {
4055
4195
  break;
4056
4196
  }
4057
4197
  message.value = longToNumber(reader.uint64());
4058
4198
  continue;
4059
4199
  }
4060
- if ((tag & 7) == 4 || tag == 0) {
4200
+ if ((tag & 7) === 4 || tag === 0) {
4061
4201
  break;
4062
4202
  }
4063
4203
  reader.skipType(tag & 7);
@@ -4068,16 +4208,24 @@ var MintTokensTx = {
4068
4208
  return {
4069
4209
  txtype: isSet(object.txtype) ? txTypeFromJSON(object.txtype) : 0,
4070
4210
  nonce: isSet(object.nonce) ? Number(object.nonce) : 0,
4071
- to: isSet(object.to) ? bytesFromBase64(object.to) : new Uint8Array(),
4211
+ to: isSet(object.to) ? bytesFromBase64(object.to) : new Uint8Array(0),
4072
4212
  value: isSet(object.value) ? Number(object.value) : 0
4073
4213
  };
4074
4214
  },
4075
4215
  toJSON(message) {
4076
4216
  const obj = {};
4077
- message.txtype !== void 0 && (obj.txtype = txTypeToJSON(message.txtype));
4078
- message.nonce !== void 0 && (obj.nonce = Math.round(message.nonce));
4079
- message.to !== void 0 && (obj.to = base64FromBytes(message.to !== void 0 ? message.to : new Uint8Array()));
4080
- message.value !== void 0 && (obj.value = Math.round(message.value));
4217
+ if (message.txtype !== 0) {
4218
+ obj.txtype = txTypeToJSON(message.txtype);
4219
+ }
4220
+ if (message.nonce !== 0) {
4221
+ obj.nonce = Math.round(message.nonce);
4222
+ }
4223
+ if (message.to.length !== 0) {
4224
+ obj.to = base64FromBytes(message.to);
4225
+ }
4226
+ if (message.value !== 0) {
4227
+ obj.value = Math.round(message.value);
4228
+ }
4081
4229
  return obj;
4082
4230
  },
4083
4231
  create(base) {
@@ -4087,13 +4235,13 @@ var MintTokensTx = {
4087
4235
  const message = createBaseMintTokensTx();
4088
4236
  message.txtype = object.txtype ?? 0;
4089
4237
  message.nonce = object.nonce ?? 0;
4090
- message.to = object.to ?? new Uint8Array();
4238
+ message.to = object.to ?? new Uint8Array(0);
4091
4239
  message.value = object.value ?? 0;
4092
4240
  return message;
4093
4241
  }
4094
4242
  };
4095
4243
  function createBaseSendTokensTx() {
4096
- return { txtype: 0, nonce: 0, from: new Uint8Array(), to: new Uint8Array(), value: 0 };
4244
+ return { txtype: 0, nonce: 0, from: new Uint8Array(0), to: new Uint8Array(0), value: 0 };
4097
4245
  }
4098
4246
  var SendTokensTx = {
4099
4247
  encode(message, writer = import_minimal.default.Writer.create()) {
@@ -4122,37 +4270,37 @@ var SendTokensTx = {
4122
4270
  const tag = reader.uint32();
4123
4271
  switch (tag >>> 3) {
4124
4272
  case 1:
4125
- if (tag != 8) {
4273
+ if (tag !== 8) {
4126
4274
  break;
4127
4275
  }
4128
4276
  message.txtype = reader.int32();
4129
4277
  continue;
4130
4278
  case 2:
4131
- if (tag != 16) {
4279
+ if (tag !== 16) {
4132
4280
  break;
4133
4281
  }
4134
4282
  message.nonce = reader.uint32();
4135
4283
  continue;
4136
4284
  case 3:
4137
- if (tag != 26) {
4285
+ if (tag !== 26) {
4138
4286
  break;
4139
4287
  }
4140
4288
  message.from = reader.bytes();
4141
4289
  continue;
4142
4290
  case 4:
4143
- if (tag != 34) {
4291
+ if (tag !== 34) {
4144
4292
  break;
4145
4293
  }
4146
4294
  message.to = reader.bytes();
4147
4295
  continue;
4148
4296
  case 5:
4149
- if (tag != 40) {
4297
+ if (tag !== 40) {
4150
4298
  break;
4151
4299
  }
4152
4300
  message.value = longToNumber(reader.uint64());
4153
4301
  continue;
4154
4302
  }
4155
- if ((tag & 7) == 4 || tag == 0) {
4303
+ if ((tag & 7) === 4 || tag === 0) {
4156
4304
  break;
4157
4305
  }
4158
4306
  reader.skipType(tag & 7);
@@ -4163,18 +4311,28 @@ var SendTokensTx = {
4163
4311
  return {
4164
4312
  txtype: isSet(object.txtype) ? txTypeFromJSON(object.txtype) : 0,
4165
4313
  nonce: isSet(object.nonce) ? Number(object.nonce) : 0,
4166
- from: isSet(object.from) ? bytesFromBase64(object.from) : new Uint8Array(),
4167
- to: isSet(object.to) ? bytesFromBase64(object.to) : new Uint8Array(),
4314
+ from: isSet(object.from) ? bytesFromBase64(object.from) : new Uint8Array(0),
4315
+ to: isSet(object.to) ? bytesFromBase64(object.to) : new Uint8Array(0),
4168
4316
  value: isSet(object.value) ? Number(object.value) : 0
4169
4317
  };
4170
4318
  },
4171
4319
  toJSON(message) {
4172
4320
  const obj = {};
4173
- message.txtype !== void 0 && (obj.txtype = txTypeToJSON(message.txtype));
4174
- message.nonce !== void 0 && (obj.nonce = Math.round(message.nonce));
4175
- message.from !== void 0 && (obj.from = base64FromBytes(message.from !== void 0 ? message.from : new Uint8Array()));
4176
- message.to !== void 0 && (obj.to = base64FromBytes(message.to !== void 0 ? message.to : new Uint8Array()));
4177
- message.value !== void 0 && (obj.value = Math.round(message.value));
4321
+ if (message.txtype !== 0) {
4322
+ obj.txtype = txTypeToJSON(message.txtype);
4323
+ }
4324
+ if (message.nonce !== 0) {
4325
+ obj.nonce = Math.round(message.nonce);
4326
+ }
4327
+ if (message.from.length !== 0) {
4328
+ obj.from = base64FromBytes(message.from);
4329
+ }
4330
+ if (message.to.length !== 0) {
4331
+ obj.to = base64FromBytes(message.to);
4332
+ }
4333
+ if (message.value !== 0) {
4334
+ obj.value = Math.round(message.value);
4335
+ }
4178
4336
  return obj;
4179
4337
  },
4180
4338
  create(base) {
@@ -4184,8 +4342,8 @@ var SendTokensTx = {
4184
4342
  const message = createBaseSendTokensTx();
4185
4343
  message.txtype = object.txtype ?? 0;
4186
4344
  message.nonce = object.nonce ?? 0;
4187
- message.from = object.from ?? new Uint8Array();
4188
- message.to = object.to ?? new Uint8Array();
4345
+ message.from = object.from ?? new Uint8Array(0);
4346
+ message.to = object.to ?? new Uint8Array(0);
4189
4347
  message.value = object.value ?? 0;
4190
4348
  return message;
4191
4349
  }
@@ -4214,25 +4372,25 @@ var SetTransactionCostsTx = {
4214
4372
  const tag = reader.uint32();
4215
4373
  switch (tag >>> 3) {
4216
4374
  case 1:
4217
- if (tag != 8) {
4375
+ if (tag !== 8) {
4218
4376
  break;
4219
4377
  }
4220
4378
  message.txtype = reader.int32();
4221
4379
  continue;
4222
4380
  case 2:
4223
- if (tag != 16) {
4381
+ if (tag !== 16) {
4224
4382
  break;
4225
4383
  }
4226
4384
  message.nonce = reader.uint32();
4227
4385
  continue;
4228
4386
  case 3:
4229
- if (tag != 24) {
4387
+ if (tag !== 24) {
4230
4388
  break;
4231
4389
  }
4232
4390
  message.value = longToNumber(reader.uint64());
4233
4391
  continue;
4234
4392
  }
4235
- if ((tag & 7) == 4 || tag == 0) {
4393
+ if ((tag & 7) === 4 || tag === 0) {
4236
4394
  break;
4237
4395
  }
4238
4396
  reader.skipType(tag & 7);
@@ -4248,9 +4406,15 @@ var SetTransactionCostsTx = {
4248
4406
  },
4249
4407
  toJSON(message) {
4250
4408
  const obj = {};
4251
- message.txtype !== void 0 && (obj.txtype = txTypeToJSON(message.txtype));
4252
- message.nonce !== void 0 && (obj.nonce = Math.round(message.nonce));
4253
- message.value !== void 0 && (obj.value = Math.round(message.value));
4409
+ if (message.txtype !== 0) {
4410
+ obj.txtype = txTypeToJSON(message.txtype);
4411
+ }
4412
+ if (message.nonce !== 0) {
4413
+ obj.nonce = Math.round(message.nonce);
4414
+ }
4415
+ if (message.value !== 0) {
4416
+ obj.value = Math.round(message.value);
4417
+ }
4254
4418
  return obj;
4255
4419
  },
4256
4420
  create(base) {
@@ -4304,43 +4468,43 @@ var SetAccountTx = {
4304
4468
  const tag = reader.uint32();
4305
4469
  switch (tag >>> 3) {
4306
4470
  case 1:
4307
- if (tag != 8) {
4471
+ if (tag !== 8) {
4308
4472
  break;
4309
4473
  }
4310
4474
  message.txtype = reader.int32();
4311
4475
  continue;
4312
4476
  case 2:
4313
- if (tag != 16) {
4477
+ if (tag !== 16) {
4314
4478
  break;
4315
4479
  }
4316
4480
  message.nonce = reader.uint32();
4317
4481
  continue;
4318
4482
  case 3:
4319
- if (tag != 26) {
4483
+ if (tag !== 26) {
4320
4484
  break;
4321
4485
  }
4322
4486
  message.infoURI = reader.string();
4323
4487
  continue;
4324
4488
  case 4:
4325
- if (tag != 34) {
4489
+ if (tag !== 34) {
4326
4490
  break;
4327
4491
  }
4328
4492
  message.account = reader.bytes();
4329
4493
  continue;
4330
4494
  case 5:
4331
- if (tag != 42) {
4495
+ if (tag !== 42) {
4332
4496
  break;
4333
4497
  }
4334
4498
  message.faucetPackage = FaucetPackage.decode(reader, reader.uint32());
4335
4499
  continue;
4336
4500
  case 6:
4337
- if (tag != 50) {
4501
+ if (tag !== 50) {
4338
4502
  break;
4339
4503
  }
4340
4504
  message.delegates.push(reader.bytes());
4341
4505
  continue;
4342
4506
  }
4343
- if ((tag & 7) == 4 || tag == 0) {
4507
+ if ((tag & 7) === 4 || tag === 0) {
4344
4508
  break;
4345
4509
  }
4346
4510
  reader.skipType(tag & 7);
@@ -4359,15 +4523,23 @@ var SetAccountTx = {
4359
4523
  },
4360
4524
  toJSON(message) {
4361
4525
  const obj = {};
4362
- message.txtype !== void 0 && (obj.txtype = txTypeToJSON(message.txtype));
4363
- message.nonce !== void 0 && (obj.nonce = Math.round(message.nonce));
4364
- message.infoURI !== void 0 && (obj.infoURI = message.infoURI);
4365
- message.account !== void 0 && (obj.account = message.account !== void 0 ? base64FromBytes(message.account) : void 0);
4366
- message.faucetPackage !== void 0 && (obj.faucetPackage = message.faucetPackage ? FaucetPackage.toJSON(message.faucetPackage) : void 0);
4367
- if (message.delegates) {
4368
- obj.delegates = message.delegates.map((e) => base64FromBytes(e !== void 0 ? e : new Uint8Array()));
4369
- } else {
4370
- obj.delegates = [];
4526
+ if (message.txtype !== 0) {
4527
+ obj.txtype = txTypeToJSON(message.txtype);
4528
+ }
4529
+ if (message.nonce !== void 0) {
4530
+ obj.nonce = Math.round(message.nonce);
4531
+ }
4532
+ if (message.infoURI !== void 0) {
4533
+ obj.infoURI = message.infoURI;
4534
+ }
4535
+ if (message.account !== void 0) {
4536
+ obj.account = base64FromBytes(message.account);
4537
+ }
4538
+ if (message.faucetPackage !== void 0) {
4539
+ obj.faucetPackage = FaucetPackage.toJSON(message.faucetPackage);
4540
+ }
4541
+ if (message.delegates?.length) {
4542
+ obj.delegates = message.delegates.map((e) => base64FromBytes(e));
4371
4543
  }
4372
4544
  return obj;
4373
4545
  },
@@ -4409,25 +4581,25 @@ var CollectFaucetTx = {
4409
4581
  const tag = reader.uint32();
4410
4582
  switch (tag >>> 3) {
4411
4583
  case 1:
4412
- if (tag != 8) {
4584
+ if (tag !== 8) {
4413
4585
  break;
4414
4586
  }
4415
4587
  message.txType = reader.int32();
4416
4588
  continue;
4417
4589
  case 2:
4418
- if (tag != 18) {
4590
+ if (tag !== 18) {
4419
4591
  break;
4420
4592
  }
4421
4593
  message.faucetPackage = FaucetPackage.decode(reader, reader.uint32());
4422
4594
  continue;
4423
4595
  case 3:
4424
- if (tag != 24) {
4596
+ if (tag !== 24) {
4425
4597
  break;
4426
4598
  }
4427
4599
  message.nonce = reader.uint32();
4428
4600
  continue;
4429
4601
  }
4430
- if ((tag & 7) == 4 || tag == 0) {
4602
+ if ((tag & 7) === 4 || tag === 0) {
4431
4603
  break;
4432
4604
  }
4433
4605
  reader.skipType(tag & 7);
@@ -4443,9 +4615,15 @@ var CollectFaucetTx = {
4443
4615
  },
4444
4616
  toJSON(message) {
4445
4617
  const obj = {};
4446
- message.txType !== void 0 && (obj.txType = txTypeToJSON(message.txType));
4447
- message.faucetPackage !== void 0 && (obj.faucetPackage = message.faucetPackage ? FaucetPackage.toJSON(message.faucetPackage) : void 0);
4448
- message.nonce !== void 0 && (obj.nonce = Math.round(message.nonce));
4618
+ if (message.txType !== 0) {
4619
+ obj.txType = txTypeToJSON(message.txType);
4620
+ }
4621
+ if (message.faucetPackage !== void 0) {
4622
+ obj.faucetPackage = FaucetPackage.toJSON(message.faucetPackage);
4623
+ }
4624
+ if (message.nonce !== 0) {
4625
+ obj.nonce = Math.round(message.nonce);
4626
+ }
4449
4627
  return obj;
4450
4628
  },
4451
4629
  create(base) {
@@ -4460,7 +4638,7 @@ var CollectFaucetTx = {
4460
4638
  }
4461
4639
  };
4462
4640
  function createBaseFaucetPayload() {
4463
- return { identifier: 0, to: new Uint8Array(), amount: 0 };
4641
+ return { identifier: 0, to: new Uint8Array(0), amount: 0 };
4464
4642
  }
4465
4643
  var FaucetPayload = {
4466
4644
  encode(message, writer = import_minimal.default.Writer.create()) {
@@ -4483,25 +4661,25 @@ var FaucetPayload = {
4483
4661
  const tag = reader.uint32();
4484
4662
  switch (tag >>> 3) {
4485
4663
  case 1:
4486
- if (tag != 8) {
4664
+ if (tag !== 8) {
4487
4665
  break;
4488
4666
  }
4489
4667
  message.identifier = longToNumber(reader.uint64());
4490
4668
  continue;
4491
4669
  case 2:
4492
- if (tag != 18) {
4670
+ if (tag !== 18) {
4493
4671
  break;
4494
4672
  }
4495
4673
  message.to = reader.bytes();
4496
4674
  continue;
4497
4675
  case 3:
4498
- if (tag != 24) {
4676
+ if (tag !== 24) {
4499
4677
  break;
4500
4678
  }
4501
4679
  message.amount = longToNumber(reader.uint64());
4502
4680
  continue;
4503
4681
  }
4504
- if ((tag & 7) == 4 || tag == 0) {
4682
+ if ((tag & 7) === 4 || tag === 0) {
4505
4683
  break;
4506
4684
  }
4507
4685
  reader.skipType(tag & 7);
@@ -4511,15 +4689,21 @@ var FaucetPayload = {
4511
4689
  fromJSON(object) {
4512
4690
  return {
4513
4691
  identifier: isSet(object.identifier) ? Number(object.identifier) : 0,
4514
- to: isSet(object.to) ? bytesFromBase64(object.to) : new Uint8Array(),
4692
+ to: isSet(object.to) ? bytesFromBase64(object.to) : new Uint8Array(0),
4515
4693
  amount: isSet(object.amount) ? Number(object.amount) : 0
4516
4694
  };
4517
4695
  },
4518
4696
  toJSON(message) {
4519
4697
  const obj = {};
4520
- message.identifier !== void 0 && (obj.identifier = Math.round(message.identifier));
4521
- message.to !== void 0 && (obj.to = base64FromBytes(message.to !== void 0 ? message.to : new Uint8Array()));
4522
- message.amount !== void 0 && (obj.amount = Math.round(message.amount));
4698
+ if (message.identifier !== 0) {
4699
+ obj.identifier = Math.round(message.identifier);
4700
+ }
4701
+ if (message.to.length !== 0) {
4702
+ obj.to = base64FromBytes(message.to);
4703
+ }
4704
+ if (message.amount !== 0) {
4705
+ obj.amount = Math.round(message.amount);
4706
+ }
4523
4707
  return obj;
4524
4708
  },
4525
4709
  create(base) {
@@ -4528,13 +4712,13 @@ var FaucetPayload = {
4528
4712
  fromPartial(object) {
4529
4713
  const message = createBaseFaucetPayload();
4530
4714
  message.identifier = object.identifier ?? 0;
4531
- message.to = object.to ?? new Uint8Array();
4715
+ message.to = object.to ?? new Uint8Array(0);
4532
4716
  message.amount = object.amount ?? 0;
4533
4717
  return message;
4534
4718
  }
4535
4719
  };
4536
4720
  function createBaseFaucetPackage() {
4537
- return { payload: new Uint8Array(), signature: new Uint8Array() };
4721
+ return { payload: new Uint8Array(0), signature: new Uint8Array(0) };
4538
4722
  }
4539
4723
  var FaucetPackage = {
4540
4724
  encode(message, writer = import_minimal.default.Writer.create()) {
@@ -4554,19 +4738,19 @@ var FaucetPackage = {
4554
4738
  const tag = reader.uint32();
4555
4739
  switch (tag >>> 3) {
4556
4740
  case 1:
4557
- if (tag != 10) {
4741
+ if (tag !== 10) {
4558
4742
  break;
4559
4743
  }
4560
4744
  message.payload = reader.bytes();
4561
4745
  continue;
4562
4746
  case 2:
4563
- if (tag != 18) {
4747
+ if (tag !== 18) {
4564
4748
  break;
4565
4749
  }
4566
4750
  message.signature = reader.bytes();
4567
4751
  continue;
4568
4752
  }
4569
- if ((tag & 7) == 4 || tag == 0) {
4753
+ if ((tag & 7) === 4 || tag === 0) {
4570
4754
  break;
4571
4755
  }
4572
4756
  reader.skipType(tag & 7);
@@ -4575,14 +4759,18 @@ var FaucetPackage = {
4575
4759
  },
4576
4760
  fromJSON(object) {
4577
4761
  return {
4578
- payload: isSet(object.payload) ? bytesFromBase64(object.payload) : new Uint8Array(),
4579
- signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array()
4762
+ payload: isSet(object.payload) ? bytesFromBase64(object.payload) : new Uint8Array(0),
4763
+ signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array(0)
4580
4764
  };
4581
4765
  },
4582
4766
  toJSON(message) {
4583
4767
  const obj = {};
4584
- message.payload !== void 0 && (obj.payload = base64FromBytes(message.payload !== void 0 ? message.payload : new Uint8Array()));
4585
- message.signature !== void 0 && (obj.signature = base64FromBytes(message.signature !== void 0 ? message.signature : new Uint8Array()));
4768
+ if (message.payload.length !== 0) {
4769
+ obj.payload = base64FromBytes(message.payload);
4770
+ }
4771
+ if (message.signature.length !== 0) {
4772
+ obj.signature = base64FromBytes(message.signature);
4773
+ }
4586
4774
  return obj;
4587
4775
  },
4588
4776
  create(base) {
@@ -4590,13 +4778,13 @@ var FaucetPackage = {
4590
4778
  },
4591
4779
  fromPartial(object) {
4592
4780
  const message = createBaseFaucetPackage();
4593
- message.payload = object.payload ?? new Uint8Array();
4594
- message.signature = object.signature ?? new Uint8Array();
4781
+ message.payload = object.payload ?? new Uint8Array(0);
4782
+ message.signature = object.signature ?? new Uint8Array(0);
4595
4783
  return message;
4596
4784
  }
4597
4785
  };
4598
4786
  function createBaseSetKeykeeperTx() {
4599
- return { txtype: 0, nonce: 0, keykeeper: new Uint8Array() };
4787
+ return { txtype: 0, nonce: 0, keykeeper: new Uint8Array(0) };
4600
4788
  }
4601
4789
  var SetKeykeeperTx = {
4602
4790
  encode(message, writer = import_minimal.default.Writer.create()) {
@@ -4619,25 +4807,25 @@ var SetKeykeeperTx = {
4619
4807
  const tag = reader.uint32();
4620
4808
  switch (tag >>> 3) {
4621
4809
  case 1:
4622
- if (tag != 8) {
4810
+ if (tag !== 8) {
4623
4811
  break;
4624
4812
  }
4625
4813
  message.txtype = reader.int32();
4626
4814
  continue;
4627
4815
  case 2:
4628
- if (tag != 16) {
4816
+ if (tag !== 16) {
4629
4817
  break;
4630
4818
  }
4631
4819
  message.nonce = reader.uint32();
4632
4820
  continue;
4633
4821
  case 3:
4634
- if (tag != 26) {
4822
+ if (tag !== 26) {
4635
4823
  break;
4636
4824
  }
4637
4825
  message.keykeeper = reader.bytes();
4638
4826
  continue;
4639
4827
  }
4640
- if ((tag & 7) == 4 || tag == 0) {
4828
+ if ((tag & 7) === 4 || tag === 0) {
4641
4829
  break;
4642
4830
  }
4643
4831
  reader.skipType(tag & 7);
@@ -4648,14 +4836,20 @@ var SetKeykeeperTx = {
4648
4836
  return {
4649
4837
  txtype: isSet(object.txtype) ? txTypeFromJSON(object.txtype) : 0,
4650
4838
  nonce: isSet(object.nonce) ? Number(object.nonce) : 0,
4651
- keykeeper: isSet(object.keykeeper) ? bytesFromBase64(object.keykeeper) : new Uint8Array()
4839
+ keykeeper: isSet(object.keykeeper) ? bytesFromBase64(object.keykeeper) : new Uint8Array(0)
4652
4840
  };
4653
4841
  },
4654
4842
  toJSON(message) {
4655
4843
  const obj = {};
4656
- message.txtype !== void 0 && (obj.txtype = txTypeToJSON(message.txtype));
4657
- message.nonce !== void 0 && (obj.nonce = Math.round(message.nonce));
4658
- message.keykeeper !== void 0 && (obj.keykeeper = base64FromBytes(message.keykeeper !== void 0 ? message.keykeeper : new Uint8Array()));
4844
+ if (message.txtype !== 0) {
4845
+ obj.txtype = txTypeToJSON(message.txtype);
4846
+ }
4847
+ if (message.nonce !== 0) {
4848
+ obj.nonce = Math.round(message.nonce);
4849
+ }
4850
+ if (message.keykeeper.length !== 0) {
4851
+ obj.keykeeper = base64FromBytes(message.keykeeper);
4852
+ }
4659
4853
  return obj;
4660
4854
  },
4661
4855
  create(base) {
@@ -4665,17 +4859,17 @@ var SetKeykeeperTx = {
4665
4859
  const message = createBaseSetKeykeeperTx();
4666
4860
  message.txtype = object.txtype ?? 0;
4667
4861
  message.nonce = object.nonce ?? 0;
4668
- message.keykeeper = object.keykeeper ?? new Uint8Array();
4862
+ message.keykeeper = object.keykeeper ?? new Uint8Array(0);
4669
4863
  return message;
4670
4864
  }
4671
4865
  };
4672
4866
  function createBaseProcess() {
4673
4867
  return {
4674
- processId: new Uint8Array(),
4675
- entityId: new Uint8Array(),
4868
+ processId: new Uint8Array(0),
4869
+ entityId: new Uint8Array(0),
4676
4870
  startBlock: 0,
4677
4871
  blockCount: 0,
4678
- censusRoot: new Uint8Array(),
4872
+ censusRoot: new Uint8Array(0),
4679
4873
  censusURI: void 0,
4680
4874
  encryptionPrivateKeys: [],
4681
4875
  encryptionPublicKeys: [],
@@ -4809,193 +5003,193 @@ var Process = {
4809
5003
  const tag = reader.uint32();
4810
5004
  switch (tag >>> 3) {
4811
5005
  case 1:
4812
- if (tag != 10) {
5006
+ if (tag !== 10) {
4813
5007
  break;
4814
5008
  }
4815
5009
  message.processId = reader.bytes();
4816
5010
  continue;
4817
5011
  case 2:
4818
- if (tag != 18) {
5012
+ if (tag !== 18) {
4819
5013
  break;
4820
5014
  }
4821
5015
  message.entityId = reader.bytes();
4822
5016
  continue;
4823
5017
  case 3:
4824
- if (tag != 24) {
5018
+ if (tag !== 24) {
4825
5019
  break;
4826
5020
  }
4827
5021
  message.startBlock = reader.uint32();
4828
5022
  continue;
4829
5023
  case 4:
4830
- if (tag != 32) {
5024
+ if (tag !== 32) {
4831
5025
  break;
4832
5026
  }
4833
5027
  message.blockCount = reader.uint32();
4834
5028
  continue;
4835
5029
  case 5:
4836
- if (tag != 42) {
5030
+ if (tag !== 42) {
4837
5031
  break;
4838
5032
  }
4839
5033
  message.censusRoot = reader.bytes();
4840
5034
  continue;
4841
5035
  case 6:
4842
- if (tag != 50) {
5036
+ if (tag !== 50) {
4843
5037
  break;
4844
5038
  }
4845
5039
  message.censusURI = reader.string();
4846
5040
  continue;
4847
5041
  case 8:
4848
- if (tag != 66) {
5042
+ if (tag !== 66) {
4849
5043
  break;
4850
5044
  }
4851
5045
  message.encryptionPrivateKeys.push(reader.string());
4852
5046
  continue;
4853
5047
  case 9:
4854
- if (tag != 74) {
5048
+ if (tag !== 74) {
4855
5049
  break;
4856
5050
  }
4857
5051
  message.encryptionPublicKeys.push(reader.string());
4858
5052
  continue;
4859
5053
  case 11:
4860
- if (tag != 88) {
5054
+ if (tag !== 88) {
4861
5055
  break;
4862
5056
  }
4863
5057
  message.keyIndex = reader.uint32();
4864
5058
  continue;
4865
5059
  case 12:
4866
- if (tag != 96) {
5060
+ if (tag !== 96) {
4867
5061
  break;
4868
5062
  }
4869
5063
  message.status = reader.int32();
4870
5064
  continue;
4871
5065
  case 13:
4872
- if (tag != 106) {
5066
+ if (tag !== 106) {
4873
5067
  break;
4874
5068
  }
4875
5069
  message.paramsSignature = reader.bytes();
4876
5070
  continue;
4877
5071
  case 14:
4878
- if (tag != 112) {
5072
+ if (tag !== 112) {
4879
5073
  break;
4880
5074
  }
4881
5075
  message.namespace = reader.uint32();
4882
5076
  continue;
4883
5077
  case 15:
4884
- if (tag != 122) {
5078
+ if (tag !== 122) {
4885
5079
  break;
4886
5080
  }
4887
5081
  message.envelopeType = EnvelopeType.decode(reader, reader.uint32());
4888
5082
  continue;
4889
5083
  case 16:
4890
- if (tag != 130) {
5084
+ if (tag !== 130) {
4891
5085
  break;
4892
5086
  }
4893
5087
  message.mode = ProcessMode.decode(reader, reader.uint32());
4894
5088
  continue;
4895
5089
  case 17:
4896
- if (tag != 136) {
5090
+ if (tag !== 136) {
4897
5091
  break;
4898
5092
  }
4899
5093
  message.questionIndex = reader.uint32();
4900
5094
  continue;
4901
5095
  case 18:
4902
- if (tag != 144) {
5096
+ if (tag !== 144) {
4903
5097
  break;
4904
5098
  }
4905
5099
  message.questionCount = reader.uint32();
4906
5100
  continue;
4907
5101
  case 19:
4908
- if (tag != 154) {
5102
+ if (tag !== 154) {
4909
5103
  break;
4910
5104
  }
4911
5105
  message.voteOptions = ProcessVoteOptions.decode(reader, reader.uint32());
4912
5106
  continue;
4913
5107
  case 20:
4914
- if (tag != 160) {
5108
+ if (tag !== 160) {
4915
5109
  break;
4916
5110
  }
4917
5111
  message.censusOrigin = reader.int32();
4918
5112
  continue;
4919
5113
  case 21:
4920
- if (tag != 170) {
5114
+ if (tag !== 170) {
4921
5115
  break;
4922
5116
  }
4923
5117
  message.results.push(ProcessResult.decode(reader, reader.uint32()));
4924
5118
  continue;
4925
5119
  case 22:
4926
- if (tag != 178) {
5120
+ if (tag !== 178) {
4927
5121
  break;
4928
5122
  }
4929
5123
  message.resultsSignatures.push(reader.bytes());
4930
5124
  continue;
4931
5125
  case 23:
4932
- if (tag != 184) {
5126
+ if (tag !== 184) {
4933
5127
  break;
4934
5128
  }
4935
5129
  message.ethIndexSlot = reader.uint32();
4936
5130
  continue;
4937
5131
  case 24:
4938
- if (tag != 192) {
5132
+ if (tag !== 192) {
4939
5133
  break;
4940
5134
  }
4941
5135
  message.sourceBlockHeight = longToNumber(reader.uint64());
4942
5136
  continue;
4943
5137
  case 25:
4944
- if (tag != 202) {
5138
+ if (tag !== 202) {
4945
5139
  break;
4946
5140
  }
4947
5141
  message.owner = reader.bytes();
4948
5142
  continue;
4949
5143
  case 26:
4950
- if (tag != 210) {
5144
+ if (tag !== 210) {
4951
5145
  break;
4952
5146
  }
4953
5147
  message.metadata = reader.string();
4954
5148
  continue;
4955
5149
  case 27:
4956
- if (tag != 216) {
5150
+ if (tag !== 216) {
4957
5151
  break;
4958
5152
  }
4959
5153
  message.sourceNetworkId = reader.int32();
4960
5154
  continue;
4961
5155
  case 28:
4962
- if (tag != 224) {
5156
+ if (tag !== 224) {
4963
5157
  break;
4964
5158
  }
4965
5159
  message.maxCensusSize = longToNumber(reader.uint64());
4966
5160
  continue;
4967
5161
  case 29:
4968
- if (tag != 234) {
5162
+ if (tag !== 234) {
4969
5163
  break;
4970
5164
  }
4971
5165
  message.rollingCensusRoot = reader.bytes();
4972
5166
  continue;
4973
5167
  case 30:
4974
- if (tag != 240) {
5168
+ if (tag !== 240) {
4975
5169
  break;
4976
5170
  }
4977
5171
  message.rollingCensusSize = longToNumber(reader.uint64());
4978
5172
  continue;
4979
5173
  case 31:
4980
- if (tag != 250) {
5174
+ if (tag !== 250) {
4981
5175
  break;
4982
5176
  }
4983
5177
  message.nullifiersRoot = reader.bytes();
4984
5178
  continue;
4985
5179
  case 32:
4986
- if (tag != 258) {
5180
+ if (tag !== 258) {
4987
5181
  break;
4988
5182
  }
4989
5183
  message.sourceNetworkContractAddr = reader.bytes();
4990
5184
  continue;
4991
5185
  case 33:
4992
- if (tag != 264) {
5186
+ if (tag !== 264) {
4993
5187
  break;
4994
5188
  }
4995
5189
  message.tokenDecimals = reader.uint32();
4996
5190
  continue;
4997
5191
  }
4998
- if ((tag & 7) == 4 || tag == 0) {
5192
+ if ((tag & 7) === 4 || tag === 0) {
4999
5193
  break;
5000
5194
  }
5001
5195
  reader.skipType(tag & 7);
@@ -5004,11 +5198,11 @@ var Process = {
5004
5198
  },
5005
5199
  fromJSON(object) {
5006
5200
  return {
5007
- processId: isSet(object.processId) ? bytesFromBase64(object.processId) : new Uint8Array(),
5008
- entityId: isSet(object.entityId) ? bytesFromBase64(object.entityId) : new Uint8Array(),
5201
+ processId: isSet(object.processId) ? bytesFromBase64(object.processId) : new Uint8Array(0),
5202
+ entityId: isSet(object.entityId) ? bytesFromBase64(object.entityId) : new Uint8Array(0),
5009
5203
  startBlock: isSet(object.startBlock) ? Number(object.startBlock) : 0,
5010
5204
  blockCount: isSet(object.blockCount) ? Number(object.blockCount) : 0,
5011
- censusRoot: isSet(object.censusRoot) ? bytesFromBase64(object.censusRoot) : new Uint8Array(),
5205
+ censusRoot: isSet(object.censusRoot) ? bytesFromBase64(object.censusRoot) : new Uint8Array(0),
5012
5206
  censusURI: isSet(object.censusURI) ? String(object.censusURI) : void 0,
5013
5207
  encryptionPrivateKeys: Array.isArray(object?.encryptionPrivateKeys) ? object.encryptionPrivateKeys.map((e) => String(e)) : [],
5014
5208
  encryptionPublicKeys: Array.isArray(object?.encryptionPublicKeys) ? object.encryptionPublicKeys.map((e) => String(e)) : [],
@@ -5039,55 +5233,99 @@ var Process = {
5039
5233
  },
5040
5234
  toJSON(message) {
5041
5235
  const obj = {};
5042
- message.processId !== void 0 && (obj.processId = base64FromBytes(message.processId !== void 0 ? message.processId : new Uint8Array()));
5043
- message.entityId !== void 0 && (obj.entityId = base64FromBytes(message.entityId !== void 0 ? message.entityId : new Uint8Array()));
5044
- message.startBlock !== void 0 && (obj.startBlock = Math.round(message.startBlock));
5045
- message.blockCount !== void 0 && (obj.blockCount = Math.round(message.blockCount));
5046
- message.censusRoot !== void 0 && (obj.censusRoot = base64FromBytes(message.censusRoot !== void 0 ? message.censusRoot : new Uint8Array()));
5047
- message.censusURI !== void 0 && (obj.censusURI = message.censusURI);
5048
- if (message.encryptionPrivateKeys) {
5049
- obj.encryptionPrivateKeys = message.encryptionPrivateKeys.map((e) => e);
5050
- } else {
5051
- obj.encryptionPrivateKeys = [];
5052
- }
5053
- if (message.encryptionPublicKeys) {
5054
- obj.encryptionPublicKeys = message.encryptionPublicKeys.map((e) => e);
5055
- } else {
5056
- obj.encryptionPublicKeys = [];
5057
- }
5058
- message.keyIndex !== void 0 && (obj.keyIndex = Math.round(message.keyIndex));
5059
- message.status !== void 0 && (obj.status = processStatusToJSON(message.status));
5060
- message.paramsSignature !== void 0 && (obj.paramsSignature = message.paramsSignature !== void 0 ? base64FromBytes(message.paramsSignature) : void 0);
5061
- message.namespace !== void 0 && (obj.namespace = Math.round(message.namespace));
5062
- message.envelopeType !== void 0 && (obj.envelopeType = message.envelopeType ? EnvelopeType.toJSON(message.envelopeType) : void 0);
5063
- message.mode !== void 0 && (obj.mode = message.mode ? ProcessMode.toJSON(message.mode) : void 0);
5064
- message.questionIndex !== void 0 && (obj.questionIndex = Math.round(message.questionIndex));
5065
- message.questionCount !== void 0 && (obj.questionCount = Math.round(message.questionCount));
5066
- message.voteOptions !== void 0 && (obj.voteOptions = message.voteOptions ? ProcessVoteOptions.toJSON(message.voteOptions) : void 0);
5067
- message.censusOrigin !== void 0 && (obj.censusOrigin = censusOriginToJSON(message.censusOrigin));
5068
- if (message.results) {
5069
- obj.results = message.results.map((e) => e ? ProcessResult.toJSON(e) : void 0);
5070
- } else {
5071
- obj.results = [];
5072
- }
5073
- if (message.resultsSignatures) {
5074
- obj.resultsSignatures = message.resultsSignatures.map(
5075
- (e) => base64FromBytes(e !== void 0 ? e : new Uint8Array())
5076
- );
5077
- } else {
5078
- obj.resultsSignatures = [];
5079
- }
5080
- message.ethIndexSlot !== void 0 && (obj.ethIndexSlot = Math.round(message.ethIndexSlot));
5081
- message.sourceBlockHeight !== void 0 && (obj.sourceBlockHeight = Math.round(message.sourceBlockHeight));
5082
- message.owner !== void 0 && (obj.owner = message.owner !== void 0 ? base64FromBytes(message.owner) : void 0);
5083
- message.metadata !== void 0 && (obj.metadata = message.metadata);
5084
- message.sourceNetworkId !== void 0 && (obj.sourceNetworkId = sourceNetworkIdToJSON(message.sourceNetworkId));
5085
- message.maxCensusSize !== void 0 && (obj.maxCensusSize = Math.round(message.maxCensusSize));
5086
- message.rollingCensusRoot !== void 0 && (obj.rollingCensusRoot = message.rollingCensusRoot !== void 0 ? base64FromBytes(message.rollingCensusRoot) : void 0);
5087
- message.rollingCensusSize !== void 0 && (obj.rollingCensusSize = Math.round(message.rollingCensusSize));
5088
- message.nullifiersRoot !== void 0 && (obj.nullifiersRoot = message.nullifiersRoot !== void 0 ? base64FromBytes(message.nullifiersRoot) : void 0);
5089
- message.sourceNetworkContractAddr !== void 0 && (obj.sourceNetworkContractAddr = message.sourceNetworkContractAddr !== void 0 ? base64FromBytes(message.sourceNetworkContractAddr) : void 0);
5090
- message.tokenDecimals !== void 0 && (obj.tokenDecimals = Math.round(message.tokenDecimals));
5236
+ if (message.processId.length !== 0) {
5237
+ obj.processId = base64FromBytes(message.processId);
5238
+ }
5239
+ if (message.entityId.length !== 0) {
5240
+ obj.entityId = base64FromBytes(message.entityId);
5241
+ }
5242
+ if (message.startBlock !== 0) {
5243
+ obj.startBlock = Math.round(message.startBlock);
5244
+ }
5245
+ if (message.blockCount !== 0) {
5246
+ obj.blockCount = Math.round(message.blockCount);
5247
+ }
5248
+ if (message.censusRoot.length !== 0) {
5249
+ obj.censusRoot = base64FromBytes(message.censusRoot);
5250
+ }
5251
+ if (message.censusURI !== void 0) {
5252
+ obj.censusURI = message.censusURI;
5253
+ }
5254
+ if (message.encryptionPrivateKeys?.length) {
5255
+ obj.encryptionPrivateKeys = message.encryptionPrivateKeys;
5256
+ }
5257
+ if (message.encryptionPublicKeys?.length) {
5258
+ obj.encryptionPublicKeys = message.encryptionPublicKeys;
5259
+ }
5260
+ if (message.keyIndex !== void 0) {
5261
+ obj.keyIndex = Math.round(message.keyIndex);
5262
+ }
5263
+ if (message.status !== 0) {
5264
+ obj.status = processStatusToJSON(message.status);
5265
+ }
5266
+ if (message.paramsSignature !== void 0) {
5267
+ obj.paramsSignature = base64FromBytes(message.paramsSignature);
5268
+ }
5269
+ if (message.namespace !== 0) {
5270
+ obj.namespace = Math.round(message.namespace);
5271
+ }
5272
+ if (message.envelopeType !== void 0) {
5273
+ obj.envelopeType = EnvelopeType.toJSON(message.envelopeType);
5274
+ }
5275
+ if (message.mode !== void 0) {
5276
+ obj.mode = ProcessMode.toJSON(message.mode);
5277
+ }
5278
+ if (message.questionIndex !== void 0) {
5279
+ obj.questionIndex = Math.round(message.questionIndex);
5280
+ }
5281
+ if (message.questionCount !== void 0) {
5282
+ obj.questionCount = Math.round(message.questionCount);
5283
+ }
5284
+ if (message.voteOptions !== void 0) {
5285
+ obj.voteOptions = ProcessVoteOptions.toJSON(message.voteOptions);
5286
+ }
5287
+ if (message.censusOrigin !== 0) {
5288
+ obj.censusOrigin = censusOriginToJSON(message.censusOrigin);
5289
+ }
5290
+ if (message.results?.length) {
5291
+ obj.results = message.results.map((e) => ProcessResult.toJSON(e));
5292
+ }
5293
+ if (message.resultsSignatures?.length) {
5294
+ obj.resultsSignatures = message.resultsSignatures.map((e) => base64FromBytes(e));
5295
+ }
5296
+ if (message.ethIndexSlot !== void 0) {
5297
+ obj.ethIndexSlot = Math.round(message.ethIndexSlot);
5298
+ }
5299
+ if (message.sourceBlockHeight !== void 0) {
5300
+ obj.sourceBlockHeight = Math.round(message.sourceBlockHeight);
5301
+ }
5302
+ if (message.owner !== void 0) {
5303
+ obj.owner = base64FromBytes(message.owner);
5304
+ }
5305
+ if (message.metadata !== void 0) {
5306
+ obj.metadata = message.metadata;
5307
+ }
5308
+ if (message.sourceNetworkId !== 0) {
5309
+ obj.sourceNetworkId = sourceNetworkIdToJSON(message.sourceNetworkId);
5310
+ }
5311
+ if (message.maxCensusSize !== 0) {
5312
+ obj.maxCensusSize = Math.round(message.maxCensusSize);
5313
+ }
5314
+ if (message.rollingCensusRoot !== void 0) {
5315
+ obj.rollingCensusRoot = base64FromBytes(message.rollingCensusRoot);
5316
+ }
5317
+ if (message.rollingCensusSize !== void 0) {
5318
+ obj.rollingCensusSize = Math.round(message.rollingCensusSize);
5319
+ }
5320
+ if (message.nullifiersRoot !== void 0) {
5321
+ obj.nullifiersRoot = base64FromBytes(message.nullifiersRoot);
5322
+ }
5323
+ if (message.sourceNetworkContractAddr !== void 0) {
5324
+ obj.sourceNetworkContractAddr = base64FromBytes(message.sourceNetworkContractAddr);
5325
+ }
5326
+ if (message.tokenDecimals !== void 0) {
5327
+ obj.tokenDecimals = Math.round(message.tokenDecimals);
5328
+ }
5091
5329
  return obj;
5092
5330
  },
5093
5331
  create(base) {
@@ -5095,11 +5333,11 @@ var Process = {
5095
5333
  },
5096
5334
  fromPartial(object) {
5097
5335
  const message = createBaseProcess();
5098
- message.processId = object.processId ?? new Uint8Array();
5099
- message.entityId = object.entityId ?? new Uint8Array();
5336
+ message.processId = object.processId ?? new Uint8Array(0);
5337
+ message.entityId = object.entityId ?? new Uint8Array(0);
5100
5338
  message.startBlock = object.startBlock ?? 0;
5101
5339
  message.blockCount = object.blockCount ?? 0;
5102
- message.censusRoot = object.censusRoot ?? new Uint8Array();
5340
+ message.censusRoot = object.censusRoot ?? new Uint8Array(0);
5103
5341
  message.censusURI = object.censusURI ?? void 0;
5104
5342
  message.encryptionPrivateKeys = object.encryptionPrivateKeys?.map((e) => e) || [];
5105
5343
  message.encryptionPublicKeys = object.encryptionPublicKeys?.map((e) => e) || [];
@@ -5159,37 +5397,37 @@ var EnvelopeType = {
5159
5397
  const tag = reader.uint32();
5160
5398
  switch (tag >>> 3) {
5161
5399
  case 1:
5162
- if (tag != 8) {
5400
+ if (tag !== 8) {
5163
5401
  break;
5164
5402
  }
5165
5403
  message.serial = reader.bool();
5166
5404
  continue;
5167
5405
  case 2:
5168
- if (tag != 16) {
5406
+ if (tag !== 16) {
5169
5407
  break;
5170
5408
  }
5171
5409
  message.anonymous = reader.bool();
5172
5410
  continue;
5173
5411
  case 3:
5174
- if (tag != 24) {
5412
+ if (tag !== 24) {
5175
5413
  break;
5176
5414
  }
5177
5415
  message.encryptedVotes = reader.bool();
5178
5416
  continue;
5179
5417
  case 4:
5180
- if (tag != 32) {
5418
+ if (tag !== 32) {
5181
5419
  break;
5182
5420
  }
5183
5421
  message.uniqueValues = reader.bool();
5184
5422
  continue;
5185
5423
  case 5:
5186
- if (tag != 40) {
5424
+ if (tag !== 40) {
5187
5425
  break;
5188
5426
  }
5189
5427
  message.costFromWeight = reader.bool();
5190
5428
  continue;
5191
5429
  }
5192
- if ((tag & 7) == 4 || tag == 0) {
5430
+ if ((tag & 7) === 4 || tag === 0) {
5193
5431
  break;
5194
5432
  }
5195
5433
  reader.skipType(tag & 7);
@@ -5207,11 +5445,21 @@ var EnvelopeType = {
5207
5445
  },
5208
5446
  toJSON(message) {
5209
5447
  const obj = {};
5210
- message.serial !== void 0 && (obj.serial = message.serial);
5211
- message.anonymous !== void 0 && (obj.anonymous = message.anonymous);
5212
- message.encryptedVotes !== void 0 && (obj.encryptedVotes = message.encryptedVotes);
5213
- message.uniqueValues !== void 0 && (obj.uniqueValues = message.uniqueValues);
5214
- message.costFromWeight !== void 0 && (obj.costFromWeight = message.costFromWeight);
5448
+ if (message.serial === true) {
5449
+ obj.serial = message.serial;
5450
+ }
5451
+ if (message.anonymous === true) {
5452
+ obj.anonymous = message.anonymous;
5453
+ }
5454
+ if (message.encryptedVotes === true) {
5455
+ obj.encryptedVotes = message.encryptedVotes;
5456
+ }
5457
+ if (message.uniqueValues === true) {
5458
+ obj.uniqueValues = message.uniqueValues;
5459
+ }
5460
+ if (message.costFromWeight === true) {
5461
+ obj.costFromWeight = message.costFromWeight;
5462
+ }
5215
5463
  return obj;
5216
5464
  },
5217
5465
  create(base) {
@@ -5257,37 +5505,37 @@ var ProcessMode = {
5257
5505
  const tag = reader.uint32();
5258
5506
  switch (tag >>> 3) {
5259
5507
  case 1:
5260
- if (tag != 8) {
5508
+ if (tag !== 8) {
5261
5509
  break;
5262
5510
  }
5263
5511
  message.autoStart = reader.bool();
5264
5512
  continue;
5265
5513
  case 2:
5266
- if (tag != 16) {
5514
+ if (tag !== 16) {
5267
5515
  break;
5268
5516
  }
5269
5517
  message.interruptible = reader.bool();
5270
5518
  continue;
5271
5519
  case 3:
5272
- if (tag != 24) {
5520
+ if (tag !== 24) {
5273
5521
  break;
5274
5522
  }
5275
5523
  message.dynamicCensus = reader.bool();
5276
5524
  continue;
5277
5525
  case 4:
5278
- if (tag != 32) {
5526
+ if (tag !== 32) {
5279
5527
  break;
5280
5528
  }
5281
5529
  message.encryptedMetaData = reader.bool();
5282
5530
  continue;
5283
5531
  case 5:
5284
- if (tag != 40) {
5532
+ if (tag !== 40) {
5285
5533
  break;
5286
5534
  }
5287
5535
  message.preRegister = reader.bool();
5288
5536
  continue;
5289
5537
  }
5290
- if ((tag & 7) == 4 || tag == 0) {
5538
+ if ((tag & 7) === 4 || tag === 0) {
5291
5539
  break;
5292
5540
  }
5293
5541
  reader.skipType(tag & 7);
@@ -5305,11 +5553,21 @@ var ProcessMode = {
5305
5553
  },
5306
5554
  toJSON(message) {
5307
5555
  const obj = {};
5308
- message.autoStart !== void 0 && (obj.autoStart = message.autoStart);
5309
- message.interruptible !== void 0 && (obj.interruptible = message.interruptible);
5310
- message.dynamicCensus !== void 0 && (obj.dynamicCensus = message.dynamicCensus);
5311
- message.encryptedMetaData !== void 0 && (obj.encryptedMetaData = message.encryptedMetaData);
5312
- message.preRegister !== void 0 && (obj.preRegister = message.preRegister);
5556
+ if (message.autoStart === true) {
5557
+ obj.autoStart = message.autoStart;
5558
+ }
5559
+ if (message.interruptible === true) {
5560
+ obj.interruptible = message.interruptible;
5561
+ }
5562
+ if (message.dynamicCensus === true) {
5563
+ obj.dynamicCensus = message.dynamicCensus;
5564
+ }
5565
+ if (message.encryptedMetaData === true) {
5566
+ obj.encryptedMetaData = message.encryptedMetaData;
5567
+ }
5568
+ if (message.preRegister === true) {
5569
+ obj.preRegister = message.preRegister;
5570
+ }
5313
5571
  return obj;
5314
5572
  },
5315
5573
  create(base) {
@@ -5355,37 +5613,37 @@ var ProcessVoteOptions = {
5355
5613
  const tag = reader.uint32();
5356
5614
  switch (tag >>> 3) {
5357
5615
  case 1:
5358
- if (tag != 8) {
5616
+ if (tag !== 8) {
5359
5617
  break;
5360
5618
  }
5361
5619
  message.maxCount = reader.uint32();
5362
5620
  continue;
5363
5621
  case 2:
5364
- if (tag != 16) {
5622
+ if (tag !== 16) {
5365
5623
  break;
5366
5624
  }
5367
5625
  message.maxValue = reader.uint32();
5368
5626
  continue;
5369
5627
  case 3:
5370
- if (tag != 24) {
5628
+ if (tag !== 24) {
5371
5629
  break;
5372
5630
  }
5373
5631
  message.maxVoteOverwrites = reader.uint32();
5374
5632
  continue;
5375
5633
  case 4:
5376
- if (tag != 32) {
5634
+ if (tag !== 32) {
5377
5635
  break;
5378
5636
  }
5379
5637
  message.maxTotalCost = reader.uint32();
5380
5638
  continue;
5381
5639
  case 5:
5382
- if (tag != 40) {
5640
+ if (tag !== 40) {
5383
5641
  break;
5384
5642
  }
5385
5643
  message.costExponent = reader.uint32();
5386
5644
  continue;
5387
5645
  }
5388
- if ((tag & 7) == 4 || tag == 0) {
5646
+ if ((tag & 7) === 4 || tag === 0) {
5389
5647
  break;
5390
5648
  }
5391
5649
  reader.skipType(tag & 7);
@@ -5403,11 +5661,21 @@ var ProcessVoteOptions = {
5403
5661
  },
5404
5662
  toJSON(message) {
5405
5663
  const obj = {};
5406
- message.maxCount !== void 0 && (obj.maxCount = Math.round(message.maxCount));
5407
- message.maxValue !== void 0 && (obj.maxValue = Math.round(message.maxValue));
5408
- message.maxVoteOverwrites !== void 0 && (obj.maxVoteOverwrites = Math.round(message.maxVoteOverwrites));
5409
- message.maxTotalCost !== void 0 && (obj.maxTotalCost = Math.round(message.maxTotalCost));
5410
- message.costExponent !== void 0 && (obj.costExponent = Math.round(message.costExponent));
5664
+ if (message.maxCount !== 0) {
5665
+ obj.maxCount = Math.round(message.maxCount);
5666
+ }
5667
+ if (message.maxValue !== 0) {
5668
+ obj.maxValue = Math.round(message.maxValue);
5669
+ }
5670
+ if (message.maxVoteOverwrites !== 0) {
5671
+ obj.maxVoteOverwrites = Math.round(message.maxVoteOverwrites);
5672
+ }
5673
+ if (message.maxTotalCost !== 0) {
5674
+ obj.maxTotalCost = Math.round(message.maxTotalCost);
5675
+ }
5676
+ if (message.costExponent !== 0) {
5677
+ obj.costExponent = Math.round(message.costExponent);
5678
+ }
5411
5679
  return obj;
5412
5680
  },
5413
5681
  create(base) {
@@ -5441,13 +5709,13 @@ var OracleList = {
5441
5709
  const tag = reader.uint32();
5442
5710
  switch (tag >>> 3) {
5443
5711
  case 1:
5444
- if (tag != 10) {
5712
+ if (tag !== 10) {
5445
5713
  break;
5446
5714
  }
5447
5715
  message.oracles.push(reader.bytes());
5448
5716
  continue;
5449
5717
  }
5450
- if ((tag & 7) == 4 || tag == 0) {
5718
+ if ((tag & 7) === 4 || tag === 0) {
5451
5719
  break;
5452
5720
  }
5453
5721
  reader.skipType(tag & 7);
@@ -5459,10 +5727,8 @@ var OracleList = {
5459
5727
  },
5460
5728
  toJSON(message) {
5461
5729
  const obj = {};
5462
- if (message.oracles) {
5463
- obj.oracles = message.oracles.map((e) => base64FromBytes(e !== void 0 ? e : new Uint8Array()));
5464
- } else {
5465
- obj.oracles = [];
5730
+ if (message.oracles?.length) {
5731
+ obj.oracles = message.oracles.map((e) => base64FromBytes(e));
5466
5732
  }
5467
5733
  return obj;
5468
5734
  },
@@ -5493,13 +5759,13 @@ var ValidatorList = {
5493
5759
  const tag = reader.uint32();
5494
5760
  switch (tag >>> 3) {
5495
5761
  case 1:
5496
- if (tag != 10) {
5762
+ if (tag !== 10) {
5497
5763
  break;
5498
5764
  }
5499
5765
  message.validators.push(Validator.decode(reader, reader.uint32()));
5500
5766
  continue;
5501
5767
  }
5502
- if ((tag & 7) == 4 || tag == 0) {
5768
+ if ((tag & 7) === 4 || tag === 0) {
5503
5769
  break;
5504
5770
  }
5505
5771
  reader.skipType(tag & 7);
@@ -5513,10 +5779,8 @@ var ValidatorList = {
5513
5779
  },
5514
5780
  toJSON(message) {
5515
5781
  const obj = {};
5516
- if (message.validators) {
5517
- obj.validators = message.validators.map((e) => e ? Validator.toJSON(e) : void 0);
5518
- } else {
5519
- obj.validators = [];
5782
+ if (message.validators?.length) {
5783
+ obj.validators = message.validators.map((e) => Validator.toJSON(e));
5520
5784
  }
5521
5785
  return obj;
5522
5786
  },
@@ -5530,7 +5794,7 @@ var ValidatorList = {
5530
5794
  }
5531
5795
  };
5532
5796
  function createBaseValidator() {
5533
- return { address: new Uint8Array(), pubKey: new Uint8Array(), power: 0, name: "", keyIndex: 0 };
5797
+ return { address: new Uint8Array(0), pubKey: new Uint8Array(0), power: 0, name: "", keyIndex: 0 };
5534
5798
  }
5535
5799
  var Validator = {
5536
5800
  encode(message, writer = import_minimal.default.Writer.create()) {
@@ -5559,37 +5823,37 @@ var Validator = {
5559
5823
  const tag = reader.uint32();
5560
5824
  switch (tag >>> 3) {
5561
5825
  case 1:
5562
- if (tag != 10) {
5826
+ if (tag !== 10) {
5563
5827
  break;
5564
5828
  }
5565
5829
  message.address = reader.bytes();
5566
5830
  continue;
5567
5831
  case 2:
5568
- if (tag != 18) {
5832
+ if (tag !== 18) {
5569
5833
  break;
5570
5834
  }
5571
5835
  message.pubKey = reader.bytes();
5572
5836
  continue;
5573
5837
  case 3:
5574
- if (tag != 24) {
5838
+ if (tag !== 24) {
5575
5839
  break;
5576
5840
  }
5577
5841
  message.power = longToNumber(reader.uint64());
5578
5842
  continue;
5579
5843
  case 4:
5580
- if (tag != 34) {
5844
+ if (tag !== 34) {
5581
5845
  break;
5582
5846
  }
5583
5847
  message.name = reader.string();
5584
5848
  continue;
5585
5849
  case 5:
5586
- if (tag != 40) {
5850
+ if (tag !== 40) {
5587
5851
  break;
5588
5852
  }
5589
5853
  message.keyIndex = reader.uint32();
5590
5854
  continue;
5591
5855
  }
5592
- if ((tag & 7) == 4 || tag == 0) {
5856
+ if ((tag & 7) === 4 || tag === 0) {
5593
5857
  break;
5594
5858
  }
5595
5859
  reader.skipType(tag & 7);
@@ -5598,8 +5862,8 @@ var Validator = {
5598
5862
  },
5599
5863
  fromJSON(object) {
5600
5864
  return {
5601
- address: isSet(object.address) ? bytesFromBase64(object.address) : new Uint8Array(),
5602
- pubKey: isSet(object.pubKey) ? bytesFromBase64(object.pubKey) : new Uint8Array(),
5865
+ address: isSet(object.address) ? bytesFromBase64(object.address) : new Uint8Array(0),
5866
+ pubKey: isSet(object.pubKey) ? bytesFromBase64(object.pubKey) : new Uint8Array(0),
5603
5867
  power: isSet(object.power) ? Number(object.power) : 0,
5604
5868
  name: isSet(object.name) ? String(object.name) : "",
5605
5869
  keyIndex: isSet(object.keyIndex) ? Number(object.keyIndex) : 0
@@ -5607,11 +5871,21 @@ var Validator = {
5607
5871
  },
5608
5872
  toJSON(message) {
5609
5873
  const obj = {};
5610
- message.address !== void 0 && (obj.address = base64FromBytes(message.address !== void 0 ? message.address : new Uint8Array()));
5611
- message.pubKey !== void 0 && (obj.pubKey = base64FromBytes(message.pubKey !== void 0 ? message.pubKey : new Uint8Array()));
5612
- message.power !== void 0 && (obj.power = Math.round(message.power));
5613
- message.name !== void 0 && (obj.name = message.name);
5614
- message.keyIndex !== void 0 && (obj.keyIndex = Math.round(message.keyIndex));
5874
+ if (message.address.length !== 0) {
5875
+ obj.address = base64FromBytes(message.address);
5876
+ }
5877
+ if (message.pubKey.length !== 0) {
5878
+ obj.pubKey = base64FromBytes(message.pubKey);
5879
+ }
5880
+ if (message.power !== 0) {
5881
+ obj.power = Math.round(message.power);
5882
+ }
5883
+ if (message.name !== "") {
5884
+ obj.name = message.name;
5885
+ }
5886
+ if (message.keyIndex !== 0) {
5887
+ obj.keyIndex = Math.round(message.keyIndex);
5888
+ }
5615
5889
  return obj;
5616
5890
  },
5617
5891
  create(base) {
@@ -5619,8 +5893,8 @@ var Validator = {
5619
5893
  },
5620
5894
  fromPartial(object) {
5621
5895
  const message = createBaseValidator();
5622
- message.address = object.address ?? new Uint8Array();
5623
- message.pubKey = object.pubKey ?? new Uint8Array();
5896
+ message.address = object.address ?? new Uint8Array(0);
5897
+ message.pubKey = object.pubKey ?? new Uint8Array(0);
5624
5898
  message.power = object.power ?? 0;
5625
5899
  message.name = object.name ?? "";
5626
5900
  message.keyIndex = object.keyIndex ?? 0;
@@ -5632,16 +5906,16 @@ function createBaseTendermintHeader() {
5632
5906
  chainId: "",
5633
5907
  height: 0,
5634
5908
  timestamp: 0,
5635
- blockID: new Uint8Array(),
5636
- lastCommitHash: new Uint8Array(),
5637
- dataHash: new Uint8Array(),
5638
- validatorsHash: new Uint8Array(),
5639
- nextValidatorsHash: new Uint8Array(),
5640
- consensusHash: new Uint8Array(),
5641
- appHash: new Uint8Array(),
5642
- lastResultsHash: new Uint8Array(),
5643
- evidenceHash: new Uint8Array(),
5644
- proposerAddress: new Uint8Array()
5909
+ blockID: new Uint8Array(0),
5910
+ lastCommitHash: new Uint8Array(0),
5911
+ dataHash: new Uint8Array(0),
5912
+ validatorsHash: new Uint8Array(0),
5913
+ nextValidatorsHash: new Uint8Array(0),
5914
+ consensusHash: new Uint8Array(0),
5915
+ appHash: new Uint8Array(0),
5916
+ lastResultsHash: new Uint8Array(0),
5917
+ evidenceHash: new Uint8Array(0),
5918
+ proposerAddress: new Uint8Array(0)
5645
5919
  };
5646
5920
  }
5647
5921
  var TendermintHeader = {
@@ -5695,85 +5969,85 @@ var TendermintHeader = {
5695
5969
  const tag = reader.uint32();
5696
5970
  switch (tag >>> 3) {
5697
5971
  case 2:
5698
- if (tag != 18) {
5972
+ if (tag !== 18) {
5699
5973
  break;
5700
5974
  }
5701
5975
  message.chainId = reader.string();
5702
5976
  continue;
5703
5977
  case 3:
5704
- if (tag != 24) {
5978
+ if (tag !== 24) {
5705
5979
  break;
5706
5980
  }
5707
5981
  message.height = longToNumber(reader.int64());
5708
5982
  continue;
5709
5983
  case 4:
5710
- if (tag != 32) {
5984
+ if (tag !== 32) {
5711
5985
  break;
5712
5986
  }
5713
5987
  message.timestamp = longToNumber(reader.int64());
5714
5988
  continue;
5715
5989
  case 5:
5716
- if (tag != 42) {
5990
+ if (tag !== 42) {
5717
5991
  break;
5718
5992
  }
5719
5993
  message.blockID = reader.bytes();
5720
5994
  continue;
5721
5995
  case 6:
5722
- if (tag != 50) {
5996
+ if (tag !== 50) {
5723
5997
  break;
5724
5998
  }
5725
5999
  message.lastCommitHash = reader.bytes();
5726
6000
  continue;
5727
6001
  case 7:
5728
- if (tag != 58) {
6002
+ if (tag !== 58) {
5729
6003
  break;
5730
6004
  }
5731
6005
  message.dataHash = reader.bytes();
5732
6006
  continue;
5733
6007
  case 8:
5734
- if (tag != 66) {
6008
+ if (tag !== 66) {
5735
6009
  break;
5736
6010
  }
5737
6011
  message.validatorsHash = reader.bytes();
5738
6012
  continue;
5739
6013
  case 9:
5740
- if (tag != 74) {
6014
+ if (tag !== 74) {
5741
6015
  break;
5742
6016
  }
5743
6017
  message.nextValidatorsHash = reader.bytes();
5744
6018
  continue;
5745
6019
  case 10:
5746
- if (tag != 82) {
6020
+ if (tag !== 82) {
5747
6021
  break;
5748
6022
  }
5749
6023
  message.consensusHash = reader.bytes();
5750
6024
  continue;
5751
6025
  case 11:
5752
- if (tag != 90) {
6026
+ if (tag !== 90) {
5753
6027
  break;
5754
6028
  }
5755
6029
  message.appHash = reader.bytes();
5756
6030
  continue;
5757
6031
  case 12:
5758
- if (tag != 98) {
6032
+ if (tag !== 98) {
5759
6033
  break;
5760
6034
  }
5761
6035
  message.lastResultsHash = reader.bytes();
5762
6036
  continue;
5763
6037
  case 13:
5764
- if (tag != 106) {
6038
+ if (tag !== 106) {
5765
6039
  break;
5766
6040
  }
5767
6041
  message.evidenceHash = reader.bytes();
5768
6042
  continue;
5769
6043
  case 14:
5770
- if (tag != 114) {
6044
+ if (tag !== 114) {
5771
6045
  break;
5772
6046
  }
5773
6047
  message.proposerAddress = reader.bytes();
5774
6048
  continue;
5775
6049
  }
5776
- if ((tag & 7) == 4 || tag == 0) {
6050
+ if ((tag & 7) === 4 || tag === 0) {
5777
6051
  break;
5778
6052
  }
5779
6053
  reader.skipType(tag & 7);
@@ -5785,47 +6059,59 @@ var TendermintHeader = {
5785
6059
  chainId: isSet(object.chainId) ? String(object.chainId) : "",
5786
6060
  height: isSet(object.height) ? Number(object.height) : 0,
5787
6061
  timestamp: isSet(object.timestamp) ? Number(object.timestamp) : 0,
5788
- blockID: isSet(object.blockID) ? bytesFromBase64(object.blockID) : new Uint8Array(),
5789
- lastCommitHash: isSet(object.lastCommitHash) ? bytesFromBase64(object.lastCommitHash) : new Uint8Array(),
5790
- dataHash: isSet(object.dataHash) ? bytesFromBase64(object.dataHash) : new Uint8Array(),
5791
- validatorsHash: isSet(object.validatorsHash) ? bytesFromBase64(object.validatorsHash) : new Uint8Array(),
5792
- nextValidatorsHash: isSet(object.nextValidatorsHash) ? bytesFromBase64(object.nextValidatorsHash) : new Uint8Array(),
5793
- consensusHash: isSet(object.consensusHash) ? bytesFromBase64(object.consensusHash) : new Uint8Array(),
5794
- appHash: isSet(object.appHash) ? bytesFromBase64(object.appHash) : new Uint8Array(),
5795
- lastResultsHash: isSet(object.lastResultsHash) ? bytesFromBase64(object.lastResultsHash) : new Uint8Array(),
5796
- evidenceHash: isSet(object.evidenceHash) ? bytesFromBase64(object.evidenceHash) : new Uint8Array(),
5797
- proposerAddress: isSet(object.proposerAddress) ? bytesFromBase64(object.proposerAddress) : new Uint8Array()
6062
+ blockID: isSet(object.blockID) ? bytesFromBase64(object.blockID) : new Uint8Array(0),
6063
+ lastCommitHash: isSet(object.lastCommitHash) ? bytesFromBase64(object.lastCommitHash) : new Uint8Array(0),
6064
+ dataHash: isSet(object.dataHash) ? bytesFromBase64(object.dataHash) : new Uint8Array(0),
6065
+ validatorsHash: isSet(object.validatorsHash) ? bytesFromBase64(object.validatorsHash) : new Uint8Array(0),
6066
+ nextValidatorsHash: isSet(object.nextValidatorsHash) ? bytesFromBase64(object.nextValidatorsHash) : new Uint8Array(0),
6067
+ consensusHash: isSet(object.consensusHash) ? bytesFromBase64(object.consensusHash) : new Uint8Array(0),
6068
+ appHash: isSet(object.appHash) ? bytesFromBase64(object.appHash) : new Uint8Array(0),
6069
+ lastResultsHash: isSet(object.lastResultsHash) ? bytesFromBase64(object.lastResultsHash) : new Uint8Array(0),
6070
+ evidenceHash: isSet(object.evidenceHash) ? bytesFromBase64(object.evidenceHash) : new Uint8Array(0),
6071
+ proposerAddress: isSet(object.proposerAddress) ? bytesFromBase64(object.proposerAddress) : new Uint8Array(0)
5798
6072
  };
5799
6073
  },
5800
6074
  toJSON(message) {
5801
6075
  const obj = {};
5802
- message.chainId !== void 0 && (obj.chainId = message.chainId);
5803
- message.height !== void 0 && (obj.height = Math.round(message.height));
5804
- message.timestamp !== void 0 && (obj.timestamp = Math.round(message.timestamp));
5805
- message.blockID !== void 0 && (obj.blockID = base64FromBytes(message.blockID !== void 0 ? message.blockID : new Uint8Array()));
5806
- message.lastCommitHash !== void 0 && (obj.lastCommitHash = base64FromBytes(
5807
- message.lastCommitHash !== void 0 ? message.lastCommitHash : new Uint8Array()
5808
- ));
5809
- message.dataHash !== void 0 && (obj.dataHash = base64FromBytes(message.dataHash !== void 0 ? message.dataHash : new Uint8Array()));
5810
- message.validatorsHash !== void 0 && (obj.validatorsHash = base64FromBytes(
5811
- message.validatorsHash !== void 0 ? message.validatorsHash : new Uint8Array()
5812
- ));
5813
- message.nextValidatorsHash !== void 0 && (obj.nextValidatorsHash = base64FromBytes(
5814
- message.nextValidatorsHash !== void 0 ? message.nextValidatorsHash : new Uint8Array()
5815
- ));
5816
- message.consensusHash !== void 0 && (obj.consensusHash = base64FromBytes(
5817
- message.consensusHash !== void 0 ? message.consensusHash : new Uint8Array()
5818
- ));
5819
- message.appHash !== void 0 && (obj.appHash = base64FromBytes(message.appHash !== void 0 ? message.appHash : new Uint8Array()));
5820
- message.lastResultsHash !== void 0 && (obj.lastResultsHash = base64FromBytes(
5821
- message.lastResultsHash !== void 0 ? message.lastResultsHash : new Uint8Array()
5822
- ));
5823
- message.evidenceHash !== void 0 && (obj.evidenceHash = base64FromBytes(
5824
- message.evidenceHash !== void 0 ? message.evidenceHash : new Uint8Array()
5825
- ));
5826
- message.proposerAddress !== void 0 && (obj.proposerAddress = base64FromBytes(
5827
- message.proposerAddress !== void 0 ? message.proposerAddress : new Uint8Array()
5828
- ));
6076
+ if (message.chainId !== "") {
6077
+ obj.chainId = message.chainId;
6078
+ }
6079
+ if (message.height !== 0) {
6080
+ obj.height = Math.round(message.height);
6081
+ }
6082
+ if (message.timestamp !== 0) {
6083
+ obj.timestamp = Math.round(message.timestamp);
6084
+ }
6085
+ if (message.blockID.length !== 0) {
6086
+ obj.blockID = base64FromBytes(message.blockID);
6087
+ }
6088
+ if (message.lastCommitHash.length !== 0) {
6089
+ obj.lastCommitHash = base64FromBytes(message.lastCommitHash);
6090
+ }
6091
+ if (message.dataHash.length !== 0) {
6092
+ obj.dataHash = base64FromBytes(message.dataHash);
6093
+ }
6094
+ if (message.validatorsHash.length !== 0) {
6095
+ obj.validatorsHash = base64FromBytes(message.validatorsHash);
6096
+ }
6097
+ if (message.nextValidatorsHash.length !== 0) {
6098
+ obj.nextValidatorsHash = base64FromBytes(message.nextValidatorsHash);
6099
+ }
6100
+ if (message.consensusHash.length !== 0) {
6101
+ obj.consensusHash = base64FromBytes(message.consensusHash);
6102
+ }
6103
+ if (message.appHash.length !== 0) {
6104
+ obj.appHash = base64FromBytes(message.appHash);
6105
+ }
6106
+ if (message.lastResultsHash.length !== 0) {
6107
+ obj.lastResultsHash = base64FromBytes(message.lastResultsHash);
6108
+ }
6109
+ if (message.evidenceHash.length !== 0) {
6110
+ obj.evidenceHash = base64FromBytes(message.evidenceHash);
6111
+ }
6112
+ if (message.proposerAddress.length !== 0) {
6113
+ obj.proposerAddress = base64FromBytes(message.proposerAddress);
6114
+ }
5829
6115
  return obj;
5830
6116
  },
5831
6117
  create(base) {
@@ -5836,16 +6122,16 @@ var TendermintHeader = {
5836
6122
  message.chainId = object.chainId ?? "";
5837
6123
  message.height = object.height ?? 0;
5838
6124
  message.timestamp = object.timestamp ?? 0;
5839
- message.blockID = object.blockID ?? new Uint8Array();
5840
- message.lastCommitHash = object.lastCommitHash ?? new Uint8Array();
5841
- message.dataHash = object.dataHash ?? new Uint8Array();
5842
- message.validatorsHash = object.validatorsHash ?? new Uint8Array();
5843
- message.nextValidatorsHash = object.nextValidatorsHash ?? new Uint8Array();
5844
- message.consensusHash = object.consensusHash ?? new Uint8Array();
5845
- message.appHash = object.appHash ?? new Uint8Array();
5846
- message.lastResultsHash = object.lastResultsHash ?? new Uint8Array();
5847
- message.evidenceHash = object.evidenceHash ?? new Uint8Array();
5848
- message.proposerAddress = object.proposerAddress ?? new Uint8Array();
6125
+ message.blockID = object.blockID ?? new Uint8Array(0);
6126
+ message.lastCommitHash = object.lastCommitHash ?? new Uint8Array(0);
6127
+ message.dataHash = object.dataHash ?? new Uint8Array(0);
6128
+ message.validatorsHash = object.validatorsHash ?? new Uint8Array(0);
6129
+ message.nextValidatorsHash = object.nextValidatorsHash ?? new Uint8Array(0);
6130
+ message.consensusHash = object.consensusHash ?? new Uint8Array(0);
6131
+ message.appHash = object.appHash ?? new Uint8Array(0);
6132
+ message.lastResultsHash = object.lastResultsHash ?? new Uint8Array(0);
6133
+ message.evidenceHash = object.evidenceHash ?? new Uint8Array(0);
6134
+ message.proposerAddress = object.proposerAddress ?? new Uint8Array(0);
5849
6135
  return message;
5850
6136
  }
5851
6137
  };
@@ -5879,37 +6165,37 @@ var ProcessResult = {
5879
6165
  const tag = reader.uint32();
5880
6166
  switch (tag >>> 3) {
5881
6167
  case 1:
5882
- if (tag != 10) {
6168
+ if (tag !== 10) {
5883
6169
  break;
5884
6170
  }
5885
6171
  message.votes.push(QuestionResult.decode(reader, reader.uint32()));
5886
6172
  continue;
5887
6173
  case 2:
5888
- if (tag != 18) {
6174
+ if (tag !== 18) {
5889
6175
  break;
5890
6176
  }
5891
6177
  message.processId = reader.bytes();
5892
6178
  continue;
5893
6179
  case 3:
5894
- if (tag != 26) {
6180
+ if (tag !== 26) {
5895
6181
  break;
5896
6182
  }
5897
6183
  message.entityId = reader.bytes();
5898
6184
  continue;
5899
6185
  case 4:
5900
- if (tag != 34) {
6186
+ if (tag !== 34) {
5901
6187
  break;
5902
6188
  }
5903
6189
  message.oracleAddress = reader.bytes();
5904
6190
  continue;
5905
6191
  case 5:
5906
- if (tag != 42) {
6192
+ if (tag !== 42) {
5907
6193
  break;
5908
6194
  }
5909
6195
  message.signature = reader.bytes();
5910
6196
  continue;
5911
6197
  }
5912
- if ((tag & 7) == 4 || tag == 0) {
6198
+ if ((tag & 7) === 4 || tag === 0) {
5913
6199
  break;
5914
6200
  }
5915
6201
  reader.skipType(tag & 7);
@@ -5927,15 +6213,21 @@ var ProcessResult = {
5927
6213
  },
5928
6214
  toJSON(message) {
5929
6215
  const obj = {};
5930
- if (message.votes) {
5931
- obj.votes = message.votes.map((e) => e ? QuestionResult.toJSON(e) : void 0);
5932
- } else {
5933
- obj.votes = [];
5934
- }
5935
- message.processId !== void 0 && (obj.processId = message.processId !== void 0 ? base64FromBytes(message.processId) : void 0);
5936
- message.entityId !== void 0 && (obj.entityId = message.entityId !== void 0 ? base64FromBytes(message.entityId) : void 0);
5937
- message.oracleAddress !== void 0 && (obj.oracleAddress = message.oracleAddress !== void 0 ? base64FromBytes(message.oracleAddress) : void 0);
5938
- message.signature !== void 0 && (obj.signature = message.signature !== void 0 ? base64FromBytes(message.signature) : void 0);
6216
+ if (message.votes?.length) {
6217
+ obj.votes = message.votes.map((e) => QuestionResult.toJSON(e));
6218
+ }
6219
+ if (message.processId !== void 0) {
6220
+ obj.processId = base64FromBytes(message.processId);
6221
+ }
6222
+ if (message.entityId !== void 0) {
6223
+ obj.entityId = base64FromBytes(message.entityId);
6224
+ }
6225
+ if (message.oracleAddress !== void 0) {
6226
+ obj.oracleAddress = base64FromBytes(message.oracleAddress);
6227
+ }
6228
+ if (message.signature !== void 0) {
6229
+ obj.signature = base64FromBytes(message.signature);
6230
+ }
5939
6231
  return obj;
5940
6232
  },
5941
6233
  create(base) {
@@ -5969,13 +6261,13 @@ var QuestionResult = {
5969
6261
  const tag = reader.uint32();
5970
6262
  switch (tag >>> 3) {
5971
6263
  case 1:
5972
- if (tag != 10) {
6264
+ if (tag !== 10) {
5973
6265
  break;
5974
6266
  }
5975
6267
  message.question.push(reader.bytes());
5976
6268
  continue;
5977
6269
  }
5978
- if ((tag & 7) == 4 || tag == 0) {
6270
+ if ((tag & 7) === 4 || tag === 0) {
5979
6271
  break;
5980
6272
  }
5981
6273
  reader.skipType(tag & 7);
@@ -5987,10 +6279,8 @@ var QuestionResult = {
5987
6279
  },
5988
6280
  toJSON(message) {
5989
6281
  const obj = {};
5990
- if (message.question) {
5991
- obj.question = message.question.map((e) => base64FromBytes(e !== void 0 ? e : new Uint8Array()));
5992
- } else {
5993
- obj.question = [];
6282
+ if (message.question?.length) {
6283
+ obj.question = message.question.map((e) => base64FromBytes(e));
5994
6284
  }
5995
6285
  return obj;
5996
6286
  },
@@ -6021,13 +6311,13 @@ var ProcessEndingList = {
6021
6311
  const tag = reader.uint32();
6022
6312
  switch (tag >>> 3) {
6023
6313
  case 1:
6024
- if (tag != 10) {
6314
+ if (tag !== 10) {
6025
6315
  break;
6026
6316
  }
6027
6317
  message.processList.push(reader.bytes());
6028
6318
  continue;
6029
6319
  }
6030
- if ((tag & 7) == 4 || tag == 0) {
6320
+ if ((tag & 7) === 4 || tag === 0) {
6031
6321
  break;
6032
6322
  }
6033
6323
  reader.skipType(tag & 7);
@@ -6041,10 +6331,8 @@ var ProcessEndingList = {
6041
6331
  },
6042
6332
  toJSON(message) {
6043
6333
  const obj = {};
6044
- if (message.processList) {
6045
- obj.processList = message.processList.map((e) => base64FromBytes(e !== void 0 ? e : new Uint8Array()));
6046
- } else {
6047
- obj.processList = [];
6334
+ if (message.processList?.length) {
6335
+ obj.processList = message.processList.map((e) => base64FromBytes(e));
6048
6336
  }
6049
6337
  return obj;
6050
6338
  },
@@ -6075,13 +6363,13 @@ var StoredKeys = {
6075
6363
  const tag = reader.uint32();
6076
6364
  switch (tag >>> 3) {
6077
6365
  case 1:
6078
- if (tag != 10) {
6366
+ if (tag !== 10) {
6079
6367
  break;
6080
6368
  }
6081
6369
  message.pids.push(reader.bytes());
6082
6370
  continue;
6083
6371
  }
6084
- if ((tag & 7) == 4 || tag == 0) {
6372
+ if ((tag & 7) === 4 || tag === 0) {
6085
6373
  break;
6086
6374
  }
6087
6375
  reader.skipType(tag & 7);
@@ -6093,10 +6381,8 @@ var StoredKeys = {
6093
6381
  },
6094
6382
  toJSON(message) {
6095
6383
  const obj = {};
6096
- if (message.pids) {
6097
- obj.pids = message.pids.map((e) => base64FromBytes(e !== void 0 ? e : new Uint8Array()));
6098
- } else {
6099
- obj.pids = [];
6384
+ if (message.pids?.length) {
6385
+ obj.pids = message.pids.map((e) => base64FromBytes(e));
6100
6386
  }
6101
6387
  return obj;
6102
6388
  },