@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.
@@ -1996,11 +1996,11 @@ function proofArbo_KeyTypeToJSON(object) {
1996
1996
  }
1997
1997
  function createBaseVoteEnvelope() {
1998
1998
  return {
1999
- nonce: new Uint8Array(),
2000
- processId: new Uint8Array(),
1999
+ nonce: new Uint8Array(0),
2000
+ processId: new Uint8Array(0),
2001
2001
  proof: void 0,
2002
- votePackage: new Uint8Array(),
2003
- nullifier: new Uint8Array(),
2002
+ votePackage: new Uint8Array(0),
2003
+ nullifier: new Uint8Array(0),
2004
2004
  encryptionKeyIndexes: []
2005
2005
  };
2006
2006
  }
@@ -2036,41 +2036,41 @@ var VoteEnvelope = {
2036
2036
  const tag = reader.uint32();
2037
2037
  switch (tag >>> 3) {
2038
2038
  case 1:
2039
- if (tag != 10) {
2039
+ if (tag !== 10) {
2040
2040
  break;
2041
2041
  }
2042
2042
  message.nonce = reader.bytes();
2043
2043
  continue;
2044
2044
  case 2:
2045
- if (tag != 18) {
2045
+ if (tag !== 18) {
2046
2046
  break;
2047
2047
  }
2048
2048
  message.processId = reader.bytes();
2049
2049
  continue;
2050
2050
  case 3:
2051
- if (tag != 26) {
2051
+ if (tag !== 26) {
2052
2052
  break;
2053
2053
  }
2054
2054
  message.proof = Proof.decode(reader, reader.uint32());
2055
2055
  continue;
2056
2056
  case 4:
2057
- if (tag != 34) {
2057
+ if (tag !== 34) {
2058
2058
  break;
2059
2059
  }
2060
2060
  message.votePackage = reader.bytes();
2061
2061
  continue;
2062
2062
  case 5:
2063
- if (tag != 42) {
2063
+ if (tag !== 42) {
2064
2064
  break;
2065
2065
  }
2066
2066
  message.nullifier = reader.bytes();
2067
2067
  continue;
2068
2068
  case 6:
2069
- if (tag == 48) {
2069
+ if (tag === 48) {
2070
2070
  message.encryptionKeyIndexes.push(reader.uint32());
2071
2071
  continue;
2072
2072
  }
2073
- if (tag == 50) {
2073
+ if (tag === 50) {
2074
2074
  const end2 = reader.uint32() + reader.pos;
2075
2075
  while (reader.pos < end2) {
2076
2076
  message.encryptionKeyIndexes.push(reader.uint32());
@@ -2079,7 +2079,7 @@ var VoteEnvelope = {
2079
2079
  }
2080
2080
  break;
2081
2081
  }
2082
- if ((tag & 7) == 4 || tag == 0) {
2082
+ if ((tag & 7) === 4 || tag === 0) {
2083
2083
  break;
2084
2084
  }
2085
2085
  reader.skipType(tag & 7);
@@ -2088,25 +2088,33 @@ var VoteEnvelope = {
2088
2088
  },
2089
2089
  fromJSON(object) {
2090
2090
  return {
2091
- nonce: isSet(object.nonce) ? bytesFromBase64(object.nonce) : new Uint8Array(),
2092
- processId: isSet(object.processId) ? bytesFromBase64(object.processId) : new Uint8Array(),
2091
+ nonce: isSet(object.nonce) ? bytesFromBase64(object.nonce) : new Uint8Array(0),
2092
+ processId: isSet(object.processId) ? bytesFromBase64(object.processId) : new Uint8Array(0),
2093
2093
  proof: isSet(object.proof) ? Proof.fromJSON(object.proof) : void 0,
2094
- votePackage: isSet(object.votePackage) ? bytesFromBase64(object.votePackage) : new Uint8Array(),
2095
- nullifier: isSet(object.nullifier) ? bytesFromBase64(object.nullifier) : new Uint8Array(),
2094
+ votePackage: isSet(object.votePackage) ? bytesFromBase64(object.votePackage) : new Uint8Array(0),
2095
+ nullifier: isSet(object.nullifier) ? bytesFromBase64(object.nullifier) : new Uint8Array(0),
2096
2096
  encryptionKeyIndexes: Array.isArray(object?.encryptionKeyIndexes) ? object.encryptionKeyIndexes.map((e) => Number(e)) : []
2097
2097
  };
2098
2098
  },
2099
2099
  toJSON(message) {
2100
2100
  const obj = {};
2101
- message.nonce !== void 0 && (obj.nonce = base64FromBytes(message.nonce !== void 0 ? message.nonce : new Uint8Array()));
2102
- message.processId !== void 0 && (obj.processId = base64FromBytes(message.processId !== void 0 ? message.processId : new Uint8Array()));
2103
- message.proof !== void 0 && (obj.proof = message.proof ? Proof.toJSON(message.proof) : void 0);
2104
- message.votePackage !== void 0 && (obj.votePackage = base64FromBytes(message.votePackage !== void 0 ? message.votePackage : new Uint8Array()));
2105
- message.nullifier !== void 0 && (obj.nullifier = base64FromBytes(message.nullifier !== void 0 ? message.nullifier : new Uint8Array()));
2106
- if (message.encryptionKeyIndexes) {
2101
+ if (message.nonce.length !== 0) {
2102
+ obj.nonce = base64FromBytes(message.nonce);
2103
+ }
2104
+ if (message.processId.length !== 0) {
2105
+ obj.processId = base64FromBytes(message.processId);
2106
+ }
2107
+ if (message.proof !== void 0) {
2108
+ obj.proof = Proof.toJSON(message.proof);
2109
+ }
2110
+ if (message.votePackage.length !== 0) {
2111
+ obj.votePackage = base64FromBytes(message.votePackage);
2112
+ }
2113
+ if (message.nullifier.length !== 0) {
2114
+ obj.nullifier = base64FromBytes(message.nullifier);
2115
+ }
2116
+ if (message.encryptionKeyIndexes?.length) {
2107
2117
  obj.encryptionKeyIndexes = message.encryptionKeyIndexes.map((e) => Math.round(e));
2108
- } else {
2109
- obj.encryptionKeyIndexes = [];
2110
2118
  }
2111
2119
  return obj;
2112
2120
  },
@@ -2115,11 +2123,11 @@ var VoteEnvelope = {
2115
2123
  },
2116
2124
  fromPartial(object) {
2117
2125
  const message = createBaseVoteEnvelope();
2118
- message.nonce = object.nonce ?? new Uint8Array();
2119
- message.processId = object.processId ?? new Uint8Array();
2126
+ message.nonce = object.nonce ?? new Uint8Array(0);
2127
+ message.processId = object.processId ?? new Uint8Array(0);
2120
2128
  message.proof = object.proof !== void 0 && object.proof !== null ? Proof.fromPartial(object.proof) : void 0;
2121
- message.votePackage = object.votePackage ?? new Uint8Array();
2122
- message.nullifier = object.nullifier ?? new Uint8Array();
2129
+ message.votePackage = object.votePackage ?? new Uint8Array(0);
2130
+ message.nullifier = object.nullifier ?? new Uint8Array(0);
2123
2131
  message.encryptionKeyIndexes = object.encryptionKeyIndexes?.map((e) => e) || [];
2124
2132
  return message;
2125
2133
  }
@@ -2139,7 +2147,7 @@ var Census = {
2139
2147
  const tag = reader.uint32();
2140
2148
  switch (tag >>> 3) {
2141
2149
  }
2142
- if ((tag & 7) == 4 || tag == 0) {
2150
+ if ((tag & 7) === 4 || tag === 0) {
2143
2151
  break;
2144
2152
  }
2145
2153
  reader.skipType(tag & 7);
@@ -2202,19 +2210,19 @@ var Proof = {
2202
2210
  const tag = reader.uint32();
2203
2211
  switch (tag >>> 3) {
2204
2212
  case 1:
2205
- if (tag != 10) {
2213
+ if (tag !== 10) {
2206
2214
  break;
2207
2215
  }
2208
2216
  message.payload = { $case: "graviton", graviton: ProofGraviton.decode(reader, reader.uint32()) };
2209
2217
  continue;
2210
2218
  case 2:
2211
- if (tag != 18) {
2219
+ if (tag !== 18) {
2212
2220
  break;
2213
2221
  }
2214
2222
  message.payload = { $case: "iden3", iden3: ProofIden3.decode(reader, reader.uint32()) };
2215
2223
  continue;
2216
2224
  case 3:
2217
- if (tag != 26) {
2225
+ if (tag !== 26) {
2218
2226
  break;
2219
2227
  }
2220
2228
  message.payload = {
@@ -2223,7 +2231,7 @@ var Proof = {
2223
2231
  };
2224
2232
  continue;
2225
2233
  case 4:
2226
- if (tag != 34) {
2234
+ if (tag !== 34) {
2227
2235
  break;
2228
2236
  }
2229
2237
  message.payload = {
@@ -2232,31 +2240,31 @@ var Proof = {
2232
2240
  };
2233
2241
  continue;
2234
2242
  case 5:
2235
- if (tag != 42) {
2243
+ if (tag !== 42) {
2236
2244
  break;
2237
2245
  }
2238
2246
  message.payload = { $case: "ca", ca: ProofCA.decode(reader, reader.uint32()) };
2239
2247
  continue;
2240
2248
  case 6:
2241
- if (tag != 50) {
2249
+ if (tag !== 50) {
2242
2250
  break;
2243
2251
  }
2244
2252
  message.payload = { $case: "arbo", arbo: ProofArbo.decode(reader, reader.uint32()) };
2245
2253
  continue;
2246
2254
  case 7:
2247
- if (tag != 58) {
2255
+ if (tag !== 58) {
2248
2256
  break;
2249
2257
  }
2250
2258
  message.payload = { $case: "zkSnark", zkSnark: ProofZkSNARK.decode(reader, reader.uint32()) };
2251
2259
  continue;
2252
2260
  case 8:
2253
- if (tag != 66) {
2261
+ if (tag !== 66) {
2254
2262
  break;
2255
2263
  }
2256
2264
  message.payload = { $case: "minimeStorage", minimeStorage: ProofMinime.decode(reader, reader.uint32()) };
2257
2265
  continue;
2258
2266
  }
2259
- if ((tag & 7) == 4 || tag == 0) {
2267
+ if ((tag & 7) === 4 || tag === 0) {
2260
2268
  break;
2261
2269
  }
2262
2270
  reader.skipType(tag & 7);
@@ -2270,14 +2278,30 @@ var Proof = {
2270
2278
  },
2271
2279
  toJSON(message) {
2272
2280
  const obj = {};
2273
- message.payload?.$case === "graviton" && (obj.graviton = message.payload?.graviton ? ProofGraviton.toJSON(message.payload?.graviton) : void 0);
2274
- message.payload?.$case === "iden3" && (obj.iden3 = message.payload?.iden3 ? ProofIden3.toJSON(message.payload?.iden3) : void 0);
2275
- message.payload?.$case === "ethereumStorage" && (obj.ethereumStorage = message.payload?.ethereumStorage ? ProofEthereumStorage.toJSON(message.payload?.ethereumStorage) : void 0);
2276
- message.payload?.$case === "ethereumAccount" && (obj.ethereumAccount = message.payload?.ethereumAccount ? ProofEthereumAccount.toJSON(message.payload?.ethereumAccount) : void 0);
2277
- message.payload?.$case === "ca" && (obj.ca = message.payload?.ca ? ProofCA.toJSON(message.payload?.ca) : void 0);
2278
- message.payload?.$case === "arbo" && (obj.arbo = message.payload?.arbo ? ProofArbo.toJSON(message.payload?.arbo) : void 0);
2279
- message.payload?.$case === "zkSnark" && (obj.zkSnark = message.payload?.zkSnark ? ProofZkSNARK.toJSON(message.payload?.zkSnark) : void 0);
2280
- message.payload?.$case === "minimeStorage" && (obj.minimeStorage = message.payload?.minimeStorage ? ProofMinime.toJSON(message.payload?.minimeStorage) : void 0);
2281
+ if (message.payload?.$case === "graviton") {
2282
+ obj.graviton = ProofGraviton.toJSON(message.payload.graviton);
2283
+ }
2284
+ if (message.payload?.$case === "iden3") {
2285
+ obj.iden3 = ProofIden3.toJSON(message.payload.iden3);
2286
+ }
2287
+ if (message.payload?.$case === "ethereumStorage") {
2288
+ obj.ethereumStorage = ProofEthereumStorage.toJSON(message.payload.ethereumStorage);
2289
+ }
2290
+ if (message.payload?.$case === "ethereumAccount") {
2291
+ obj.ethereumAccount = ProofEthereumAccount.toJSON(message.payload.ethereumAccount);
2292
+ }
2293
+ if (message.payload?.$case === "ca") {
2294
+ obj.ca = ProofCA.toJSON(message.payload.ca);
2295
+ }
2296
+ if (message.payload?.$case === "arbo") {
2297
+ obj.arbo = ProofArbo.toJSON(message.payload.arbo);
2298
+ }
2299
+ if (message.payload?.$case === "zkSnark") {
2300
+ obj.zkSnark = ProofZkSNARK.toJSON(message.payload.zkSnark);
2301
+ }
2302
+ if (message.payload?.$case === "minimeStorage") {
2303
+ obj.minimeStorage = ProofMinime.toJSON(message.payload.minimeStorage);
2304
+ }
2281
2305
  return obj;
2282
2306
  },
2283
2307
  create(base) {
@@ -2322,7 +2346,7 @@ var Proof = {
2322
2346
  }
2323
2347
  };
2324
2348
  function createBaseProofGraviton() {
2325
- return { siblings: new Uint8Array() };
2349
+ return { siblings: new Uint8Array(0) };
2326
2350
  }
2327
2351
  var ProofGraviton = {
2328
2352
  encode(message, writer = import_minimal.default.Writer.create()) {
@@ -2339,13 +2363,13 @@ var ProofGraviton = {
2339
2363
  const tag = reader.uint32();
2340
2364
  switch (tag >>> 3) {
2341
2365
  case 1:
2342
- if (tag != 10) {
2366
+ if (tag !== 10) {
2343
2367
  break;
2344
2368
  }
2345
2369
  message.siblings = reader.bytes();
2346
2370
  continue;
2347
2371
  }
2348
- if ((tag & 7) == 4 || tag == 0) {
2372
+ if ((tag & 7) === 4 || tag === 0) {
2349
2373
  break;
2350
2374
  }
2351
2375
  reader.skipType(tag & 7);
@@ -2353,11 +2377,13 @@ var ProofGraviton = {
2353
2377
  return message;
2354
2378
  },
2355
2379
  fromJSON(object) {
2356
- return { siblings: isSet(object.siblings) ? bytesFromBase64(object.siblings) : new Uint8Array() };
2380
+ return { siblings: isSet(object.siblings) ? bytesFromBase64(object.siblings) : new Uint8Array(0) };
2357
2381
  },
2358
2382
  toJSON(message) {
2359
2383
  const obj = {};
2360
- message.siblings !== void 0 && (obj.siblings = base64FromBytes(message.siblings !== void 0 ? message.siblings : new Uint8Array()));
2384
+ if (message.siblings.length !== 0) {
2385
+ obj.siblings = base64FromBytes(message.siblings);
2386
+ }
2361
2387
  return obj;
2362
2388
  },
2363
2389
  create(base) {
@@ -2365,12 +2391,12 @@ var ProofGraviton = {
2365
2391
  },
2366
2392
  fromPartial(object) {
2367
2393
  const message = createBaseProofGraviton();
2368
- message.siblings = object.siblings ?? new Uint8Array();
2394
+ message.siblings = object.siblings ?? new Uint8Array(0);
2369
2395
  return message;
2370
2396
  }
2371
2397
  };
2372
2398
  function createBaseProofIden3() {
2373
- return { siblings: new Uint8Array() };
2399
+ return { siblings: new Uint8Array(0) };
2374
2400
  }
2375
2401
  var ProofIden3 = {
2376
2402
  encode(message, writer = import_minimal.default.Writer.create()) {
@@ -2387,13 +2413,13 @@ var ProofIden3 = {
2387
2413
  const tag = reader.uint32();
2388
2414
  switch (tag >>> 3) {
2389
2415
  case 1:
2390
- if (tag != 10) {
2416
+ if (tag !== 10) {
2391
2417
  break;
2392
2418
  }
2393
2419
  message.siblings = reader.bytes();
2394
2420
  continue;
2395
2421
  }
2396
- if ((tag & 7) == 4 || tag == 0) {
2422
+ if ((tag & 7) === 4 || tag === 0) {
2397
2423
  break;
2398
2424
  }
2399
2425
  reader.skipType(tag & 7);
@@ -2401,11 +2427,13 @@ var ProofIden3 = {
2401
2427
  return message;
2402
2428
  },
2403
2429
  fromJSON(object) {
2404
- return { siblings: isSet(object.siblings) ? bytesFromBase64(object.siblings) : new Uint8Array() };
2430
+ return { siblings: isSet(object.siblings) ? bytesFromBase64(object.siblings) : new Uint8Array(0) };
2405
2431
  },
2406
2432
  toJSON(message) {
2407
2433
  const obj = {};
2408
- message.siblings !== void 0 && (obj.siblings = base64FromBytes(message.siblings !== void 0 ? message.siblings : new Uint8Array()));
2434
+ if (message.siblings.length !== 0) {
2435
+ obj.siblings = base64FromBytes(message.siblings);
2436
+ }
2409
2437
  return obj;
2410
2438
  },
2411
2439
  create(base) {
@@ -2413,12 +2441,12 @@ var ProofIden3 = {
2413
2441
  },
2414
2442
  fromPartial(object) {
2415
2443
  const message = createBaseProofIden3();
2416
- message.siblings = object.siblings ?? new Uint8Array();
2444
+ message.siblings = object.siblings ?? new Uint8Array(0);
2417
2445
  return message;
2418
2446
  }
2419
2447
  };
2420
2448
  function createBaseProofEthereumStorage() {
2421
- return { key: new Uint8Array(), value: new Uint8Array(), siblings: [] };
2449
+ return { key: new Uint8Array(0), value: new Uint8Array(0), siblings: [] };
2422
2450
  }
2423
2451
  var ProofEthereumStorage = {
2424
2452
  encode(message, writer = import_minimal.default.Writer.create()) {
@@ -2441,25 +2469,25 @@ var ProofEthereumStorage = {
2441
2469
  const tag = reader.uint32();
2442
2470
  switch (tag >>> 3) {
2443
2471
  case 1:
2444
- if (tag != 10) {
2472
+ if (tag !== 10) {
2445
2473
  break;
2446
2474
  }
2447
2475
  message.key = reader.bytes();
2448
2476
  continue;
2449
2477
  case 2:
2450
- if (tag != 18) {
2478
+ if (tag !== 18) {
2451
2479
  break;
2452
2480
  }
2453
2481
  message.value = reader.bytes();
2454
2482
  continue;
2455
2483
  case 3:
2456
- if (tag != 26) {
2484
+ if (tag !== 26) {
2457
2485
  break;
2458
2486
  }
2459
2487
  message.siblings.push(reader.bytes());
2460
2488
  continue;
2461
2489
  }
2462
- if ((tag & 7) == 4 || tag == 0) {
2490
+ if ((tag & 7) === 4 || tag === 0) {
2463
2491
  break;
2464
2492
  }
2465
2493
  reader.skipType(tag & 7);
@@ -2468,19 +2496,21 @@ var ProofEthereumStorage = {
2468
2496
  },
2469
2497
  fromJSON(object) {
2470
2498
  return {
2471
- key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(),
2472
- value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(),
2499
+ key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(0),
2500
+ value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(0),
2473
2501
  siblings: Array.isArray(object?.siblings) ? object.siblings.map((e) => bytesFromBase64(e)) : []
2474
2502
  };
2475
2503
  },
2476
2504
  toJSON(message) {
2477
2505
  const obj = {};
2478
- message.key !== void 0 && (obj.key = base64FromBytes(message.key !== void 0 ? message.key : new Uint8Array()));
2479
- message.value !== void 0 && (obj.value = base64FromBytes(message.value !== void 0 ? message.value : new Uint8Array()));
2480
- if (message.siblings) {
2481
- obj.siblings = message.siblings.map((e) => base64FromBytes(e !== void 0 ? e : new Uint8Array()));
2482
- } else {
2483
- obj.siblings = [];
2506
+ if (message.key.length !== 0) {
2507
+ obj.key = base64FromBytes(message.key);
2508
+ }
2509
+ if (message.value.length !== 0) {
2510
+ obj.value = base64FromBytes(message.value);
2511
+ }
2512
+ if (message.siblings?.length) {
2513
+ obj.siblings = message.siblings.map((e) => base64FromBytes(e));
2484
2514
  }
2485
2515
  return obj;
2486
2516
  },
@@ -2489,18 +2519,18 @@ var ProofEthereumStorage = {
2489
2519
  },
2490
2520
  fromPartial(object) {
2491
2521
  const message = createBaseProofEthereumStorage();
2492
- message.key = object.key ?? new Uint8Array();
2493
- message.value = object.value ?? new Uint8Array();
2522
+ message.key = object.key ?? new Uint8Array(0);
2523
+ message.value = object.value ?? new Uint8Array(0);
2494
2524
  message.siblings = object.siblings?.map((e) => e) || [];
2495
2525
  return message;
2496
2526
  }
2497
2527
  };
2498
2528
  function createBaseProofEthereumAccount() {
2499
2529
  return {
2500
- nonce: new Uint8Array(),
2501
- balance: new Uint8Array(),
2502
- storageHash: new Uint8Array(),
2503
- codeHash: new Uint8Array(),
2530
+ nonce: new Uint8Array(0),
2531
+ balance: new Uint8Array(0),
2532
+ storageHash: new Uint8Array(0),
2533
+ codeHash: new Uint8Array(0),
2504
2534
  siblings: []
2505
2535
  };
2506
2536
  }
@@ -2531,37 +2561,37 @@ var ProofEthereumAccount = {
2531
2561
  const tag = reader.uint32();
2532
2562
  switch (tag >>> 3) {
2533
2563
  case 1:
2534
- if (tag != 10) {
2564
+ if (tag !== 10) {
2535
2565
  break;
2536
2566
  }
2537
2567
  message.nonce = reader.bytes();
2538
2568
  continue;
2539
2569
  case 2:
2540
- if (tag != 18) {
2570
+ if (tag !== 18) {
2541
2571
  break;
2542
2572
  }
2543
2573
  message.balance = reader.bytes();
2544
2574
  continue;
2545
2575
  case 3:
2546
- if (tag != 26) {
2576
+ if (tag !== 26) {
2547
2577
  break;
2548
2578
  }
2549
2579
  message.storageHash = reader.bytes();
2550
2580
  continue;
2551
2581
  case 4:
2552
- if (tag != 34) {
2582
+ if (tag !== 34) {
2553
2583
  break;
2554
2584
  }
2555
2585
  message.codeHash = reader.bytes();
2556
2586
  continue;
2557
2587
  case 5:
2558
- if (tag != 42) {
2588
+ if (tag !== 42) {
2559
2589
  break;
2560
2590
  }
2561
2591
  message.siblings.push(reader.bytes());
2562
2592
  continue;
2563
2593
  }
2564
- if ((tag & 7) == 4 || tag == 0) {
2594
+ if ((tag & 7) === 4 || tag === 0) {
2565
2595
  break;
2566
2596
  }
2567
2597
  reader.skipType(tag & 7);
@@ -2570,23 +2600,29 @@ var ProofEthereumAccount = {
2570
2600
  },
2571
2601
  fromJSON(object) {
2572
2602
  return {
2573
- nonce: isSet(object.nonce) ? bytesFromBase64(object.nonce) : new Uint8Array(),
2574
- balance: isSet(object.balance) ? bytesFromBase64(object.balance) : new Uint8Array(),
2575
- storageHash: isSet(object.storageHash) ? bytesFromBase64(object.storageHash) : new Uint8Array(),
2576
- codeHash: isSet(object.codeHash) ? bytesFromBase64(object.codeHash) : new Uint8Array(),
2603
+ nonce: isSet(object.nonce) ? bytesFromBase64(object.nonce) : new Uint8Array(0),
2604
+ balance: isSet(object.balance) ? bytesFromBase64(object.balance) : new Uint8Array(0),
2605
+ storageHash: isSet(object.storageHash) ? bytesFromBase64(object.storageHash) : new Uint8Array(0),
2606
+ codeHash: isSet(object.codeHash) ? bytesFromBase64(object.codeHash) : new Uint8Array(0),
2577
2607
  siblings: Array.isArray(object?.siblings) ? object.siblings.map((e) => bytesFromBase64(e)) : []
2578
2608
  };
2579
2609
  },
2580
2610
  toJSON(message) {
2581
2611
  const obj = {};
2582
- message.nonce !== void 0 && (obj.nonce = base64FromBytes(message.nonce !== void 0 ? message.nonce : new Uint8Array()));
2583
- message.balance !== void 0 && (obj.balance = base64FromBytes(message.balance !== void 0 ? message.balance : new Uint8Array()));
2584
- message.storageHash !== void 0 && (obj.storageHash = base64FromBytes(message.storageHash !== void 0 ? message.storageHash : new Uint8Array()));
2585
- message.codeHash !== void 0 && (obj.codeHash = base64FromBytes(message.codeHash !== void 0 ? message.codeHash : new Uint8Array()));
2586
- if (message.siblings) {
2587
- obj.siblings = message.siblings.map((e) => base64FromBytes(e !== void 0 ? e : new Uint8Array()));
2588
- } else {
2589
- obj.siblings = [];
2612
+ if (message.nonce.length !== 0) {
2613
+ obj.nonce = base64FromBytes(message.nonce);
2614
+ }
2615
+ if (message.balance.length !== 0) {
2616
+ obj.balance = base64FromBytes(message.balance);
2617
+ }
2618
+ if (message.storageHash.length !== 0) {
2619
+ obj.storageHash = base64FromBytes(message.storageHash);
2620
+ }
2621
+ if (message.codeHash.length !== 0) {
2622
+ obj.codeHash = base64FromBytes(message.codeHash);
2623
+ }
2624
+ if (message.siblings?.length) {
2625
+ obj.siblings = message.siblings.map((e) => base64FromBytes(e));
2590
2626
  }
2591
2627
  return obj;
2592
2628
  },
@@ -2595,10 +2631,10 @@ var ProofEthereumAccount = {
2595
2631
  },
2596
2632
  fromPartial(object) {
2597
2633
  const message = createBaseProofEthereumAccount();
2598
- message.nonce = object.nonce ?? new Uint8Array();
2599
- message.balance = object.balance ?? new Uint8Array();
2600
- message.storageHash = object.storageHash ?? new Uint8Array();
2601
- message.codeHash = object.codeHash ?? new Uint8Array();
2634
+ message.nonce = object.nonce ?? new Uint8Array(0);
2635
+ message.balance = object.balance ?? new Uint8Array(0);
2636
+ message.storageHash = object.storageHash ?? new Uint8Array(0);
2637
+ message.codeHash = object.codeHash ?? new Uint8Array(0);
2602
2638
  message.siblings = object.siblings?.map((e) => e) || [];
2603
2639
  return message;
2604
2640
  }
@@ -2624,19 +2660,19 @@ var ProofMinime = {
2624
2660
  const tag = reader.uint32();
2625
2661
  switch (tag >>> 3) {
2626
2662
  case 1:
2627
- if (tag != 10) {
2663
+ if (tag !== 10) {
2628
2664
  break;
2629
2665
  }
2630
2666
  message.proofPrevBlock = ProofEthereumStorage.decode(reader, reader.uint32());
2631
2667
  continue;
2632
2668
  case 2:
2633
- if (tag != 18) {
2669
+ if (tag !== 18) {
2634
2670
  break;
2635
2671
  }
2636
2672
  message.proofNextBlock = ProofEthereumStorage.decode(reader, reader.uint32());
2637
2673
  continue;
2638
2674
  }
2639
- if ((tag & 7) == 4 || tag == 0) {
2675
+ if ((tag & 7) === 4 || tag === 0) {
2640
2676
  break;
2641
2677
  }
2642
2678
  reader.skipType(tag & 7);
@@ -2651,8 +2687,12 @@ var ProofMinime = {
2651
2687
  },
2652
2688
  toJSON(message) {
2653
2689
  const obj = {};
2654
- message.proofPrevBlock !== void 0 && (obj.proofPrevBlock = message.proofPrevBlock ? ProofEthereumStorage.toJSON(message.proofPrevBlock) : void 0);
2655
- message.proofNextBlock !== void 0 && (obj.proofNextBlock = message.proofNextBlock ? ProofEthereumStorage.toJSON(message.proofNextBlock) : void 0);
2690
+ if (message.proofPrevBlock !== void 0) {
2691
+ obj.proofPrevBlock = ProofEthereumStorage.toJSON(message.proofPrevBlock);
2692
+ }
2693
+ if (message.proofNextBlock !== void 0) {
2694
+ obj.proofNextBlock = ProofEthereumStorage.toJSON(message.proofNextBlock);
2695
+ }
2656
2696
  return obj;
2657
2697
  },
2658
2698
  create(base) {
@@ -2666,7 +2706,7 @@ var ProofMinime = {
2666
2706
  }
2667
2707
  };
2668
2708
  function createBaseProofCA() {
2669
- return { type: 0, bundle: void 0, signature: new Uint8Array() };
2709
+ return { type: 0, bundle: void 0, signature: new Uint8Array(0) };
2670
2710
  }
2671
2711
  var ProofCA = {
2672
2712
  encode(message, writer = import_minimal.default.Writer.create()) {
@@ -2689,25 +2729,25 @@ var ProofCA = {
2689
2729
  const tag = reader.uint32();
2690
2730
  switch (tag >>> 3) {
2691
2731
  case 1:
2692
- if (tag != 8) {
2732
+ if (tag !== 8) {
2693
2733
  break;
2694
2734
  }
2695
2735
  message.type = reader.int32();
2696
2736
  continue;
2697
2737
  case 2:
2698
- if (tag != 18) {
2738
+ if (tag !== 18) {
2699
2739
  break;
2700
2740
  }
2701
2741
  message.bundle = CAbundle.decode(reader, reader.uint32());
2702
2742
  continue;
2703
2743
  case 3:
2704
- if (tag != 26) {
2744
+ if (tag !== 26) {
2705
2745
  break;
2706
2746
  }
2707
2747
  message.signature = reader.bytes();
2708
2748
  continue;
2709
2749
  }
2710
- if ((tag & 7) == 4 || tag == 0) {
2750
+ if ((tag & 7) === 4 || tag === 0) {
2711
2751
  break;
2712
2752
  }
2713
2753
  reader.skipType(tag & 7);
@@ -2718,14 +2758,20 @@ var ProofCA = {
2718
2758
  return {
2719
2759
  type: isSet(object.type) ? proofCA_TypeFromJSON(object.type) : 0,
2720
2760
  bundle: isSet(object.bundle) ? CAbundle.fromJSON(object.bundle) : void 0,
2721
- signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array()
2761
+ signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array(0)
2722
2762
  };
2723
2763
  },
2724
2764
  toJSON(message) {
2725
2765
  const obj = {};
2726
- message.type !== void 0 && (obj.type = proofCA_TypeToJSON(message.type));
2727
- message.bundle !== void 0 && (obj.bundle = message.bundle ? CAbundle.toJSON(message.bundle) : void 0);
2728
- message.signature !== void 0 && (obj.signature = base64FromBytes(message.signature !== void 0 ? message.signature : new Uint8Array()));
2766
+ if (message.type !== 0) {
2767
+ obj.type = proofCA_TypeToJSON(message.type);
2768
+ }
2769
+ if (message.bundle !== void 0) {
2770
+ obj.bundle = CAbundle.toJSON(message.bundle);
2771
+ }
2772
+ if (message.signature.length !== 0) {
2773
+ obj.signature = base64FromBytes(message.signature);
2774
+ }
2729
2775
  return obj;
2730
2776
  },
2731
2777
  create(base) {
@@ -2735,12 +2781,12 @@ var ProofCA = {
2735
2781
  const message = createBaseProofCA();
2736
2782
  message.type = object.type ?? 0;
2737
2783
  message.bundle = object.bundle !== void 0 && object.bundle !== null ? CAbundle.fromPartial(object.bundle) : void 0;
2738
- message.signature = object.signature ?? new Uint8Array();
2784
+ message.signature = object.signature ?? new Uint8Array(0);
2739
2785
  return message;
2740
2786
  }
2741
2787
  };
2742
2788
  function createBaseCAbundle() {
2743
- return { processId: new Uint8Array(), address: new Uint8Array() };
2789
+ return { processId: new Uint8Array(0), address: new Uint8Array(0) };
2744
2790
  }
2745
2791
  var CAbundle = {
2746
2792
  encode(message, writer = import_minimal.default.Writer.create()) {
@@ -2760,19 +2806,19 @@ var CAbundle = {
2760
2806
  const tag = reader.uint32();
2761
2807
  switch (tag >>> 3) {
2762
2808
  case 1:
2763
- if (tag != 10) {
2809
+ if (tag !== 10) {
2764
2810
  break;
2765
2811
  }
2766
2812
  message.processId = reader.bytes();
2767
2813
  continue;
2768
2814
  case 2:
2769
- if (tag != 18) {
2815
+ if (tag !== 18) {
2770
2816
  break;
2771
2817
  }
2772
2818
  message.address = reader.bytes();
2773
2819
  continue;
2774
2820
  }
2775
- if ((tag & 7) == 4 || tag == 0) {
2821
+ if ((tag & 7) === 4 || tag === 0) {
2776
2822
  break;
2777
2823
  }
2778
2824
  reader.skipType(tag & 7);
@@ -2781,14 +2827,18 @@ var CAbundle = {
2781
2827
  },
2782
2828
  fromJSON(object) {
2783
2829
  return {
2784
- processId: isSet(object.processId) ? bytesFromBase64(object.processId) : new Uint8Array(),
2785
- address: isSet(object.address) ? bytesFromBase64(object.address) : new Uint8Array()
2830
+ processId: isSet(object.processId) ? bytesFromBase64(object.processId) : new Uint8Array(0),
2831
+ address: isSet(object.address) ? bytesFromBase64(object.address) : new Uint8Array(0)
2786
2832
  };
2787
2833
  },
2788
2834
  toJSON(message) {
2789
2835
  const obj = {};
2790
- message.processId !== void 0 && (obj.processId = base64FromBytes(message.processId !== void 0 ? message.processId : new Uint8Array()));
2791
- message.address !== void 0 && (obj.address = base64FromBytes(message.address !== void 0 ? message.address : new Uint8Array()));
2836
+ if (message.processId.length !== 0) {
2837
+ obj.processId = base64FromBytes(message.processId);
2838
+ }
2839
+ if (message.address.length !== 0) {
2840
+ obj.address = base64FromBytes(message.address);
2841
+ }
2792
2842
  return obj;
2793
2843
  },
2794
2844
  create(base) {
@@ -2796,18 +2846,18 @@ var CAbundle = {
2796
2846
  },
2797
2847
  fromPartial(object) {
2798
2848
  const message = createBaseCAbundle();
2799
- message.processId = object.processId ?? new Uint8Array();
2800
- message.address = object.address ?? new Uint8Array();
2849
+ message.processId = object.processId ?? new Uint8Array(0);
2850
+ message.address = object.address ?? new Uint8Array(0);
2801
2851
  return message;
2802
2852
  }
2803
2853
  };
2804
2854
  function createBaseProofArbo() {
2805
2855
  return {
2806
2856
  type: 0,
2807
- siblings: new Uint8Array(),
2808
- leafWeight: new Uint8Array(),
2857
+ siblings: new Uint8Array(0),
2858
+ leafWeight: new Uint8Array(0),
2809
2859
  keyType: 0,
2810
- votingWeight: new Uint8Array()
2860
+ votingWeight: new Uint8Array(0)
2811
2861
  };
2812
2862
  }
2813
2863
  var ProofArbo = {
@@ -2837,37 +2887,37 @@ var ProofArbo = {
2837
2887
  const tag = reader.uint32();
2838
2888
  switch (tag >>> 3) {
2839
2889
  case 1:
2840
- if (tag != 8) {
2890
+ if (tag !== 8) {
2841
2891
  break;
2842
2892
  }
2843
2893
  message.type = reader.int32();
2844
2894
  continue;
2845
2895
  case 2:
2846
- if (tag != 18) {
2896
+ if (tag !== 18) {
2847
2897
  break;
2848
2898
  }
2849
2899
  message.siblings = reader.bytes();
2850
2900
  continue;
2851
2901
  case 3:
2852
- if (tag != 26) {
2902
+ if (tag !== 26) {
2853
2903
  break;
2854
2904
  }
2855
2905
  message.leafWeight = reader.bytes();
2856
2906
  continue;
2857
2907
  case 4:
2858
- if (tag != 32) {
2908
+ if (tag !== 32) {
2859
2909
  break;
2860
2910
  }
2861
2911
  message.keyType = reader.int32();
2862
2912
  continue;
2863
2913
  case 5:
2864
- if (tag != 42) {
2914
+ if (tag !== 42) {
2865
2915
  break;
2866
2916
  }
2867
2917
  message.votingWeight = reader.bytes();
2868
2918
  continue;
2869
2919
  }
2870
- if ((tag & 7) == 4 || tag == 0) {
2920
+ if ((tag & 7) === 4 || tag === 0) {
2871
2921
  break;
2872
2922
  }
2873
2923
  reader.skipType(tag & 7);
@@ -2877,21 +2927,29 @@ var ProofArbo = {
2877
2927
  fromJSON(object) {
2878
2928
  return {
2879
2929
  type: isSet(object.type) ? proofArbo_TypeFromJSON(object.type) : 0,
2880
- siblings: isSet(object.siblings) ? bytesFromBase64(object.siblings) : new Uint8Array(),
2881
- leafWeight: isSet(object.leafWeight) ? bytesFromBase64(object.leafWeight) : new Uint8Array(),
2930
+ siblings: isSet(object.siblings) ? bytesFromBase64(object.siblings) : new Uint8Array(0),
2931
+ leafWeight: isSet(object.leafWeight) ? bytesFromBase64(object.leafWeight) : new Uint8Array(0),
2882
2932
  keyType: isSet(object.keyType) ? proofArbo_KeyTypeFromJSON(object.keyType) : 0,
2883
- votingWeight: isSet(object.votingWeight) ? bytesFromBase64(object.votingWeight) : new Uint8Array()
2933
+ votingWeight: isSet(object.votingWeight) ? bytesFromBase64(object.votingWeight) : new Uint8Array(0)
2884
2934
  };
2885
2935
  },
2886
2936
  toJSON(message) {
2887
2937
  const obj = {};
2888
- message.type !== void 0 && (obj.type = proofArbo_TypeToJSON(message.type));
2889
- message.siblings !== void 0 && (obj.siblings = base64FromBytes(message.siblings !== void 0 ? message.siblings : new Uint8Array()));
2890
- message.leafWeight !== void 0 && (obj.leafWeight = base64FromBytes(message.leafWeight !== void 0 ? message.leafWeight : new Uint8Array()));
2891
- message.keyType !== void 0 && (obj.keyType = proofArbo_KeyTypeToJSON(message.keyType));
2892
- message.votingWeight !== void 0 && (obj.votingWeight = base64FromBytes(
2893
- message.votingWeight !== void 0 ? message.votingWeight : new Uint8Array()
2894
- ));
2938
+ if (message.type !== 0) {
2939
+ obj.type = proofArbo_TypeToJSON(message.type);
2940
+ }
2941
+ if (message.siblings.length !== 0) {
2942
+ obj.siblings = base64FromBytes(message.siblings);
2943
+ }
2944
+ if (message.leafWeight.length !== 0) {
2945
+ obj.leafWeight = base64FromBytes(message.leafWeight);
2946
+ }
2947
+ if (message.keyType !== 0) {
2948
+ obj.keyType = proofArbo_KeyTypeToJSON(message.keyType);
2949
+ }
2950
+ if (message.votingWeight.length !== 0) {
2951
+ obj.votingWeight = base64FromBytes(message.votingWeight);
2952
+ }
2895
2953
  return obj;
2896
2954
  },
2897
2955
  create(base) {
@@ -2900,10 +2958,10 @@ var ProofArbo = {
2900
2958
  fromPartial(object) {
2901
2959
  const message = createBaseProofArbo();
2902
2960
  message.type = object.type ?? 0;
2903
- message.siblings = object.siblings ?? new Uint8Array();
2904
- message.leafWeight = object.leafWeight ?? new Uint8Array();
2961
+ message.siblings = object.siblings ?? new Uint8Array(0);
2962
+ message.leafWeight = object.leafWeight ?? new Uint8Array(0);
2905
2963
  message.keyType = object.keyType ?? 0;
2906
- message.votingWeight = object.votingWeight ?? new Uint8Array();
2964
+ message.votingWeight = object.votingWeight ?? new Uint8Array(0);
2907
2965
  return message;
2908
2966
  }
2909
2967
  };
@@ -2937,37 +2995,37 @@ var ProofZkSNARK = {
2937
2995
  const tag = reader.uint32();
2938
2996
  switch (tag >>> 3) {
2939
2997
  case 1:
2940
- if (tag != 8) {
2998
+ if (tag !== 8) {
2941
2999
  break;
2942
3000
  }
2943
3001
  message.circuitParametersIndex = reader.int32();
2944
3002
  continue;
2945
3003
  case 2:
2946
- if (tag != 18) {
3004
+ if (tag !== 18) {
2947
3005
  break;
2948
3006
  }
2949
3007
  message.a.push(reader.string());
2950
3008
  continue;
2951
3009
  case 3:
2952
- if (tag != 26) {
3010
+ if (tag !== 26) {
2953
3011
  break;
2954
3012
  }
2955
3013
  message.b.push(reader.string());
2956
3014
  continue;
2957
3015
  case 4:
2958
- if (tag != 34) {
3016
+ if (tag !== 34) {
2959
3017
  break;
2960
3018
  }
2961
3019
  message.c.push(reader.string());
2962
3020
  continue;
2963
3021
  case 5:
2964
- if (tag != 42) {
3022
+ if (tag !== 42) {
2965
3023
  break;
2966
3024
  }
2967
3025
  message.publicInputs.push(reader.string());
2968
3026
  continue;
2969
3027
  }
2970
- if ((tag & 7) == 4 || tag == 0) {
3028
+ if ((tag & 7) === 4 || tag === 0) {
2971
3029
  break;
2972
3030
  }
2973
3031
  reader.skipType(tag & 7);
@@ -2985,26 +3043,20 @@ var ProofZkSNARK = {
2985
3043
  },
2986
3044
  toJSON(message) {
2987
3045
  const obj = {};
2988
- message.circuitParametersIndex !== void 0 && (obj.circuitParametersIndex = Math.round(message.circuitParametersIndex));
2989
- if (message.a) {
2990
- obj.a = message.a.map((e) => e);
2991
- } else {
2992
- obj.a = [];
2993
- }
2994
- if (message.b) {
2995
- obj.b = message.b.map((e) => e);
2996
- } else {
2997
- obj.b = [];
2998
- }
2999
- if (message.c) {
3000
- obj.c = message.c.map((e) => e);
3001
- } else {
3002
- obj.c = [];
3003
- }
3004
- if (message.publicInputs) {
3005
- obj.publicInputs = message.publicInputs.map((e) => e);
3006
- } else {
3007
- obj.publicInputs = [];
3046
+ if (message.circuitParametersIndex !== 0) {
3047
+ obj.circuitParametersIndex = Math.round(message.circuitParametersIndex);
3048
+ }
3049
+ if (message.a?.length) {
3050
+ obj.a = message.a;
3051
+ }
3052
+ if (message.b?.length) {
3053
+ obj.b = message.b;
3054
+ }
3055
+ if (message.c?.length) {
3056
+ obj.c = message.c;
3057
+ }
3058
+ if (message.publicInputs?.length) {
3059
+ obj.publicInputs = message.publicInputs;
3008
3060
  }
3009
3061
  return obj;
3010
3062
  },
@@ -3051,37 +3103,37 @@ var Account = {
3051
3103
  const tag = reader.uint32();
3052
3104
  switch (tag >>> 3) {
3053
3105
  case 1:
3054
- if (tag != 8) {
3106
+ if (tag !== 8) {
3055
3107
  break;
3056
3108
  }
3057
3109
  message.balance = longToNumber(reader.uint64());
3058
3110
  continue;
3059
3111
  case 2:
3060
- if (tag != 16) {
3112
+ if (tag !== 16) {
3061
3113
  break;
3062
3114
  }
3063
3115
  message.nonce = reader.uint32();
3064
3116
  continue;
3065
3117
  case 3:
3066
- if (tag != 26) {
3118
+ if (tag !== 26) {
3067
3119
  break;
3068
3120
  }
3069
3121
  message.infoURI = reader.string();
3070
3122
  continue;
3071
3123
  case 4:
3072
- if (tag != 34) {
3124
+ if (tag !== 34) {
3073
3125
  break;
3074
3126
  }
3075
3127
  message.delegateAddrs.push(reader.bytes());
3076
3128
  continue;
3077
3129
  case 5:
3078
- if (tag != 40) {
3130
+ if (tag !== 40) {
3079
3131
  break;
3080
3132
  }
3081
3133
  message.processIndex = reader.uint32();
3082
3134
  continue;
3083
3135
  }
3084
- if ((tag & 7) == 4 || tag == 0) {
3136
+ if ((tag & 7) === 4 || tag === 0) {
3085
3137
  break;
3086
3138
  }
3087
3139
  reader.skipType(tag & 7);
@@ -3099,15 +3151,21 @@ var Account = {
3099
3151
  },
3100
3152
  toJSON(message) {
3101
3153
  const obj = {};
3102
- message.balance !== void 0 && (obj.balance = Math.round(message.balance));
3103
- message.nonce !== void 0 && (obj.nonce = Math.round(message.nonce));
3104
- message.infoURI !== void 0 && (obj.infoURI = message.infoURI);
3105
- if (message.delegateAddrs) {
3106
- obj.delegateAddrs = message.delegateAddrs.map((e) => base64FromBytes(e !== void 0 ? e : new Uint8Array()));
3107
- } else {
3108
- obj.delegateAddrs = [];
3109
- }
3110
- message.processIndex !== void 0 && (obj.processIndex = Math.round(message.processIndex));
3154
+ if (message.balance !== 0) {
3155
+ obj.balance = Math.round(message.balance);
3156
+ }
3157
+ if (message.nonce !== 0) {
3158
+ obj.nonce = Math.round(message.nonce);
3159
+ }
3160
+ if (message.infoURI !== "") {
3161
+ obj.infoURI = message.infoURI;
3162
+ }
3163
+ if (message.delegateAddrs?.length) {
3164
+ obj.delegateAddrs = message.delegateAddrs.map((e) => base64FromBytes(e));
3165
+ }
3166
+ if (message.processIndex !== 0) {
3167
+ obj.processIndex = Math.round(message.processIndex);
3168
+ }
3111
3169
  return obj;
3112
3170
  },
3113
3171
  create(base) {
@@ -3124,7 +3182,7 @@ var Account = {
3124
3182
  }
3125
3183
  };
3126
3184
  function createBaseTreasurer() {
3127
- return { address: new Uint8Array(), nonce: 0 };
3185
+ return { address: new Uint8Array(0), nonce: 0 };
3128
3186
  }
3129
3187
  var Treasurer = {
3130
3188
  encode(message, writer = import_minimal.default.Writer.create()) {
@@ -3144,19 +3202,19 @@ var Treasurer = {
3144
3202
  const tag = reader.uint32();
3145
3203
  switch (tag >>> 3) {
3146
3204
  case 1:
3147
- if (tag != 10) {
3205
+ if (tag !== 10) {
3148
3206
  break;
3149
3207
  }
3150
3208
  message.address = reader.bytes();
3151
3209
  continue;
3152
3210
  case 2:
3153
- if (tag != 16) {
3211
+ if (tag !== 16) {
3154
3212
  break;
3155
3213
  }
3156
3214
  message.nonce = reader.uint32();
3157
3215
  continue;
3158
3216
  }
3159
- if ((tag & 7) == 4 || tag == 0) {
3217
+ if ((tag & 7) === 4 || tag === 0) {
3160
3218
  break;
3161
3219
  }
3162
3220
  reader.skipType(tag & 7);
@@ -3165,14 +3223,18 @@ var Treasurer = {
3165
3223
  },
3166
3224
  fromJSON(object) {
3167
3225
  return {
3168
- address: isSet(object.address) ? bytesFromBase64(object.address) : new Uint8Array(),
3226
+ address: isSet(object.address) ? bytesFromBase64(object.address) : new Uint8Array(0),
3169
3227
  nonce: isSet(object.nonce) ? Number(object.nonce) : 0
3170
3228
  };
3171
3229
  },
3172
3230
  toJSON(message) {
3173
3231
  const obj = {};
3174
- message.address !== void 0 && (obj.address = base64FromBytes(message.address !== void 0 ? message.address : new Uint8Array()));
3175
- message.nonce !== void 0 && (obj.nonce = Math.round(message.nonce));
3232
+ if (message.address.length !== 0) {
3233
+ obj.address = base64FromBytes(message.address);
3234
+ }
3235
+ if (message.nonce !== 0) {
3236
+ obj.nonce = Math.round(message.nonce);
3237
+ }
3176
3238
  return obj;
3177
3239
  },
3178
3240
  create(base) {
@@ -3180,7 +3242,7 @@ var Treasurer = {
3180
3242
  },
3181
3243
  fromPartial(object) {
3182
3244
  const message = createBaseTreasurer();
3183
- message.address = object.address ?? new Uint8Array();
3245
+ message.address = object.address ?? new Uint8Array(0);
3184
3246
  message.nonce = object.nonce ?? 0;
3185
3247
  return message;
3186
3248
  }
@@ -3235,49 +3297,49 @@ var Tx = {
3235
3297
  const tag = reader.uint32();
3236
3298
  switch (tag >>> 3) {
3237
3299
  case 1:
3238
- if (tag != 10) {
3300
+ if (tag !== 10) {
3239
3301
  break;
3240
3302
  }
3241
3303
  message.payload = { $case: "vote", vote: VoteEnvelope.decode(reader, reader.uint32()) };
3242
3304
  continue;
3243
3305
  case 2:
3244
- if (tag != 18) {
3306
+ if (tag !== 18) {
3245
3307
  break;
3246
3308
  }
3247
3309
  message.payload = { $case: "newProcess", newProcess: NewProcessTx.decode(reader, reader.uint32()) };
3248
3310
  continue;
3249
3311
  case 3:
3250
- if (tag != 26) {
3312
+ if (tag !== 26) {
3251
3313
  break;
3252
3314
  }
3253
3315
  message.payload = { $case: "admin", admin: AdminTx.decode(reader, reader.uint32()) };
3254
3316
  continue;
3255
3317
  case 4:
3256
- if (tag != 34) {
3318
+ if (tag !== 34) {
3257
3319
  break;
3258
3320
  }
3259
3321
  message.payload = { $case: "setProcess", setProcess: SetProcessTx.decode(reader, reader.uint32()) };
3260
3322
  continue;
3261
3323
  case 5:
3262
- if (tag != 42) {
3324
+ if (tag !== 42) {
3263
3325
  break;
3264
3326
  }
3265
3327
  message.payload = { $case: "registerKey", registerKey: RegisterKeyTx.decode(reader, reader.uint32()) };
3266
3328
  continue;
3267
3329
  case 6:
3268
- if (tag != 50) {
3330
+ if (tag !== 50) {
3269
3331
  break;
3270
3332
  }
3271
3333
  message.payload = { $case: "mintTokens", mintTokens: MintTokensTx.decode(reader, reader.uint32()) };
3272
3334
  continue;
3273
3335
  case 7:
3274
- if (tag != 58) {
3336
+ if (tag !== 58) {
3275
3337
  break;
3276
3338
  }
3277
3339
  message.payload = { $case: "sendTokens", sendTokens: SendTokensTx.decode(reader, reader.uint32()) };
3278
3340
  continue;
3279
3341
  case 8:
3280
- if (tag != 66) {
3342
+ if (tag !== 66) {
3281
3343
  break;
3282
3344
  }
3283
3345
  message.payload = {
@@ -3286,25 +3348,25 @@ var Tx = {
3286
3348
  };
3287
3349
  continue;
3288
3350
  case 9:
3289
- if (tag != 74) {
3351
+ if (tag !== 74) {
3290
3352
  break;
3291
3353
  }
3292
3354
  message.payload = { $case: "setAccount", setAccount: SetAccountTx.decode(reader, reader.uint32()) };
3293
3355
  continue;
3294
3356
  case 10:
3295
- if (tag != 82) {
3357
+ if (tag !== 82) {
3296
3358
  break;
3297
3359
  }
3298
3360
  message.payload = { $case: "collectFaucet", collectFaucet: CollectFaucetTx.decode(reader, reader.uint32()) };
3299
3361
  continue;
3300
3362
  case 11:
3301
- if (tag != 90) {
3363
+ if (tag !== 90) {
3302
3364
  break;
3303
3365
  }
3304
3366
  message.payload = { $case: "setKeykeeper", setKeykeeper: SetKeykeeperTx.decode(reader, reader.uint32()) };
3305
3367
  continue;
3306
3368
  }
3307
- if ((tag & 7) == 4 || tag == 0) {
3369
+ if ((tag & 7) === 4 || tag === 0) {
3308
3370
  break;
3309
3371
  }
3310
3372
  reader.skipType(tag & 7);
@@ -3321,17 +3383,39 @@ var Tx = {
3321
3383
  },
3322
3384
  toJSON(message) {
3323
3385
  const obj = {};
3324
- message.payload?.$case === "vote" && (obj.vote = message.payload?.vote ? VoteEnvelope.toJSON(message.payload?.vote) : void 0);
3325
- message.payload?.$case === "newProcess" && (obj.newProcess = message.payload?.newProcess ? NewProcessTx.toJSON(message.payload?.newProcess) : void 0);
3326
- message.payload?.$case === "admin" && (obj.admin = message.payload?.admin ? AdminTx.toJSON(message.payload?.admin) : void 0);
3327
- message.payload?.$case === "setProcess" && (obj.setProcess = message.payload?.setProcess ? SetProcessTx.toJSON(message.payload?.setProcess) : void 0);
3328
- message.payload?.$case === "registerKey" && (obj.registerKey = message.payload?.registerKey ? RegisterKeyTx.toJSON(message.payload?.registerKey) : void 0);
3329
- message.payload?.$case === "mintTokens" && (obj.mintTokens = message.payload?.mintTokens ? MintTokensTx.toJSON(message.payload?.mintTokens) : void 0);
3330
- message.payload?.$case === "sendTokens" && (obj.sendTokens = message.payload?.sendTokens ? SendTokensTx.toJSON(message.payload?.sendTokens) : void 0);
3331
- message.payload?.$case === "setTransactionCosts" && (obj.setTransactionCosts = message.payload?.setTransactionCosts ? SetTransactionCostsTx.toJSON(message.payload?.setTransactionCosts) : void 0);
3332
- message.payload?.$case === "setAccount" && (obj.setAccount = message.payload?.setAccount ? SetAccountTx.toJSON(message.payload?.setAccount) : void 0);
3333
- message.payload?.$case === "collectFaucet" && (obj.collectFaucet = message.payload?.collectFaucet ? CollectFaucetTx.toJSON(message.payload?.collectFaucet) : void 0);
3334
- message.payload?.$case === "setKeykeeper" && (obj.setKeykeeper = message.payload?.setKeykeeper ? SetKeykeeperTx.toJSON(message.payload?.setKeykeeper) : void 0);
3386
+ if (message.payload?.$case === "vote") {
3387
+ obj.vote = VoteEnvelope.toJSON(message.payload.vote);
3388
+ }
3389
+ if (message.payload?.$case === "newProcess") {
3390
+ obj.newProcess = NewProcessTx.toJSON(message.payload.newProcess);
3391
+ }
3392
+ if (message.payload?.$case === "admin") {
3393
+ obj.admin = AdminTx.toJSON(message.payload.admin);
3394
+ }
3395
+ if (message.payload?.$case === "setProcess") {
3396
+ obj.setProcess = SetProcessTx.toJSON(message.payload.setProcess);
3397
+ }
3398
+ if (message.payload?.$case === "registerKey") {
3399
+ obj.registerKey = RegisterKeyTx.toJSON(message.payload.registerKey);
3400
+ }
3401
+ if (message.payload?.$case === "mintTokens") {
3402
+ obj.mintTokens = MintTokensTx.toJSON(message.payload.mintTokens);
3403
+ }
3404
+ if (message.payload?.$case === "sendTokens") {
3405
+ obj.sendTokens = SendTokensTx.toJSON(message.payload.sendTokens);
3406
+ }
3407
+ if (message.payload?.$case === "setTransactionCosts") {
3408
+ obj.setTransactionCosts = SetTransactionCostsTx.toJSON(message.payload.setTransactionCosts);
3409
+ }
3410
+ if (message.payload?.$case === "setAccount") {
3411
+ obj.setAccount = SetAccountTx.toJSON(message.payload.setAccount);
3412
+ }
3413
+ if (message.payload?.$case === "collectFaucet") {
3414
+ obj.collectFaucet = CollectFaucetTx.toJSON(message.payload.collectFaucet);
3415
+ }
3416
+ if (message.payload?.$case === "setKeykeeper") {
3417
+ obj.setKeykeeper = SetKeykeeperTx.toJSON(message.payload.setKeykeeper);
3418
+ }
3335
3419
  return obj;
3336
3420
  },
3337
3421
  create(base) {
@@ -3385,7 +3469,7 @@ var Tx = {
3385
3469
  }
3386
3470
  };
3387
3471
  function createBaseSignedTx() {
3388
- return { tx: new Uint8Array(), signature: void 0 };
3472
+ return { tx: new Uint8Array(0), signature: void 0 };
3389
3473
  }
3390
3474
  var SignedTx = {
3391
3475
  encode(message, writer = import_minimal.default.Writer.create()) {
@@ -3405,19 +3489,19 @@ var SignedTx = {
3405
3489
  const tag = reader.uint32();
3406
3490
  switch (tag >>> 3) {
3407
3491
  case 1:
3408
- if (tag != 10) {
3492
+ if (tag !== 10) {
3409
3493
  break;
3410
3494
  }
3411
3495
  message.tx = reader.bytes();
3412
3496
  continue;
3413
3497
  case 2:
3414
- if (tag != 18) {
3498
+ if (tag !== 18) {
3415
3499
  break;
3416
3500
  }
3417
3501
  message.signature = reader.bytes();
3418
3502
  continue;
3419
3503
  }
3420
- if ((tag & 7) == 4 || tag == 0) {
3504
+ if ((tag & 7) === 4 || tag === 0) {
3421
3505
  break;
3422
3506
  }
3423
3507
  reader.skipType(tag & 7);
@@ -3426,14 +3510,18 @@ var SignedTx = {
3426
3510
  },
3427
3511
  fromJSON(object) {
3428
3512
  return {
3429
- tx: isSet(object.tx) ? bytesFromBase64(object.tx) : new Uint8Array(),
3513
+ tx: isSet(object.tx) ? bytesFromBase64(object.tx) : new Uint8Array(0),
3430
3514
  signature: isSet(object.signature) ? bytesFromBase64(object.signature) : void 0
3431
3515
  };
3432
3516
  },
3433
3517
  toJSON(message) {
3434
3518
  const obj = {};
3435
- message.tx !== void 0 && (obj.tx = base64FromBytes(message.tx !== void 0 ? message.tx : new Uint8Array()));
3436
- message.signature !== void 0 && (obj.signature = message.signature !== void 0 ? base64FromBytes(message.signature) : void 0);
3519
+ if (message.tx.length !== 0) {
3520
+ obj.tx = base64FromBytes(message.tx);
3521
+ }
3522
+ if (message.signature !== void 0) {
3523
+ obj.signature = base64FromBytes(message.signature);
3524
+ }
3437
3525
  return obj;
3438
3526
  },
3439
3527
  create(base) {
@@ -3441,7 +3529,7 @@ var SignedTx = {
3441
3529
  },
3442
3530
  fromPartial(object) {
3443
3531
  const message = createBaseSignedTx();
3444
- message.tx = object.tx ?? new Uint8Array();
3532
+ message.tx = object.tx ?? new Uint8Array(0);
3445
3533
  message.signature = object.signature ?? void 0;
3446
3534
  return message;
3447
3535
  }
@@ -3470,25 +3558,25 @@ var NewProcessTx = {
3470
3558
  const tag = reader.uint32();
3471
3559
  switch (tag >>> 3) {
3472
3560
  case 1:
3473
- if (tag != 8) {
3561
+ if (tag !== 8) {
3474
3562
  break;
3475
3563
  }
3476
3564
  message.txtype = reader.int32();
3477
3565
  continue;
3478
3566
  case 2:
3479
- if (tag != 16) {
3567
+ if (tag !== 16) {
3480
3568
  break;
3481
3569
  }
3482
3570
  message.nonce = reader.uint32();
3483
3571
  continue;
3484
3572
  case 3:
3485
- if (tag != 26) {
3573
+ if (tag !== 26) {
3486
3574
  break;
3487
3575
  }
3488
3576
  message.process = Process.decode(reader, reader.uint32());
3489
3577
  continue;
3490
3578
  }
3491
- if ((tag & 7) == 4 || tag == 0) {
3579
+ if ((tag & 7) === 4 || tag === 0) {
3492
3580
  break;
3493
3581
  }
3494
3582
  reader.skipType(tag & 7);
@@ -3504,9 +3592,15 @@ var NewProcessTx = {
3504
3592
  },
3505
3593
  toJSON(message) {
3506
3594
  const obj = {};
3507
- message.txtype !== void 0 && (obj.txtype = txTypeToJSON(message.txtype));
3508
- message.nonce !== void 0 && (obj.nonce = Math.round(message.nonce));
3509
- message.process !== void 0 && (obj.process = message.process ? Process.toJSON(message.process) : void 0);
3595
+ if (message.txtype !== 0) {
3596
+ obj.txtype = txTypeToJSON(message.txtype);
3597
+ }
3598
+ if (message.nonce !== 0) {
3599
+ obj.nonce = Math.round(message.nonce);
3600
+ }
3601
+ if (message.process !== void 0) {
3602
+ obj.process = Process.toJSON(message.process);
3603
+ }
3510
3604
  return obj;
3511
3605
  },
3512
3606
  create(base) {
@@ -3524,7 +3618,7 @@ function createBaseSetProcessTx() {
3524
3618
  return {
3525
3619
  txtype: 0,
3526
3620
  nonce: 0,
3527
- processId: new Uint8Array(),
3621
+ processId: new Uint8Array(0),
3528
3622
  status: void 0,
3529
3623
  questionIndex: void 0,
3530
3624
  censusRoot: void 0,
@@ -3572,61 +3666,61 @@ var SetProcessTx = {
3572
3666
  const tag = reader.uint32();
3573
3667
  switch (tag >>> 3) {
3574
3668
  case 1:
3575
- if (tag != 8) {
3669
+ if (tag !== 8) {
3576
3670
  break;
3577
3671
  }
3578
3672
  message.txtype = reader.int32();
3579
3673
  continue;
3580
3674
  case 2:
3581
- if (tag != 16) {
3675
+ if (tag !== 16) {
3582
3676
  break;
3583
3677
  }
3584
3678
  message.nonce = reader.uint32();
3585
3679
  continue;
3586
3680
  case 3:
3587
- if (tag != 26) {
3681
+ if (tag !== 26) {
3588
3682
  break;
3589
3683
  }
3590
3684
  message.processId = reader.bytes();
3591
3685
  continue;
3592
3686
  case 4:
3593
- if (tag != 32) {
3687
+ if (tag !== 32) {
3594
3688
  break;
3595
3689
  }
3596
3690
  message.status = reader.int32();
3597
3691
  continue;
3598
3692
  case 5:
3599
- if (tag != 40) {
3693
+ if (tag !== 40) {
3600
3694
  break;
3601
3695
  }
3602
3696
  message.questionIndex = reader.uint32();
3603
3697
  continue;
3604
3698
  case 6:
3605
- if (tag != 50) {
3699
+ if (tag !== 50) {
3606
3700
  break;
3607
3701
  }
3608
3702
  message.censusRoot = reader.bytes();
3609
3703
  continue;
3610
3704
  case 7:
3611
- if (tag != 58) {
3705
+ if (tag !== 58) {
3612
3706
  break;
3613
3707
  }
3614
3708
  message.censusURI = reader.string();
3615
3709
  continue;
3616
3710
  case 8:
3617
- if (tag != 66) {
3711
+ if (tag !== 66) {
3618
3712
  break;
3619
3713
  }
3620
3714
  message.proof = Proof.decode(reader, reader.uint32());
3621
3715
  continue;
3622
3716
  case 9:
3623
- if (tag != 74) {
3717
+ if (tag !== 74) {
3624
3718
  break;
3625
3719
  }
3626
3720
  message.results = ProcessResult.decode(reader, reader.uint32());
3627
3721
  continue;
3628
3722
  }
3629
- if ((tag & 7) == 4 || tag == 0) {
3723
+ if ((tag & 7) === 4 || tag === 0) {
3630
3724
  break;
3631
3725
  }
3632
3726
  reader.skipType(tag & 7);
@@ -3637,7 +3731,7 @@ var SetProcessTx = {
3637
3731
  return {
3638
3732
  txtype: isSet(object.txtype) ? txTypeFromJSON(object.txtype) : 0,
3639
3733
  nonce: isSet(object.nonce) ? Number(object.nonce) : 0,
3640
- processId: isSet(object.processId) ? bytesFromBase64(object.processId) : new Uint8Array(),
3734
+ processId: isSet(object.processId) ? bytesFromBase64(object.processId) : new Uint8Array(0),
3641
3735
  status: isSet(object.status) ? processStatusFromJSON(object.status) : void 0,
3642
3736
  questionIndex: isSet(object.questionIndex) ? Number(object.questionIndex) : void 0,
3643
3737
  censusRoot: isSet(object.censusRoot) ? bytesFromBase64(object.censusRoot) : void 0,
@@ -3648,15 +3742,33 @@ var SetProcessTx = {
3648
3742
  },
3649
3743
  toJSON(message) {
3650
3744
  const obj = {};
3651
- message.txtype !== void 0 && (obj.txtype = txTypeToJSON(message.txtype));
3652
- message.nonce !== void 0 && (obj.nonce = Math.round(message.nonce));
3653
- message.processId !== void 0 && (obj.processId = base64FromBytes(message.processId !== void 0 ? message.processId : new Uint8Array()));
3654
- message.status !== void 0 && (obj.status = message.status !== void 0 ? processStatusToJSON(message.status) : void 0);
3655
- message.questionIndex !== void 0 && (obj.questionIndex = Math.round(message.questionIndex));
3656
- message.censusRoot !== void 0 && (obj.censusRoot = message.censusRoot !== void 0 ? base64FromBytes(message.censusRoot) : void 0);
3657
- message.censusURI !== void 0 && (obj.censusURI = message.censusURI);
3658
- message.proof !== void 0 && (obj.proof = message.proof ? Proof.toJSON(message.proof) : void 0);
3659
- message.results !== void 0 && (obj.results = message.results ? ProcessResult.toJSON(message.results) : void 0);
3745
+ if (message.txtype !== 0) {
3746
+ obj.txtype = txTypeToJSON(message.txtype);
3747
+ }
3748
+ if (message.nonce !== 0) {
3749
+ obj.nonce = Math.round(message.nonce);
3750
+ }
3751
+ if (message.processId.length !== 0) {
3752
+ obj.processId = base64FromBytes(message.processId);
3753
+ }
3754
+ if (message.status !== void 0) {
3755
+ obj.status = processStatusToJSON(message.status);
3756
+ }
3757
+ if (message.questionIndex !== void 0) {
3758
+ obj.questionIndex = Math.round(message.questionIndex);
3759
+ }
3760
+ if (message.censusRoot !== void 0) {
3761
+ obj.censusRoot = base64FromBytes(message.censusRoot);
3762
+ }
3763
+ if (message.censusURI !== void 0) {
3764
+ obj.censusURI = message.censusURI;
3765
+ }
3766
+ if (message.proof !== void 0) {
3767
+ obj.proof = Proof.toJSON(message.proof);
3768
+ }
3769
+ if (message.results !== void 0) {
3770
+ obj.results = ProcessResult.toJSON(message.results);
3771
+ }
3660
3772
  return obj;
3661
3773
  },
3662
3774
  create(base) {
@@ -3666,7 +3778,7 @@ var SetProcessTx = {
3666
3778
  const message = createBaseSetProcessTx();
3667
3779
  message.txtype = object.txtype ?? 0;
3668
3780
  message.nonce = object.nonce ?? 0;
3669
- message.processId = object.processId ?? new Uint8Array();
3781
+ message.processId = object.processId ?? new Uint8Array(0);
3670
3782
  message.status = object.status ?? void 0;
3671
3783
  message.questionIndex = object.questionIndex ?? void 0;
3672
3784
  message.censusRoot = object.censusRoot ?? void 0;
@@ -3679,7 +3791,7 @@ var SetProcessTx = {
3679
3791
  function createBaseAdminTx() {
3680
3792
  return {
3681
3793
  txtype: 0,
3682
- processId: new Uint8Array(),
3794
+ processId: new Uint8Array(0),
3683
3795
  address: void 0,
3684
3796
  encryptionPrivateKey: void 0,
3685
3797
  encryptionPublicKey: void 0,
@@ -3728,61 +3840,61 @@ var AdminTx = {
3728
3840
  const tag = reader.uint32();
3729
3841
  switch (tag >>> 3) {
3730
3842
  case 1:
3731
- if (tag != 8) {
3843
+ if (tag !== 8) {
3732
3844
  break;
3733
3845
  }
3734
3846
  message.txtype = reader.int32();
3735
3847
  continue;
3736
3848
  case 2:
3737
- if (tag != 18) {
3849
+ if (tag !== 18) {
3738
3850
  break;
3739
3851
  }
3740
3852
  message.processId = reader.bytes();
3741
3853
  continue;
3742
3854
  case 3:
3743
- if (tag != 26) {
3855
+ if (tag !== 26) {
3744
3856
  break;
3745
3857
  }
3746
3858
  message.address = reader.bytes();
3747
3859
  continue;
3748
3860
  case 5:
3749
- if (tag != 42) {
3861
+ if (tag !== 42) {
3750
3862
  break;
3751
3863
  }
3752
3864
  message.encryptionPrivateKey = reader.bytes();
3753
3865
  continue;
3754
3866
  case 6:
3755
- if (tag != 50) {
3867
+ if (tag !== 50) {
3756
3868
  break;
3757
3869
  }
3758
3870
  message.encryptionPublicKey = reader.bytes();
3759
3871
  continue;
3760
3872
  case 7:
3761
- if (tag != 56) {
3873
+ if (tag !== 56) {
3762
3874
  break;
3763
3875
  }
3764
3876
  message.keyIndex = reader.uint32();
3765
3877
  continue;
3766
3878
  case 8:
3767
- if (tag != 64) {
3879
+ if (tag !== 64) {
3768
3880
  break;
3769
3881
  }
3770
3882
  message.power = longToNumber(reader.uint64());
3771
3883
  continue;
3772
3884
  case 9:
3773
- if (tag != 74) {
3885
+ if (tag !== 74) {
3774
3886
  break;
3775
3887
  }
3776
3888
  message.publicKey = reader.bytes();
3777
3889
  continue;
3778
3890
  case 11:
3779
- if (tag != 88) {
3891
+ if (tag !== 88) {
3780
3892
  break;
3781
3893
  }
3782
3894
  message.nonce = reader.uint32();
3783
3895
  continue;
3784
3896
  }
3785
- if ((tag & 7) == 4 || tag == 0) {
3897
+ if ((tag & 7) === 4 || tag === 0) {
3786
3898
  break;
3787
3899
  }
3788
3900
  reader.skipType(tag & 7);
@@ -3792,7 +3904,7 @@ var AdminTx = {
3792
3904
  fromJSON(object) {
3793
3905
  return {
3794
3906
  txtype: isSet(object.txtype) ? txTypeFromJSON(object.txtype) : 0,
3795
- processId: isSet(object.processId) ? bytesFromBase64(object.processId) : new Uint8Array(),
3907
+ processId: isSet(object.processId) ? bytesFromBase64(object.processId) : new Uint8Array(0),
3796
3908
  address: isSet(object.address) ? bytesFromBase64(object.address) : void 0,
3797
3909
  encryptionPrivateKey: isSet(object.encryptionPrivateKey) ? bytesFromBase64(object.encryptionPrivateKey) : void 0,
3798
3910
  encryptionPublicKey: isSet(object.encryptionPublicKey) ? bytesFromBase64(object.encryptionPublicKey) : void 0,
@@ -3804,15 +3916,33 @@ var AdminTx = {
3804
3916
  },
3805
3917
  toJSON(message) {
3806
3918
  const obj = {};
3807
- message.txtype !== void 0 && (obj.txtype = txTypeToJSON(message.txtype));
3808
- message.processId !== void 0 && (obj.processId = base64FromBytes(message.processId !== void 0 ? message.processId : new Uint8Array()));
3809
- message.address !== void 0 && (obj.address = message.address !== void 0 ? base64FromBytes(message.address) : void 0);
3810
- message.encryptionPrivateKey !== void 0 && (obj.encryptionPrivateKey = message.encryptionPrivateKey !== void 0 ? base64FromBytes(message.encryptionPrivateKey) : void 0);
3811
- message.encryptionPublicKey !== void 0 && (obj.encryptionPublicKey = message.encryptionPublicKey !== void 0 ? base64FromBytes(message.encryptionPublicKey) : void 0);
3812
- message.keyIndex !== void 0 && (obj.keyIndex = Math.round(message.keyIndex));
3813
- message.power !== void 0 && (obj.power = Math.round(message.power));
3814
- message.publicKey !== void 0 && (obj.publicKey = message.publicKey !== void 0 ? base64FromBytes(message.publicKey) : void 0);
3815
- message.nonce !== void 0 && (obj.nonce = Math.round(message.nonce));
3919
+ if (message.txtype !== 0) {
3920
+ obj.txtype = txTypeToJSON(message.txtype);
3921
+ }
3922
+ if (message.processId.length !== 0) {
3923
+ obj.processId = base64FromBytes(message.processId);
3924
+ }
3925
+ if (message.address !== void 0) {
3926
+ obj.address = base64FromBytes(message.address);
3927
+ }
3928
+ if (message.encryptionPrivateKey !== void 0) {
3929
+ obj.encryptionPrivateKey = base64FromBytes(message.encryptionPrivateKey);
3930
+ }
3931
+ if (message.encryptionPublicKey !== void 0) {
3932
+ obj.encryptionPublicKey = base64FromBytes(message.encryptionPublicKey);
3933
+ }
3934
+ if (message.keyIndex !== void 0) {
3935
+ obj.keyIndex = Math.round(message.keyIndex);
3936
+ }
3937
+ if (message.power !== void 0) {
3938
+ obj.power = Math.round(message.power);
3939
+ }
3940
+ if (message.publicKey !== void 0) {
3941
+ obj.publicKey = base64FromBytes(message.publicKey);
3942
+ }
3943
+ if (message.nonce !== 0) {
3944
+ obj.nonce = Math.round(message.nonce);
3945
+ }
3816
3946
  return obj;
3817
3947
  },
3818
3948
  create(base) {
@@ -3821,7 +3951,7 @@ var AdminTx = {
3821
3951
  fromPartial(object) {
3822
3952
  const message = createBaseAdminTx();
3823
3953
  message.txtype = object.txtype ?? 0;
3824
- message.processId = object.processId ?? new Uint8Array();
3954
+ message.processId = object.processId ?? new Uint8Array(0);
3825
3955
  message.address = object.address ?? void 0;
3826
3956
  message.encryptionPrivateKey = object.encryptionPrivateKey ?? void 0;
3827
3957
  message.encryptionPublicKey = object.encryptionPublicKey ?? void 0;
@@ -3833,7 +3963,7 @@ var AdminTx = {
3833
3963
  }
3834
3964
  };
3835
3965
  function createBaseRegisterKeyTx() {
3836
- return { nonce: 0, processId: new Uint8Array(), proof: void 0, newKey: new Uint8Array(), weight: "" };
3966
+ return { nonce: 0, processId: new Uint8Array(0), proof: void 0, newKey: new Uint8Array(0), weight: "" };
3837
3967
  }
3838
3968
  var RegisterKeyTx = {
3839
3969
  encode(message, writer = import_minimal.default.Writer.create()) {
@@ -3862,37 +3992,37 @@ var RegisterKeyTx = {
3862
3992
  const tag = reader.uint32();
3863
3993
  switch (tag >>> 3) {
3864
3994
  case 1:
3865
- if (tag != 8) {
3995
+ if (tag !== 8) {
3866
3996
  break;
3867
3997
  }
3868
3998
  message.nonce = reader.uint32();
3869
3999
  continue;
3870
4000
  case 2:
3871
- if (tag != 18) {
4001
+ if (tag !== 18) {
3872
4002
  break;
3873
4003
  }
3874
4004
  message.processId = reader.bytes();
3875
4005
  continue;
3876
4006
  case 3:
3877
- if (tag != 26) {
4007
+ if (tag !== 26) {
3878
4008
  break;
3879
4009
  }
3880
4010
  message.proof = Proof.decode(reader, reader.uint32());
3881
4011
  continue;
3882
4012
  case 4:
3883
- if (tag != 34) {
4013
+ if (tag !== 34) {
3884
4014
  break;
3885
4015
  }
3886
4016
  message.newKey = reader.bytes();
3887
4017
  continue;
3888
4018
  case 5:
3889
- if (tag != 42) {
4019
+ if (tag !== 42) {
3890
4020
  break;
3891
4021
  }
3892
4022
  message.weight = reader.string();
3893
4023
  continue;
3894
4024
  }
3895
- if ((tag & 7) == 4 || tag == 0) {
4025
+ if ((tag & 7) === 4 || tag === 0) {
3896
4026
  break;
3897
4027
  }
3898
4028
  reader.skipType(tag & 7);
@@ -3902,19 +4032,29 @@ var RegisterKeyTx = {
3902
4032
  fromJSON(object) {
3903
4033
  return {
3904
4034
  nonce: isSet(object.nonce) ? Number(object.nonce) : 0,
3905
- processId: isSet(object.processId) ? bytesFromBase64(object.processId) : new Uint8Array(),
4035
+ processId: isSet(object.processId) ? bytesFromBase64(object.processId) : new Uint8Array(0),
3906
4036
  proof: isSet(object.proof) ? Proof.fromJSON(object.proof) : void 0,
3907
- newKey: isSet(object.newKey) ? bytesFromBase64(object.newKey) : new Uint8Array(),
4037
+ newKey: isSet(object.newKey) ? bytesFromBase64(object.newKey) : new Uint8Array(0),
3908
4038
  weight: isSet(object.weight) ? String(object.weight) : ""
3909
4039
  };
3910
4040
  },
3911
4041
  toJSON(message) {
3912
4042
  const obj = {};
3913
- message.nonce !== void 0 && (obj.nonce = Math.round(message.nonce));
3914
- message.processId !== void 0 && (obj.processId = base64FromBytes(message.processId !== void 0 ? message.processId : new Uint8Array()));
3915
- message.proof !== void 0 && (obj.proof = message.proof ? Proof.toJSON(message.proof) : void 0);
3916
- message.newKey !== void 0 && (obj.newKey = base64FromBytes(message.newKey !== void 0 ? message.newKey : new Uint8Array()));
3917
- message.weight !== void 0 && (obj.weight = message.weight);
4043
+ if (message.nonce !== 0) {
4044
+ obj.nonce = Math.round(message.nonce);
4045
+ }
4046
+ if (message.processId.length !== 0) {
4047
+ obj.processId = base64FromBytes(message.processId);
4048
+ }
4049
+ if (message.proof !== void 0) {
4050
+ obj.proof = Proof.toJSON(message.proof);
4051
+ }
4052
+ if (message.newKey.length !== 0) {
4053
+ obj.newKey = base64FromBytes(message.newKey);
4054
+ }
4055
+ if (message.weight !== "") {
4056
+ obj.weight = message.weight;
4057
+ }
3918
4058
  return obj;
3919
4059
  },
3920
4060
  create(base) {
@@ -3923,15 +4063,15 @@ var RegisterKeyTx = {
3923
4063
  fromPartial(object) {
3924
4064
  const message = createBaseRegisterKeyTx();
3925
4065
  message.nonce = object.nonce ?? 0;
3926
- message.processId = object.processId ?? new Uint8Array();
4066
+ message.processId = object.processId ?? new Uint8Array(0);
3927
4067
  message.proof = object.proof !== void 0 && object.proof !== null ? Proof.fromPartial(object.proof) : void 0;
3928
- message.newKey = object.newKey ?? new Uint8Array();
4068
+ message.newKey = object.newKey ?? new Uint8Array(0);
3929
4069
  message.weight = object.weight ?? "";
3930
4070
  return message;
3931
4071
  }
3932
4072
  };
3933
4073
  function createBaseMintTokensTx() {
3934
- return { txtype: 0, nonce: 0, to: new Uint8Array(), value: 0 };
4074
+ return { txtype: 0, nonce: 0, to: new Uint8Array(0), value: 0 };
3935
4075
  }
3936
4076
  var MintTokensTx = {
3937
4077
  encode(message, writer = import_minimal.default.Writer.create()) {
@@ -3957,31 +4097,31 @@ var MintTokensTx = {
3957
4097
  const tag = reader.uint32();
3958
4098
  switch (tag >>> 3) {
3959
4099
  case 1:
3960
- if (tag != 8) {
4100
+ if (tag !== 8) {
3961
4101
  break;
3962
4102
  }
3963
4103
  message.txtype = reader.int32();
3964
4104
  continue;
3965
4105
  case 2:
3966
- if (tag != 16) {
4106
+ if (tag !== 16) {
3967
4107
  break;
3968
4108
  }
3969
4109
  message.nonce = reader.uint32();
3970
4110
  continue;
3971
4111
  case 3:
3972
- if (tag != 26) {
4112
+ if (tag !== 26) {
3973
4113
  break;
3974
4114
  }
3975
4115
  message.to = reader.bytes();
3976
4116
  continue;
3977
4117
  case 4:
3978
- if (tag != 32) {
4118
+ if (tag !== 32) {
3979
4119
  break;
3980
4120
  }
3981
4121
  message.value = longToNumber(reader.uint64());
3982
4122
  continue;
3983
4123
  }
3984
- if ((tag & 7) == 4 || tag == 0) {
4124
+ if ((tag & 7) === 4 || tag === 0) {
3985
4125
  break;
3986
4126
  }
3987
4127
  reader.skipType(tag & 7);
@@ -3992,16 +4132,24 @@ var MintTokensTx = {
3992
4132
  return {
3993
4133
  txtype: isSet(object.txtype) ? txTypeFromJSON(object.txtype) : 0,
3994
4134
  nonce: isSet(object.nonce) ? Number(object.nonce) : 0,
3995
- to: isSet(object.to) ? bytesFromBase64(object.to) : new Uint8Array(),
4135
+ to: isSet(object.to) ? bytesFromBase64(object.to) : new Uint8Array(0),
3996
4136
  value: isSet(object.value) ? Number(object.value) : 0
3997
4137
  };
3998
4138
  },
3999
4139
  toJSON(message) {
4000
4140
  const obj = {};
4001
- message.txtype !== void 0 && (obj.txtype = txTypeToJSON(message.txtype));
4002
- message.nonce !== void 0 && (obj.nonce = Math.round(message.nonce));
4003
- message.to !== void 0 && (obj.to = base64FromBytes(message.to !== void 0 ? message.to : new Uint8Array()));
4004
- message.value !== void 0 && (obj.value = Math.round(message.value));
4141
+ if (message.txtype !== 0) {
4142
+ obj.txtype = txTypeToJSON(message.txtype);
4143
+ }
4144
+ if (message.nonce !== 0) {
4145
+ obj.nonce = Math.round(message.nonce);
4146
+ }
4147
+ if (message.to.length !== 0) {
4148
+ obj.to = base64FromBytes(message.to);
4149
+ }
4150
+ if (message.value !== 0) {
4151
+ obj.value = Math.round(message.value);
4152
+ }
4005
4153
  return obj;
4006
4154
  },
4007
4155
  create(base) {
@@ -4011,13 +4159,13 @@ var MintTokensTx = {
4011
4159
  const message = createBaseMintTokensTx();
4012
4160
  message.txtype = object.txtype ?? 0;
4013
4161
  message.nonce = object.nonce ?? 0;
4014
- message.to = object.to ?? new Uint8Array();
4162
+ message.to = object.to ?? new Uint8Array(0);
4015
4163
  message.value = object.value ?? 0;
4016
4164
  return message;
4017
4165
  }
4018
4166
  };
4019
4167
  function createBaseSendTokensTx() {
4020
- return { txtype: 0, nonce: 0, from: new Uint8Array(), to: new Uint8Array(), value: 0 };
4168
+ return { txtype: 0, nonce: 0, from: new Uint8Array(0), to: new Uint8Array(0), value: 0 };
4021
4169
  }
4022
4170
  var SendTokensTx = {
4023
4171
  encode(message, writer = import_minimal.default.Writer.create()) {
@@ -4046,37 +4194,37 @@ var SendTokensTx = {
4046
4194
  const tag = reader.uint32();
4047
4195
  switch (tag >>> 3) {
4048
4196
  case 1:
4049
- if (tag != 8) {
4197
+ if (tag !== 8) {
4050
4198
  break;
4051
4199
  }
4052
4200
  message.txtype = reader.int32();
4053
4201
  continue;
4054
4202
  case 2:
4055
- if (tag != 16) {
4203
+ if (tag !== 16) {
4056
4204
  break;
4057
4205
  }
4058
4206
  message.nonce = reader.uint32();
4059
4207
  continue;
4060
4208
  case 3:
4061
- if (tag != 26) {
4209
+ if (tag !== 26) {
4062
4210
  break;
4063
4211
  }
4064
4212
  message.from = reader.bytes();
4065
4213
  continue;
4066
4214
  case 4:
4067
- if (tag != 34) {
4215
+ if (tag !== 34) {
4068
4216
  break;
4069
4217
  }
4070
4218
  message.to = reader.bytes();
4071
4219
  continue;
4072
4220
  case 5:
4073
- if (tag != 40) {
4221
+ if (tag !== 40) {
4074
4222
  break;
4075
4223
  }
4076
4224
  message.value = longToNumber(reader.uint64());
4077
4225
  continue;
4078
4226
  }
4079
- if ((tag & 7) == 4 || tag == 0) {
4227
+ if ((tag & 7) === 4 || tag === 0) {
4080
4228
  break;
4081
4229
  }
4082
4230
  reader.skipType(tag & 7);
@@ -4087,18 +4235,28 @@ var SendTokensTx = {
4087
4235
  return {
4088
4236
  txtype: isSet(object.txtype) ? txTypeFromJSON(object.txtype) : 0,
4089
4237
  nonce: isSet(object.nonce) ? Number(object.nonce) : 0,
4090
- from: isSet(object.from) ? bytesFromBase64(object.from) : new Uint8Array(),
4091
- to: isSet(object.to) ? bytesFromBase64(object.to) : new Uint8Array(),
4238
+ from: isSet(object.from) ? bytesFromBase64(object.from) : new Uint8Array(0),
4239
+ to: isSet(object.to) ? bytesFromBase64(object.to) : new Uint8Array(0),
4092
4240
  value: isSet(object.value) ? Number(object.value) : 0
4093
4241
  };
4094
4242
  },
4095
4243
  toJSON(message) {
4096
4244
  const obj = {};
4097
- message.txtype !== void 0 && (obj.txtype = txTypeToJSON(message.txtype));
4098
- message.nonce !== void 0 && (obj.nonce = Math.round(message.nonce));
4099
- message.from !== void 0 && (obj.from = base64FromBytes(message.from !== void 0 ? message.from : new Uint8Array()));
4100
- message.to !== void 0 && (obj.to = base64FromBytes(message.to !== void 0 ? message.to : new Uint8Array()));
4101
- message.value !== void 0 && (obj.value = Math.round(message.value));
4245
+ if (message.txtype !== 0) {
4246
+ obj.txtype = txTypeToJSON(message.txtype);
4247
+ }
4248
+ if (message.nonce !== 0) {
4249
+ obj.nonce = Math.round(message.nonce);
4250
+ }
4251
+ if (message.from.length !== 0) {
4252
+ obj.from = base64FromBytes(message.from);
4253
+ }
4254
+ if (message.to.length !== 0) {
4255
+ obj.to = base64FromBytes(message.to);
4256
+ }
4257
+ if (message.value !== 0) {
4258
+ obj.value = Math.round(message.value);
4259
+ }
4102
4260
  return obj;
4103
4261
  },
4104
4262
  create(base) {
@@ -4108,8 +4266,8 @@ var SendTokensTx = {
4108
4266
  const message = createBaseSendTokensTx();
4109
4267
  message.txtype = object.txtype ?? 0;
4110
4268
  message.nonce = object.nonce ?? 0;
4111
- message.from = object.from ?? new Uint8Array();
4112
- message.to = object.to ?? new Uint8Array();
4269
+ message.from = object.from ?? new Uint8Array(0);
4270
+ message.to = object.to ?? new Uint8Array(0);
4113
4271
  message.value = object.value ?? 0;
4114
4272
  return message;
4115
4273
  }
@@ -4138,25 +4296,25 @@ var SetTransactionCostsTx = {
4138
4296
  const tag = reader.uint32();
4139
4297
  switch (tag >>> 3) {
4140
4298
  case 1:
4141
- if (tag != 8) {
4299
+ if (tag !== 8) {
4142
4300
  break;
4143
4301
  }
4144
4302
  message.txtype = reader.int32();
4145
4303
  continue;
4146
4304
  case 2:
4147
- if (tag != 16) {
4305
+ if (tag !== 16) {
4148
4306
  break;
4149
4307
  }
4150
4308
  message.nonce = reader.uint32();
4151
4309
  continue;
4152
4310
  case 3:
4153
- if (tag != 24) {
4311
+ if (tag !== 24) {
4154
4312
  break;
4155
4313
  }
4156
4314
  message.value = longToNumber(reader.uint64());
4157
4315
  continue;
4158
4316
  }
4159
- if ((tag & 7) == 4 || tag == 0) {
4317
+ if ((tag & 7) === 4 || tag === 0) {
4160
4318
  break;
4161
4319
  }
4162
4320
  reader.skipType(tag & 7);
@@ -4172,9 +4330,15 @@ var SetTransactionCostsTx = {
4172
4330
  },
4173
4331
  toJSON(message) {
4174
4332
  const obj = {};
4175
- message.txtype !== void 0 && (obj.txtype = txTypeToJSON(message.txtype));
4176
- message.nonce !== void 0 && (obj.nonce = Math.round(message.nonce));
4177
- message.value !== void 0 && (obj.value = Math.round(message.value));
4333
+ if (message.txtype !== 0) {
4334
+ obj.txtype = txTypeToJSON(message.txtype);
4335
+ }
4336
+ if (message.nonce !== 0) {
4337
+ obj.nonce = Math.round(message.nonce);
4338
+ }
4339
+ if (message.value !== 0) {
4340
+ obj.value = Math.round(message.value);
4341
+ }
4178
4342
  return obj;
4179
4343
  },
4180
4344
  create(base) {
@@ -4228,43 +4392,43 @@ var SetAccountTx = {
4228
4392
  const tag = reader.uint32();
4229
4393
  switch (tag >>> 3) {
4230
4394
  case 1:
4231
- if (tag != 8) {
4395
+ if (tag !== 8) {
4232
4396
  break;
4233
4397
  }
4234
4398
  message.txtype = reader.int32();
4235
4399
  continue;
4236
4400
  case 2:
4237
- if (tag != 16) {
4401
+ if (tag !== 16) {
4238
4402
  break;
4239
4403
  }
4240
4404
  message.nonce = reader.uint32();
4241
4405
  continue;
4242
4406
  case 3:
4243
- if (tag != 26) {
4407
+ if (tag !== 26) {
4244
4408
  break;
4245
4409
  }
4246
4410
  message.infoURI = reader.string();
4247
4411
  continue;
4248
4412
  case 4:
4249
- if (tag != 34) {
4413
+ if (tag !== 34) {
4250
4414
  break;
4251
4415
  }
4252
4416
  message.account = reader.bytes();
4253
4417
  continue;
4254
4418
  case 5:
4255
- if (tag != 42) {
4419
+ if (tag !== 42) {
4256
4420
  break;
4257
4421
  }
4258
4422
  message.faucetPackage = FaucetPackage.decode(reader, reader.uint32());
4259
4423
  continue;
4260
4424
  case 6:
4261
- if (tag != 50) {
4425
+ if (tag !== 50) {
4262
4426
  break;
4263
4427
  }
4264
4428
  message.delegates.push(reader.bytes());
4265
4429
  continue;
4266
4430
  }
4267
- if ((tag & 7) == 4 || tag == 0) {
4431
+ if ((tag & 7) === 4 || tag === 0) {
4268
4432
  break;
4269
4433
  }
4270
4434
  reader.skipType(tag & 7);
@@ -4283,15 +4447,23 @@ var SetAccountTx = {
4283
4447
  },
4284
4448
  toJSON(message) {
4285
4449
  const obj = {};
4286
- message.txtype !== void 0 && (obj.txtype = txTypeToJSON(message.txtype));
4287
- message.nonce !== void 0 && (obj.nonce = Math.round(message.nonce));
4288
- message.infoURI !== void 0 && (obj.infoURI = message.infoURI);
4289
- message.account !== void 0 && (obj.account = message.account !== void 0 ? base64FromBytes(message.account) : void 0);
4290
- message.faucetPackage !== void 0 && (obj.faucetPackage = message.faucetPackage ? FaucetPackage.toJSON(message.faucetPackage) : void 0);
4291
- if (message.delegates) {
4292
- obj.delegates = message.delegates.map((e) => base64FromBytes(e !== void 0 ? e : new Uint8Array()));
4293
- } else {
4294
- obj.delegates = [];
4450
+ if (message.txtype !== 0) {
4451
+ obj.txtype = txTypeToJSON(message.txtype);
4452
+ }
4453
+ if (message.nonce !== void 0) {
4454
+ obj.nonce = Math.round(message.nonce);
4455
+ }
4456
+ if (message.infoURI !== void 0) {
4457
+ obj.infoURI = message.infoURI;
4458
+ }
4459
+ if (message.account !== void 0) {
4460
+ obj.account = base64FromBytes(message.account);
4461
+ }
4462
+ if (message.faucetPackage !== void 0) {
4463
+ obj.faucetPackage = FaucetPackage.toJSON(message.faucetPackage);
4464
+ }
4465
+ if (message.delegates?.length) {
4466
+ obj.delegates = message.delegates.map((e) => base64FromBytes(e));
4295
4467
  }
4296
4468
  return obj;
4297
4469
  },
@@ -4333,25 +4505,25 @@ var CollectFaucetTx = {
4333
4505
  const tag = reader.uint32();
4334
4506
  switch (tag >>> 3) {
4335
4507
  case 1:
4336
- if (tag != 8) {
4508
+ if (tag !== 8) {
4337
4509
  break;
4338
4510
  }
4339
4511
  message.txType = reader.int32();
4340
4512
  continue;
4341
4513
  case 2:
4342
- if (tag != 18) {
4514
+ if (tag !== 18) {
4343
4515
  break;
4344
4516
  }
4345
4517
  message.faucetPackage = FaucetPackage.decode(reader, reader.uint32());
4346
4518
  continue;
4347
4519
  case 3:
4348
- if (tag != 24) {
4520
+ if (tag !== 24) {
4349
4521
  break;
4350
4522
  }
4351
4523
  message.nonce = reader.uint32();
4352
4524
  continue;
4353
4525
  }
4354
- if ((tag & 7) == 4 || tag == 0) {
4526
+ if ((tag & 7) === 4 || tag === 0) {
4355
4527
  break;
4356
4528
  }
4357
4529
  reader.skipType(tag & 7);
@@ -4367,9 +4539,15 @@ var CollectFaucetTx = {
4367
4539
  },
4368
4540
  toJSON(message) {
4369
4541
  const obj = {};
4370
- message.txType !== void 0 && (obj.txType = txTypeToJSON(message.txType));
4371
- message.faucetPackage !== void 0 && (obj.faucetPackage = message.faucetPackage ? FaucetPackage.toJSON(message.faucetPackage) : void 0);
4372
- message.nonce !== void 0 && (obj.nonce = Math.round(message.nonce));
4542
+ if (message.txType !== 0) {
4543
+ obj.txType = txTypeToJSON(message.txType);
4544
+ }
4545
+ if (message.faucetPackage !== void 0) {
4546
+ obj.faucetPackage = FaucetPackage.toJSON(message.faucetPackage);
4547
+ }
4548
+ if (message.nonce !== 0) {
4549
+ obj.nonce = Math.round(message.nonce);
4550
+ }
4373
4551
  return obj;
4374
4552
  },
4375
4553
  create(base) {
@@ -4384,7 +4562,7 @@ var CollectFaucetTx = {
4384
4562
  }
4385
4563
  };
4386
4564
  function createBaseFaucetPayload() {
4387
- return { identifier: 0, to: new Uint8Array(), amount: 0 };
4565
+ return { identifier: 0, to: new Uint8Array(0), amount: 0 };
4388
4566
  }
4389
4567
  var FaucetPayload = {
4390
4568
  encode(message, writer = import_minimal.default.Writer.create()) {
@@ -4407,25 +4585,25 @@ var FaucetPayload = {
4407
4585
  const tag = reader.uint32();
4408
4586
  switch (tag >>> 3) {
4409
4587
  case 1:
4410
- if (tag != 8) {
4588
+ if (tag !== 8) {
4411
4589
  break;
4412
4590
  }
4413
4591
  message.identifier = longToNumber(reader.uint64());
4414
4592
  continue;
4415
4593
  case 2:
4416
- if (tag != 18) {
4594
+ if (tag !== 18) {
4417
4595
  break;
4418
4596
  }
4419
4597
  message.to = reader.bytes();
4420
4598
  continue;
4421
4599
  case 3:
4422
- if (tag != 24) {
4600
+ if (tag !== 24) {
4423
4601
  break;
4424
4602
  }
4425
4603
  message.amount = longToNumber(reader.uint64());
4426
4604
  continue;
4427
4605
  }
4428
- if ((tag & 7) == 4 || tag == 0) {
4606
+ if ((tag & 7) === 4 || tag === 0) {
4429
4607
  break;
4430
4608
  }
4431
4609
  reader.skipType(tag & 7);
@@ -4435,15 +4613,21 @@ var FaucetPayload = {
4435
4613
  fromJSON(object) {
4436
4614
  return {
4437
4615
  identifier: isSet(object.identifier) ? Number(object.identifier) : 0,
4438
- to: isSet(object.to) ? bytesFromBase64(object.to) : new Uint8Array(),
4616
+ to: isSet(object.to) ? bytesFromBase64(object.to) : new Uint8Array(0),
4439
4617
  amount: isSet(object.amount) ? Number(object.amount) : 0
4440
4618
  };
4441
4619
  },
4442
4620
  toJSON(message) {
4443
4621
  const obj = {};
4444
- message.identifier !== void 0 && (obj.identifier = Math.round(message.identifier));
4445
- message.to !== void 0 && (obj.to = base64FromBytes(message.to !== void 0 ? message.to : new Uint8Array()));
4446
- message.amount !== void 0 && (obj.amount = Math.round(message.amount));
4622
+ if (message.identifier !== 0) {
4623
+ obj.identifier = Math.round(message.identifier);
4624
+ }
4625
+ if (message.to.length !== 0) {
4626
+ obj.to = base64FromBytes(message.to);
4627
+ }
4628
+ if (message.amount !== 0) {
4629
+ obj.amount = Math.round(message.amount);
4630
+ }
4447
4631
  return obj;
4448
4632
  },
4449
4633
  create(base) {
@@ -4452,13 +4636,13 @@ var FaucetPayload = {
4452
4636
  fromPartial(object) {
4453
4637
  const message = createBaseFaucetPayload();
4454
4638
  message.identifier = object.identifier ?? 0;
4455
- message.to = object.to ?? new Uint8Array();
4639
+ message.to = object.to ?? new Uint8Array(0);
4456
4640
  message.amount = object.amount ?? 0;
4457
4641
  return message;
4458
4642
  }
4459
4643
  };
4460
4644
  function createBaseFaucetPackage() {
4461
- return { payload: new Uint8Array(), signature: new Uint8Array() };
4645
+ return { payload: new Uint8Array(0), signature: new Uint8Array(0) };
4462
4646
  }
4463
4647
  var FaucetPackage = {
4464
4648
  encode(message, writer = import_minimal.default.Writer.create()) {
@@ -4478,19 +4662,19 @@ var FaucetPackage = {
4478
4662
  const tag = reader.uint32();
4479
4663
  switch (tag >>> 3) {
4480
4664
  case 1:
4481
- if (tag != 10) {
4665
+ if (tag !== 10) {
4482
4666
  break;
4483
4667
  }
4484
4668
  message.payload = reader.bytes();
4485
4669
  continue;
4486
4670
  case 2:
4487
- if (tag != 18) {
4671
+ if (tag !== 18) {
4488
4672
  break;
4489
4673
  }
4490
4674
  message.signature = reader.bytes();
4491
4675
  continue;
4492
4676
  }
4493
- if ((tag & 7) == 4 || tag == 0) {
4677
+ if ((tag & 7) === 4 || tag === 0) {
4494
4678
  break;
4495
4679
  }
4496
4680
  reader.skipType(tag & 7);
@@ -4499,14 +4683,18 @@ var FaucetPackage = {
4499
4683
  },
4500
4684
  fromJSON(object) {
4501
4685
  return {
4502
- payload: isSet(object.payload) ? bytesFromBase64(object.payload) : new Uint8Array(),
4503
- signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array()
4686
+ payload: isSet(object.payload) ? bytesFromBase64(object.payload) : new Uint8Array(0),
4687
+ signature: isSet(object.signature) ? bytesFromBase64(object.signature) : new Uint8Array(0)
4504
4688
  };
4505
4689
  },
4506
4690
  toJSON(message) {
4507
4691
  const obj = {};
4508
- message.payload !== void 0 && (obj.payload = base64FromBytes(message.payload !== void 0 ? message.payload : new Uint8Array()));
4509
- message.signature !== void 0 && (obj.signature = base64FromBytes(message.signature !== void 0 ? message.signature : new Uint8Array()));
4692
+ if (message.payload.length !== 0) {
4693
+ obj.payload = base64FromBytes(message.payload);
4694
+ }
4695
+ if (message.signature.length !== 0) {
4696
+ obj.signature = base64FromBytes(message.signature);
4697
+ }
4510
4698
  return obj;
4511
4699
  },
4512
4700
  create(base) {
@@ -4514,13 +4702,13 @@ var FaucetPackage = {
4514
4702
  },
4515
4703
  fromPartial(object) {
4516
4704
  const message = createBaseFaucetPackage();
4517
- message.payload = object.payload ?? new Uint8Array();
4518
- message.signature = object.signature ?? new Uint8Array();
4705
+ message.payload = object.payload ?? new Uint8Array(0);
4706
+ message.signature = object.signature ?? new Uint8Array(0);
4519
4707
  return message;
4520
4708
  }
4521
4709
  };
4522
4710
  function createBaseSetKeykeeperTx() {
4523
- return { txtype: 0, nonce: 0, keykeeper: new Uint8Array() };
4711
+ return { txtype: 0, nonce: 0, keykeeper: new Uint8Array(0) };
4524
4712
  }
4525
4713
  var SetKeykeeperTx = {
4526
4714
  encode(message, writer = import_minimal.default.Writer.create()) {
@@ -4543,25 +4731,25 @@ var SetKeykeeperTx = {
4543
4731
  const tag = reader.uint32();
4544
4732
  switch (tag >>> 3) {
4545
4733
  case 1:
4546
- if (tag != 8) {
4734
+ if (tag !== 8) {
4547
4735
  break;
4548
4736
  }
4549
4737
  message.txtype = reader.int32();
4550
4738
  continue;
4551
4739
  case 2:
4552
- if (tag != 16) {
4740
+ if (tag !== 16) {
4553
4741
  break;
4554
4742
  }
4555
4743
  message.nonce = reader.uint32();
4556
4744
  continue;
4557
4745
  case 3:
4558
- if (tag != 26) {
4746
+ if (tag !== 26) {
4559
4747
  break;
4560
4748
  }
4561
4749
  message.keykeeper = reader.bytes();
4562
4750
  continue;
4563
4751
  }
4564
- if ((tag & 7) == 4 || tag == 0) {
4752
+ if ((tag & 7) === 4 || tag === 0) {
4565
4753
  break;
4566
4754
  }
4567
4755
  reader.skipType(tag & 7);
@@ -4572,14 +4760,20 @@ var SetKeykeeperTx = {
4572
4760
  return {
4573
4761
  txtype: isSet(object.txtype) ? txTypeFromJSON(object.txtype) : 0,
4574
4762
  nonce: isSet(object.nonce) ? Number(object.nonce) : 0,
4575
- keykeeper: isSet(object.keykeeper) ? bytesFromBase64(object.keykeeper) : new Uint8Array()
4763
+ keykeeper: isSet(object.keykeeper) ? bytesFromBase64(object.keykeeper) : new Uint8Array(0)
4576
4764
  };
4577
4765
  },
4578
4766
  toJSON(message) {
4579
4767
  const obj = {};
4580
- message.txtype !== void 0 && (obj.txtype = txTypeToJSON(message.txtype));
4581
- message.nonce !== void 0 && (obj.nonce = Math.round(message.nonce));
4582
- message.keykeeper !== void 0 && (obj.keykeeper = base64FromBytes(message.keykeeper !== void 0 ? message.keykeeper : new Uint8Array()));
4768
+ if (message.txtype !== 0) {
4769
+ obj.txtype = txTypeToJSON(message.txtype);
4770
+ }
4771
+ if (message.nonce !== 0) {
4772
+ obj.nonce = Math.round(message.nonce);
4773
+ }
4774
+ if (message.keykeeper.length !== 0) {
4775
+ obj.keykeeper = base64FromBytes(message.keykeeper);
4776
+ }
4583
4777
  return obj;
4584
4778
  },
4585
4779
  create(base) {
@@ -4589,17 +4783,17 @@ var SetKeykeeperTx = {
4589
4783
  const message = createBaseSetKeykeeperTx();
4590
4784
  message.txtype = object.txtype ?? 0;
4591
4785
  message.nonce = object.nonce ?? 0;
4592
- message.keykeeper = object.keykeeper ?? new Uint8Array();
4786
+ message.keykeeper = object.keykeeper ?? new Uint8Array(0);
4593
4787
  return message;
4594
4788
  }
4595
4789
  };
4596
4790
  function createBaseProcess() {
4597
4791
  return {
4598
- processId: new Uint8Array(),
4599
- entityId: new Uint8Array(),
4792
+ processId: new Uint8Array(0),
4793
+ entityId: new Uint8Array(0),
4600
4794
  startBlock: 0,
4601
4795
  blockCount: 0,
4602
- censusRoot: new Uint8Array(),
4796
+ censusRoot: new Uint8Array(0),
4603
4797
  censusURI: void 0,
4604
4798
  encryptionPrivateKeys: [],
4605
4799
  encryptionPublicKeys: [],
@@ -4733,193 +4927,193 @@ var Process = {
4733
4927
  const tag = reader.uint32();
4734
4928
  switch (tag >>> 3) {
4735
4929
  case 1:
4736
- if (tag != 10) {
4930
+ if (tag !== 10) {
4737
4931
  break;
4738
4932
  }
4739
4933
  message.processId = reader.bytes();
4740
4934
  continue;
4741
4935
  case 2:
4742
- if (tag != 18) {
4936
+ if (tag !== 18) {
4743
4937
  break;
4744
4938
  }
4745
4939
  message.entityId = reader.bytes();
4746
4940
  continue;
4747
4941
  case 3:
4748
- if (tag != 24) {
4942
+ if (tag !== 24) {
4749
4943
  break;
4750
4944
  }
4751
4945
  message.startBlock = reader.uint32();
4752
4946
  continue;
4753
4947
  case 4:
4754
- if (tag != 32) {
4948
+ if (tag !== 32) {
4755
4949
  break;
4756
4950
  }
4757
4951
  message.blockCount = reader.uint32();
4758
4952
  continue;
4759
4953
  case 5:
4760
- if (tag != 42) {
4954
+ if (tag !== 42) {
4761
4955
  break;
4762
4956
  }
4763
4957
  message.censusRoot = reader.bytes();
4764
4958
  continue;
4765
4959
  case 6:
4766
- if (tag != 50) {
4960
+ if (tag !== 50) {
4767
4961
  break;
4768
4962
  }
4769
4963
  message.censusURI = reader.string();
4770
4964
  continue;
4771
4965
  case 8:
4772
- if (tag != 66) {
4966
+ if (tag !== 66) {
4773
4967
  break;
4774
4968
  }
4775
4969
  message.encryptionPrivateKeys.push(reader.string());
4776
4970
  continue;
4777
4971
  case 9:
4778
- if (tag != 74) {
4972
+ if (tag !== 74) {
4779
4973
  break;
4780
4974
  }
4781
4975
  message.encryptionPublicKeys.push(reader.string());
4782
4976
  continue;
4783
4977
  case 11:
4784
- if (tag != 88) {
4978
+ if (tag !== 88) {
4785
4979
  break;
4786
4980
  }
4787
4981
  message.keyIndex = reader.uint32();
4788
4982
  continue;
4789
4983
  case 12:
4790
- if (tag != 96) {
4984
+ if (tag !== 96) {
4791
4985
  break;
4792
4986
  }
4793
4987
  message.status = reader.int32();
4794
4988
  continue;
4795
4989
  case 13:
4796
- if (tag != 106) {
4990
+ if (tag !== 106) {
4797
4991
  break;
4798
4992
  }
4799
4993
  message.paramsSignature = reader.bytes();
4800
4994
  continue;
4801
4995
  case 14:
4802
- if (tag != 112) {
4996
+ if (tag !== 112) {
4803
4997
  break;
4804
4998
  }
4805
4999
  message.namespace = reader.uint32();
4806
5000
  continue;
4807
5001
  case 15:
4808
- if (tag != 122) {
5002
+ if (tag !== 122) {
4809
5003
  break;
4810
5004
  }
4811
5005
  message.envelopeType = EnvelopeType.decode(reader, reader.uint32());
4812
5006
  continue;
4813
5007
  case 16:
4814
- if (tag != 130) {
5008
+ if (tag !== 130) {
4815
5009
  break;
4816
5010
  }
4817
5011
  message.mode = ProcessMode.decode(reader, reader.uint32());
4818
5012
  continue;
4819
5013
  case 17:
4820
- if (tag != 136) {
5014
+ if (tag !== 136) {
4821
5015
  break;
4822
5016
  }
4823
5017
  message.questionIndex = reader.uint32();
4824
5018
  continue;
4825
5019
  case 18:
4826
- if (tag != 144) {
5020
+ if (tag !== 144) {
4827
5021
  break;
4828
5022
  }
4829
5023
  message.questionCount = reader.uint32();
4830
5024
  continue;
4831
5025
  case 19:
4832
- if (tag != 154) {
5026
+ if (tag !== 154) {
4833
5027
  break;
4834
5028
  }
4835
5029
  message.voteOptions = ProcessVoteOptions.decode(reader, reader.uint32());
4836
5030
  continue;
4837
5031
  case 20:
4838
- if (tag != 160) {
5032
+ if (tag !== 160) {
4839
5033
  break;
4840
5034
  }
4841
5035
  message.censusOrigin = reader.int32();
4842
5036
  continue;
4843
5037
  case 21:
4844
- if (tag != 170) {
5038
+ if (tag !== 170) {
4845
5039
  break;
4846
5040
  }
4847
5041
  message.results.push(ProcessResult.decode(reader, reader.uint32()));
4848
5042
  continue;
4849
5043
  case 22:
4850
- if (tag != 178) {
5044
+ if (tag !== 178) {
4851
5045
  break;
4852
5046
  }
4853
5047
  message.resultsSignatures.push(reader.bytes());
4854
5048
  continue;
4855
5049
  case 23:
4856
- if (tag != 184) {
5050
+ if (tag !== 184) {
4857
5051
  break;
4858
5052
  }
4859
5053
  message.ethIndexSlot = reader.uint32();
4860
5054
  continue;
4861
5055
  case 24:
4862
- if (tag != 192) {
5056
+ if (tag !== 192) {
4863
5057
  break;
4864
5058
  }
4865
5059
  message.sourceBlockHeight = longToNumber(reader.uint64());
4866
5060
  continue;
4867
5061
  case 25:
4868
- if (tag != 202) {
5062
+ if (tag !== 202) {
4869
5063
  break;
4870
5064
  }
4871
5065
  message.owner = reader.bytes();
4872
5066
  continue;
4873
5067
  case 26:
4874
- if (tag != 210) {
5068
+ if (tag !== 210) {
4875
5069
  break;
4876
5070
  }
4877
5071
  message.metadata = reader.string();
4878
5072
  continue;
4879
5073
  case 27:
4880
- if (tag != 216) {
5074
+ if (tag !== 216) {
4881
5075
  break;
4882
5076
  }
4883
5077
  message.sourceNetworkId = reader.int32();
4884
5078
  continue;
4885
5079
  case 28:
4886
- if (tag != 224) {
5080
+ if (tag !== 224) {
4887
5081
  break;
4888
5082
  }
4889
5083
  message.maxCensusSize = longToNumber(reader.uint64());
4890
5084
  continue;
4891
5085
  case 29:
4892
- if (tag != 234) {
5086
+ if (tag !== 234) {
4893
5087
  break;
4894
5088
  }
4895
5089
  message.rollingCensusRoot = reader.bytes();
4896
5090
  continue;
4897
5091
  case 30:
4898
- if (tag != 240) {
5092
+ if (tag !== 240) {
4899
5093
  break;
4900
5094
  }
4901
5095
  message.rollingCensusSize = longToNumber(reader.uint64());
4902
5096
  continue;
4903
5097
  case 31:
4904
- if (tag != 250) {
5098
+ if (tag !== 250) {
4905
5099
  break;
4906
5100
  }
4907
5101
  message.nullifiersRoot = reader.bytes();
4908
5102
  continue;
4909
5103
  case 32:
4910
- if (tag != 258) {
5104
+ if (tag !== 258) {
4911
5105
  break;
4912
5106
  }
4913
5107
  message.sourceNetworkContractAddr = reader.bytes();
4914
5108
  continue;
4915
5109
  case 33:
4916
- if (tag != 264) {
5110
+ if (tag !== 264) {
4917
5111
  break;
4918
5112
  }
4919
5113
  message.tokenDecimals = reader.uint32();
4920
5114
  continue;
4921
5115
  }
4922
- if ((tag & 7) == 4 || tag == 0) {
5116
+ if ((tag & 7) === 4 || tag === 0) {
4923
5117
  break;
4924
5118
  }
4925
5119
  reader.skipType(tag & 7);
@@ -4928,11 +5122,11 @@ var Process = {
4928
5122
  },
4929
5123
  fromJSON(object) {
4930
5124
  return {
4931
- processId: isSet(object.processId) ? bytesFromBase64(object.processId) : new Uint8Array(),
4932
- entityId: isSet(object.entityId) ? bytesFromBase64(object.entityId) : new Uint8Array(),
5125
+ processId: isSet(object.processId) ? bytesFromBase64(object.processId) : new Uint8Array(0),
5126
+ entityId: isSet(object.entityId) ? bytesFromBase64(object.entityId) : new Uint8Array(0),
4933
5127
  startBlock: isSet(object.startBlock) ? Number(object.startBlock) : 0,
4934
5128
  blockCount: isSet(object.blockCount) ? Number(object.blockCount) : 0,
4935
- censusRoot: isSet(object.censusRoot) ? bytesFromBase64(object.censusRoot) : new Uint8Array(),
5129
+ censusRoot: isSet(object.censusRoot) ? bytesFromBase64(object.censusRoot) : new Uint8Array(0),
4936
5130
  censusURI: isSet(object.censusURI) ? String(object.censusURI) : void 0,
4937
5131
  encryptionPrivateKeys: Array.isArray(object?.encryptionPrivateKeys) ? object.encryptionPrivateKeys.map((e) => String(e)) : [],
4938
5132
  encryptionPublicKeys: Array.isArray(object?.encryptionPublicKeys) ? object.encryptionPublicKeys.map((e) => String(e)) : [],
@@ -4963,55 +5157,99 @@ var Process = {
4963
5157
  },
4964
5158
  toJSON(message) {
4965
5159
  const obj = {};
4966
- message.processId !== void 0 && (obj.processId = base64FromBytes(message.processId !== void 0 ? message.processId : new Uint8Array()));
4967
- message.entityId !== void 0 && (obj.entityId = base64FromBytes(message.entityId !== void 0 ? message.entityId : new Uint8Array()));
4968
- message.startBlock !== void 0 && (obj.startBlock = Math.round(message.startBlock));
4969
- message.blockCount !== void 0 && (obj.blockCount = Math.round(message.blockCount));
4970
- message.censusRoot !== void 0 && (obj.censusRoot = base64FromBytes(message.censusRoot !== void 0 ? message.censusRoot : new Uint8Array()));
4971
- message.censusURI !== void 0 && (obj.censusURI = message.censusURI);
4972
- if (message.encryptionPrivateKeys) {
4973
- obj.encryptionPrivateKeys = message.encryptionPrivateKeys.map((e) => e);
4974
- } else {
4975
- obj.encryptionPrivateKeys = [];
4976
- }
4977
- if (message.encryptionPublicKeys) {
4978
- obj.encryptionPublicKeys = message.encryptionPublicKeys.map((e) => e);
4979
- } else {
4980
- obj.encryptionPublicKeys = [];
4981
- }
4982
- message.keyIndex !== void 0 && (obj.keyIndex = Math.round(message.keyIndex));
4983
- message.status !== void 0 && (obj.status = processStatusToJSON(message.status));
4984
- message.paramsSignature !== void 0 && (obj.paramsSignature = message.paramsSignature !== void 0 ? base64FromBytes(message.paramsSignature) : void 0);
4985
- message.namespace !== void 0 && (obj.namespace = Math.round(message.namespace));
4986
- message.envelopeType !== void 0 && (obj.envelopeType = message.envelopeType ? EnvelopeType.toJSON(message.envelopeType) : void 0);
4987
- message.mode !== void 0 && (obj.mode = message.mode ? ProcessMode.toJSON(message.mode) : void 0);
4988
- message.questionIndex !== void 0 && (obj.questionIndex = Math.round(message.questionIndex));
4989
- message.questionCount !== void 0 && (obj.questionCount = Math.round(message.questionCount));
4990
- message.voteOptions !== void 0 && (obj.voteOptions = message.voteOptions ? ProcessVoteOptions.toJSON(message.voteOptions) : void 0);
4991
- message.censusOrigin !== void 0 && (obj.censusOrigin = censusOriginToJSON(message.censusOrigin));
4992
- if (message.results) {
4993
- obj.results = message.results.map((e) => e ? ProcessResult.toJSON(e) : void 0);
4994
- } else {
4995
- obj.results = [];
4996
- }
4997
- if (message.resultsSignatures) {
4998
- obj.resultsSignatures = message.resultsSignatures.map(
4999
- (e) => base64FromBytes(e !== void 0 ? e : new Uint8Array())
5000
- );
5001
- } else {
5002
- obj.resultsSignatures = [];
5003
- }
5004
- message.ethIndexSlot !== void 0 && (obj.ethIndexSlot = Math.round(message.ethIndexSlot));
5005
- message.sourceBlockHeight !== void 0 && (obj.sourceBlockHeight = Math.round(message.sourceBlockHeight));
5006
- message.owner !== void 0 && (obj.owner = message.owner !== void 0 ? base64FromBytes(message.owner) : void 0);
5007
- message.metadata !== void 0 && (obj.metadata = message.metadata);
5008
- message.sourceNetworkId !== void 0 && (obj.sourceNetworkId = sourceNetworkIdToJSON(message.sourceNetworkId));
5009
- message.maxCensusSize !== void 0 && (obj.maxCensusSize = Math.round(message.maxCensusSize));
5010
- message.rollingCensusRoot !== void 0 && (obj.rollingCensusRoot = message.rollingCensusRoot !== void 0 ? base64FromBytes(message.rollingCensusRoot) : void 0);
5011
- message.rollingCensusSize !== void 0 && (obj.rollingCensusSize = Math.round(message.rollingCensusSize));
5012
- message.nullifiersRoot !== void 0 && (obj.nullifiersRoot = message.nullifiersRoot !== void 0 ? base64FromBytes(message.nullifiersRoot) : void 0);
5013
- message.sourceNetworkContractAddr !== void 0 && (obj.sourceNetworkContractAddr = message.sourceNetworkContractAddr !== void 0 ? base64FromBytes(message.sourceNetworkContractAddr) : void 0);
5014
- message.tokenDecimals !== void 0 && (obj.tokenDecimals = Math.round(message.tokenDecimals));
5160
+ if (message.processId.length !== 0) {
5161
+ obj.processId = base64FromBytes(message.processId);
5162
+ }
5163
+ if (message.entityId.length !== 0) {
5164
+ obj.entityId = base64FromBytes(message.entityId);
5165
+ }
5166
+ if (message.startBlock !== 0) {
5167
+ obj.startBlock = Math.round(message.startBlock);
5168
+ }
5169
+ if (message.blockCount !== 0) {
5170
+ obj.blockCount = Math.round(message.blockCount);
5171
+ }
5172
+ if (message.censusRoot.length !== 0) {
5173
+ obj.censusRoot = base64FromBytes(message.censusRoot);
5174
+ }
5175
+ if (message.censusURI !== void 0) {
5176
+ obj.censusURI = message.censusURI;
5177
+ }
5178
+ if (message.encryptionPrivateKeys?.length) {
5179
+ obj.encryptionPrivateKeys = message.encryptionPrivateKeys;
5180
+ }
5181
+ if (message.encryptionPublicKeys?.length) {
5182
+ obj.encryptionPublicKeys = message.encryptionPublicKeys;
5183
+ }
5184
+ if (message.keyIndex !== void 0) {
5185
+ obj.keyIndex = Math.round(message.keyIndex);
5186
+ }
5187
+ if (message.status !== 0) {
5188
+ obj.status = processStatusToJSON(message.status);
5189
+ }
5190
+ if (message.paramsSignature !== void 0) {
5191
+ obj.paramsSignature = base64FromBytes(message.paramsSignature);
5192
+ }
5193
+ if (message.namespace !== 0) {
5194
+ obj.namespace = Math.round(message.namespace);
5195
+ }
5196
+ if (message.envelopeType !== void 0) {
5197
+ obj.envelopeType = EnvelopeType.toJSON(message.envelopeType);
5198
+ }
5199
+ if (message.mode !== void 0) {
5200
+ obj.mode = ProcessMode.toJSON(message.mode);
5201
+ }
5202
+ if (message.questionIndex !== void 0) {
5203
+ obj.questionIndex = Math.round(message.questionIndex);
5204
+ }
5205
+ if (message.questionCount !== void 0) {
5206
+ obj.questionCount = Math.round(message.questionCount);
5207
+ }
5208
+ if (message.voteOptions !== void 0) {
5209
+ obj.voteOptions = ProcessVoteOptions.toJSON(message.voteOptions);
5210
+ }
5211
+ if (message.censusOrigin !== 0) {
5212
+ obj.censusOrigin = censusOriginToJSON(message.censusOrigin);
5213
+ }
5214
+ if (message.results?.length) {
5215
+ obj.results = message.results.map((e) => ProcessResult.toJSON(e));
5216
+ }
5217
+ if (message.resultsSignatures?.length) {
5218
+ obj.resultsSignatures = message.resultsSignatures.map((e) => base64FromBytes(e));
5219
+ }
5220
+ if (message.ethIndexSlot !== void 0) {
5221
+ obj.ethIndexSlot = Math.round(message.ethIndexSlot);
5222
+ }
5223
+ if (message.sourceBlockHeight !== void 0) {
5224
+ obj.sourceBlockHeight = Math.round(message.sourceBlockHeight);
5225
+ }
5226
+ if (message.owner !== void 0) {
5227
+ obj.owner = base64FromBytes(message.owner);
5228
+ }
5229
+ if (message.metadata !== void 0) {
5230
+ obj.metadata = message.metadata;
5231
+ }
5232
+ if (message.sourceNetworkId !== 0) {
5233
+ obj.sourceNetworkId = sourceNetworkIdToJSON(message.sourceNetworkId);
5234
+ }
5235
+ if (message.maxCensusSize !== 0) {
5236
+ obj.maxCensusSize = Math.round(message.maxCensusSize);
5237
+ }
5238
+ if (message.rollingCensusRoot !== void 0) {
5239
+ obj.rollingCensusRoot = base64FromBytes(message.rollingCensusRoot);
5240
+ }
5241
+ if (message.rollingCensusSize !== void 0) {
5242
+ obj.rollingCensusSize = Math.round(message.rollingCensusSize);
5243
+ }
5244
+ if (message.nullifiersRoot !== void 0) {
5245
+ obj.nullifiersRoot = base64FromBytes(message.nullifiersRoot);
5246
+ }
5247
+ if (message.sourceNetworkContractAddr !== void 0) {
5248
+ obj.sourceNetworkContractAddr = base64FromBytes(message.sourceNetworkContractAddr);
5249
+ }
5250
+ if (message.tokenDecimals !== void 0) {
5251
+ obj.tokenDecimals = Math.round(message.tokenDecimals);
5252
+ }
5015
5253
  return obj;
5016
5254
  },
5017
5255
  create(base) {
@@ -5019,11 +5257,11 @@ var Process = {
5019
5257
  },
5020
5258
  fromPartial(object) {
5021
5259
  const message = createBaseProcess();
5022
- message.processId = object.processId ?? new Uint8Array();
5023
- message.entityId = object.entityId ?? new Uint8Array();
5260
+ message.processId = object.processId ?? new Uint8Array(0);
5261
+ message.entityId = object.entityId ?? new Uint8Array(0);
5024
5262
  message.startBlock = object.startBlock ?? 0;
5025
5263
  message.blockCount = object.blockCount ?? 0;
5026
- message.censusRoot = object.censusRoot ?? new Uint8Array();
5264
+ message.censusRoot = object.censusRoot ?? new Uint8Array(0);
5027
5265
  message.censusURI = object.censusURI ?? void 0;
5028
5266
  message.encryptionPrivateKeys = object.encryptionPrivateKeys?.map((e) => e) || [];
5029
5267
  message.encryptionPublicKeys = object.encryptionPublicKeys?.map((e) => e) || [];
@@ -5083,37 +5321,37 @@ var EnvelopeType = {
5083
5321
  const tag = reader.uint32();
5084
5322
  switch (tag >>> 3) {
5085
5323
  case 1:
5086
- if (tag != 8) {
5324
+ if (tag !== 8) {
5087
5325
  break;
5088
5326
  }
5089
5327
  message.serial = reader.bool();
5090
5328
  continue;
5091
5329
  case 2:
5092
- if (tag != 16) {
5330
+ if (tag !== 16) {
5093
5331
  break;
5094
5332
  }
5095
5333
  message.anonymous = reader.bool();
5096
5334
  continue;
5097
5335
  case 3:
5098
- if (tag != 24) {
5336
+ if (tag !== 24) {
5099
5337
  break;
5100
5338
  }
5101
5339
  message.encryptedVotes = reader.bool();
5102
5340
  continue;
5103
5341
  case 4:
5104
- if (tag != 32) {
5342
+ if (tag !== 32) {
5105
5343
  break;
5106
5344
  }
5107
5345
  message.uniqueValues = reader.bool();
5108
5346
  continue;
5109
5347
  case 5:
5110
- if (tag != 40) {
5348
+ if (tag !== 40) {
5111
5349
  break;
5112
5350
  }
5113
5351
  message.costFromWeight = reader.bool();
5114
5352
  continue;
5115
5353
  }
5116
- if ((tag & 7) == 4 || tag == 0) {
5354
+ if ((tag & 7) === 4 || tag === 0) {
5117
5355
  break;
5118
5356
  }
5119
5357
  reader.skipType(tag & 7);
@@ -5131,11 +5369,21 @@ var EnvelopeType = {
5131
5369
  },
5132
5370
  toJSON(message) {
5133
5371
  const obj = {};
5134
- message.serial !== void 0 && (obj.serial = message.serial);
5135
- message.anonymous !== void 0 && (obj.anonymous = message.anonymous);
5136
- message.encryptedVotes !== void 0 && (obj.encryptedVotes = message.encryptedVotes);
5137
- message.uniqueValues !== void 0 && (obj.uniqueValues = message.uniqueValues);
5138
- message.costFromWeight !== void 0 && (obj.costFromWeight = message.costFromWeight);
5372
+ if (message.serial === true) {
5373
+ obj.serial = message.serial;
5374
+ }
5375
+ if (message.anonymous === true) {
5376
+ obj.anonymous = message.anonymous;
5377
+ }
5378
+ if (message.encryptedVotes === true) {
5379
+ obj.encryptedVotes = message.encryptedVotes;
5380
+ }
5381
+ if (message.uniqueValues === true) {
5382
+ obj.uniqueValues = message.uniqueValues;
5383
+ }
5384
+ if (message.costFromWeight === true) {
5385
+ obj.costFromWeight = message.costFromWeight;
5386
+ }
5139
5387
  return obj;
5140
5388
  },
5141
5389
  create(base) {
@@ -5181,37 +5429,37 @@ var ProcessMode = {
5181
5429
  const tag = reader.uint32();
5182
5430
  switch (tag >>> 3) {
5183
5431
  case 1:
5184
- if (tag != 8) {
5432
+ if (tag !== 8) {
5185
5433
  break;
5186
5434
  }
5187
5435
  message.autoStart = reader.bool();
5188
5436
  continue;
5189
5437
  case 2:
5190
- if (tag != 16) {
5438
+ if (tag !== 16) {
5191
5439
  break;
5192
5440
  }
5193
5441
  message.interruptible = reader.bool();
5194
5442
  continue;
5195
5443
  case 3:
5196
- if (tag != 24) {
5444
+ if (tag !== 24) {
5197
5445
  break;
5198
5446
  }
5199
5447
  message.dynamicCensus = reader.bool();
5200
5448
  continue;
5201
5449
  case 4:
5202
- if (tag != 32) {
5450
+ if (tag !== 32) {
5203
5451
  break;
5204
5452
  }
5205
5453
  message.encryptedMetaData = reader.bool();
5206
5454
  continue;
5207
5455
  case 5:
5208
- if (tag != 40) {
5456
+ if (tag !== 40) {
5209
5457
  break;
5210
5458
  }
5211
5459
  message.preRegister = reader.bool();
5212
5460
  continue;
5213
5461
  }
5214
- if ((tag & 7) == 4 || tag == 0) {
5462
+ if ((tag & 7) === 4 || tag === 0) {
5215
5463
  break;
5216
5464
  }
5217
5465
  reader.skipType(tag & 7);
@@ -5229,11 +5477,21 @@ var ProcessMode = {
5229
5477
  },
5230
5478
  toJSON(message) {
5231
5479
  const obj = {};
5232
- message.autoStart !== void 0 && (obj.autoStart = message.autoStart);
5233
- message.interruptible !== void 0 && (obj.interruptible = message.interruptible);
5234
- message.dynamicCensus !== void 0 && (obj.dynamicCensus = message.dynamicCensus);
5235
- message.encryptedMetaData !== void 0 && (obj.encryptedMetaData = message.encryptedMetaData);
5236
- message.preRegister !== void 0 && (obj.preRegister = message.preRegister);
5480
+ if (message.autoStart === true) {
5481
+ obj.autoStart = message.autoStart;
5482
+ }
5483
+ if (message.interruptible === true) {
5484
+ obj.interruptible = message.interruptible;
5485
+ }
5486
+ if (message.dynamicCensus === true) {
5487
+ obj.dynamicCensus = message.dynamicCensus;
5488
+ }
5489
+ if (message.encryptedMetaData === true) {
5490
+ obj.encryptedMetaData = message.encryptedMetaData;
5491
+ }
5492
+ if (message.preRegister === true) {
5493
+ obj.preRegister = message.preRegister;
5494
+ }
5237
5495
  return obj;
5238
5496
  },
5239
5497
  create(base) {
@@ -5279,37 +5537,37 @@ var ProcessVoteOptions = {
5279
5537
  const tag = reader.uint32();
5280
5538
  switch (tag >>> 3) {
5281
5539
  case 1:
5282
- if (tag != 8) {
5540
+ if (tag !== 8) {
5283
5541
  break;
5284
5542
  }
5285
5543
  message.maxCount = reader.uint32();
5286
5544
  continue;
5287
5545
  case 2:
5288
- if (tag != 16) {
5546
+ if (tag !== 16) {
5289
5547
  break;
5290
5548
  }
5291
5549
  message.maxValue = reader.uint32();
5292
5550
  continue;
5293
5551
  case 3:
5294
- if (tag != 24) {
5552
+ if (tag !== 24) {
5295
5553
  break;
5296
5554
  }
5297
5555
  message.maxVoteOverwrites = reader.uint32();
5298
5556
  continue;
5299
5557
  case 4:
5300
- if (tag != 32) {
5558
+ if (tag !== 32) {
5301
5559
  break;
5302
5560
  }
5303
5561
  message.maxTotalCost = reader.uint32();
5304
5562
  continue;
5305
5563
  case 5:
5306
- if (tag != 40) {
5564
+ if (tag !== 40) {
5307
5565
  break;
5308
5566
  }
5309
5567
  message.costExponent = reader.uint32();
5310
5568
  continue;
5311
5569
  }
5312
- if ((tag & 7) == 4 || tag == 0) {
5570
+ if ((tag & 7) === 4 || tag === 0) {
5313
5571
  break;
5314
5572
  }
5315
5573
  reader.skipType(tag & 7);
@@ -5327,11 +5585,21 @@ var ProcessVoteOptions = {
5327
5585
  },
5328
5586
  toJSON(message) {
5329
5587
  const obj = {};
5330
- message.maxCount !== void 0 && (obj.maxCount = Math.round(message.maxCount));
5331
- message.maxValue !== void 0 && (obj.maxValue = Math.round(message.maxValue));
5332
- message.maxVoteOverwrites !== void 0 && (obj.maxVoteOverwrites = Math.round(message.maxVoteOverwrites));
5333
- message.maxTotalCost !== void 0 && (obj.maxTotalCost = Math.round(message.maxTotalCost));
5334
- message.costExponent !== void 0 && (obj.costExponent = Math.round(message.costExponent));
5588
+ if (message.maxCount !== 0) {
5589
+ obj.maxCount = Math.round(message.maxCount);
5590
+ }
5591
+ if (message.maxValue !== 0) {
5592
+ obj.maxValue = Math.round(message.maxValue);
5593
+ }
5594
+ if (message.maxVoteOverwrites !== 0) {
5595
+ obj.maxVoteOverwrites = Math.round(message.maxVoteOverwrites);
5596
+ }
5597
+ if (message.maxTotalCost !== 0) {
5598
+ obj.maxTotalCost = Math.round(message.maxTotalCost);
5599
+ }
5600
+ if (message.costExponent !== 0) {
5601
+ obj.costExponent = Math.round(message.costExponent);
5602
+ }
5335
5603
  return obj;
5336
5604
  },
5337
5605
  create(base) {
@@ -5365,13 +5633,13 @@ var OracleList = {
5365
5633
  const tag = reader.uint32();
5366
5634
  switch (tag >>> 3) {
5367
5635
  case 1:
5368
- if (tag != 10) {
5636
+ if (tag !== 10) {
5369
5637
  break;
5370
5638
  }
5371
5639
  message.oracles.push(reader.bytes());
5372
5640
  continue;
5373
5641
  }
5374
- if ((tag & 7) == 4 || tag == 0) {
5642
+ if ((tag & 7) === 4 || tag === 0) {
5375
5643
  break;
5376
5644
  }
5377
5645
  reader.skipType(tag & 7);
@@ -5383,10 +5651,8 @@ var OracleList = {
5383
5651
  },
5384
5652
  toJSON(message) {
5385
5653
  const obj = {};
5386
- if (message.oracles) {
5387
- obj.oracles = message.oracles.map((e) => base64FromBytes(e !== void 0 ? e : new Uint8Array()));
5388
- } else {
5389
- obj.oracles = [];
5654
+ if (message.oracles?.length) {
5655
+ obj.oracles = message.oracles.map((e) => base64FromBytes(e));
5390
5656
  }
5391
5657
  return obj;
5392
5658
  },
@@ -5417,13 +5683,13 @@ var ValidatorList = {
5417
5683
  const tag = reader.uint32();
5418
5684
  switch (tag >>> 3) {
5419
5685
  case 1:
5420
- if (tag != 10) {
5686
+ if (tag !== 10) {
5421
5687
  break;
5422
5688
  }
5423
5689
  message.validators.push(Validator.decode(reader, reader.uint32()));
5424
5690
  continue;
5425
5691
  }
5426
- if ((tag & 7) == 4 || tag == 0) {
5692
+ if ((tag & 7) === 4 || tag === 0) {
5427
5693
  break;
5428
5694
  }
5429
5695
  reader.skipType(tag & 7);
@@ -5437,10 +5703,8 @@ var ValidatorList = {
5437
5703
  },
5438
5704
  toJSON(message) {
5439
5705
  const obj = {};
5440
- if (message.validators) {
5441
- obj.validators = message.validators.map((e) => e ? Validator.toJSON(e) : void 0);
5442
- } else {
5443
- obj.validators = [];
5706
+ if (message.validators?.length) {
5707
+ obj.validators = message.validators.map((e) => Validator.toJSON(e));
5444
5708
  }
5445
5709
  return obj;
5446
5710
  },
@@ -5454,7 +5718,7 @@ var ValidatorList = {
5454
5718
  }
5455
5719
  };
5456
5720
  function createBaseValidator() {
5457
- return { address: new Uint8Array(), pubKey: new Uint8Array(), power: 0, name: "", keyIndex: 0 };
5721
+ return { address: new Uint8Array(0), pubKey: new Uint8Array(0), power: 0, name: "", keyIndex: 0 };
5458
5722
  }
5459
5723
  var Validator = {
5460
5724
  encode(message, writer = import_minimal.default.Writer.create()) {
@@ -5483,37 +5747,37 @@ var Validator = {
5483
5747
  const tag = reader.uint32();
5484
5748
  switch (tag >>> 3) {
5485
5749
  case 1:
5486
- if (tag != 10) {
5750
+ if (tag !== 10) {
5487
5751
  break;
5488
5752
  }
5489
5753
  message.address = reader.bytes();
5490
5754
  continue;
5491
5755
  case 2:
5492
- if (tag != 18) {
5756
+ if (tag !== 18) {
5493
5757
  break;
5494
5758
  }
5495
5759
  message.pubKey = reader.bytes();
5496
5760
  continue;
5497
5761
  case 3:
5498
- if (tag != 24) {
5762
+ if (tag !== 24) {
5499
5763
  break;
5500
5764
  }
5501
5765
  message.power = longToNumber(reader.uint64());
5502
5766
  continue;
5503
5767
  case 4:
5504
- if (tag != 34) {
5768
+ if (tag !== 34) {
5505
5769
  break;
5506
5770
  }
5507
5771
  message.name = reader.string();
5508
5772
  continue;
5509
5773
  case 5:
5510
- if (tag != 40) {
5774
+ if (tag !== 40) {
5511
5775
  break;
5512
5776
  }
5513
5777
  message.keyIndex = reader.uint32();
5514
5778
  continue;
5515
5779
  }
5516
- if ((tag & 7) == 4 || tag == 0) {
5780
+ if ((tag & 7) === 4 || tag === 0) {
5517
5781
  break;
5518
5782
  }
5519
5783
  reader.skipType(tag & 7);
@@ -5522,8 +5786,8 @@ var Validator = {
5522
5786
  },
5523
5787
  fromJSON(object) {
5524
5788
  return {
5525
- address: isSet(object.address) ? bytesFromBase64(object.address) : new Uint8Array(),
5526
- pubKey: isSet(object.pubKey) ? bytesFromBase64(object.pubKey) : new Uint8Array(),
5789
+ address: isSet(object.address) ? bytesFromBase64(object.address) : new Uint8Array(0),
5790
+ pubKey: isSet(object.pubKey) ? bytesFromBase64(object.pubKey) : new Uint8Array(0),
5527
5791
  power: isSet(object.power) ? Number(object.power) : 0,
5528
5792
  name: isSet(object.name) ? String(object.name) : "",
5529
5793
  keyIndex: isSet(object.keyIndex) ? Number(object.keyIndex) : 0
@@ -5531,11 +5795,21 @@ var Validator = {
5531
5795
  },
5532
5796
  toJSON(message) {
5533
5797
  const obj = {};
5534
- message.address !== void 0 && (obj.address = base64FromBytes(message.address !== void 0 ? message.address : new Uint8Array()));
5535
- message.pubKey !== void 0 && (obj.pubKey = base64FromBytes(message.pubKey !== void 0 ? message.pubKey : new Uint8Array()));
5536
- message.power !== void 0 && (obj.power = Math.round(message.power));
5537
- message.name !== void 0 && (obj.name = message.name);
5538
- message.keyIndex !== void 0 && (obj.keyIndex = Math.round(message.keyIndex));
5798
+ if (message.address.length !== 0) {
5799
+ obj.address = base64FromBytes(message.address);
5800
+ }
5801
+ if (message.pubKey.length !== 0) {
5802
+ obj.pubKey = base64FromBytes(message.pubKey);
5803
+ }
5804
+ if (message.power !== 0) {
5805
+ obj.power = Math.round(message.power);
5806
+ }
5807
+ if (message.name !== "") {
5808
+ obj.name = message.name;
5809
+ }
5810
+ if (message.keyIndex !== 0) {
5811
+ obj.keyIndex = Math.round(message.keyIndex);
5812
+ }
5539
5813
  return obj;
5540
5814
  },
5541
5815
  create(base) {
@@ -5543,8 +5817,8 @@ var Validator = {
5543
5817
  },
5544
5818
  fromPartial(object) {
5545
5819
  const message = createBaseValidator();
5546
- message.address = object.address ?? new Uint8Array();
5547
- message.pubKey = object.pubKey ?? new Uint8Array();
5820
+ message.address = object.address ?? new Uint8Array(0);
5821
+ message.pubKey = object.pubKey ?? new Uint8Array(0);
5548
5822
  message.power = object.power ?? 0;
5549
5823
  message.name = object.name ?? "";
5550
5824
  message.keyIndex = object.keyIndex ?? 0;
@@ -5556,16 +5830,16 @@ function createBaseTendermintHeader() {
5556
5830
  chainId: "",
5557
5831
  height: 0,
5558
5832
  timestamp: 0,
5559
- blockID: new Uint8Array(),
5560
- lastCommitHash: new Uint8Array(),
5561
- dataHash: new Uint8Array(),
5562
- validatorsHash: new Uint8Array(),
5563
- nextValidatorsHash: new Uint8Array(),
5564
- consensusHash: new Uint8Array(),
5565
- appHash: new Uint8Array(),
5566
- lastResultsHash: new Uint8Array(),
5567
- evidenceHash: new Uint8Array(),
5568
- proposerAddress: new Uint8Array()
5833
+ blockID: new Uint8Array(0),
5834
+ lastCommitHash: new Uint8Array(0),
5835
+ dataHash: new Uint8Array(0),
5836
+ validatorsHash: new Uint8Array(0),
5837
+ nextValidatorsHash: new Uint8Array(0),
5838
+ consensusHash: new Uint8Array(0),
5839
+ appHash: new Uint8Array(0),
5840
+ lastResultsHash: new Uint8Array(0),
5841
+ evidenceHash: new Uint8Array(0),
5842
+ proposerAddress: new Uint8Array(0)
5569
5843
  };
5570
5844
  }
5571
5845
  var TendermintHeader = {
@@ -5619,85 +5893,85 @@ var TendermintHeader = {
5619
5893
  const tag = reader.uint32();
5620
5894
  switch (tag >>> 3) {
5621
5895
  case 2:
5622
- if (tag != 18) {
5896
+ if (tag !== 18) {
5623
5897
  break;
5624
5898
  }
5625
5899
  message.chainId = reader.string();
5626
5900
  continue;
5627
5901
  case 3:
5628
- if (tag != 24) {
5902
+ if (tag !== 24) {
5629
5903
  break;
5630
5904
  }
5631
5905
  message.height = longToNumber(reader.int64());
5632
5906
  continue;
5633
5907
  case 4:
5634
- if (tag != 32) {
5908
+ if (tag !== 32) {
5635
5909
  break;
5636
5910
  }
5637
5911
  message.timestamp = longToNumber(reader.int64());
5638
5912
  continue;
5639
5913
  case 5:
5640
- if (tag != 42) {
5914
+ if (tag !== 42) {
5641
5915
  break;
5642
5916
  }
5643
5917
  message.blockID = reader.bytes();
5644
5918
  continue;
5645
5919
  case 6:
5646
- if (tag != 50) {
5920
+ if (tag !== 50) {
5647
5921
  break;
5648
5922
  }
5649
5923
  message.lastCommitHash = reader.bytes();
5650
5924
  continue;
5651
5925
  case 7:
5652
- if (tag != 58) {
5926
+ if (tag !== 58) {
5653
5927
  break;
5654
5928
  }
5655
5929
  message.dataHash = reader.bytes();
5656
5930
  continue;
5657
5931
  case 8:
5658
- if (tag != 66) {
5932
+ if (tag !== 66) {
5659
5933
  break;
5660
5934
  }
5661
5935
  message.validatorsHash = reader.bytes();
5662
5936
  continue;
5663
5937
  case 9:
5664
- if (tag != 74) {
5938
+ if (tag !== 74) {
5665
5939
  break;
5666
5940
  }
5667
5941
  message.nextValidatorsHash = reader.bytes();
5668
5942
  continue;
5669
5943
  case 10:
5670
- if (tag != 82) {
5944
+ if (tag !== 82) {
5671
5945
  break;
5672
5946
  }
5673
5947
  message.consensusHash = reader.bytes();
5674
5948
  continue;
5675
5949
  case 11:
5676
- if (tag != 90) {
5950
+ if (tag !== 90) {
5677
5951
  break;
5678
5952
  }
5679
5953
  message.appHash = reader.bytes();
5680
5954
  continue;
5681
5955
  case 12:
5682
- if (tag != 98) {
5956
+ if (tag !== 98) {
5683
5957
  break;
5684
5958
  }
5685
5959
  message.lastResultsHash = reader.bytes();
5686
5960
  continue;
5687
5961
  case 13:
5688
- if (tag != 106) {
5962
+ if (tag !== 106) {
5689
5963
  break;
5690
5964
  }
5691
5965
  message.evidenceHash = reader.bytes();
5692
5966
  continue;
5693
5967
  case 14:
5694
- if (tag != 114) {
5968
+ if (tag !== 114) {
5695
5969
  break;
5696
5970
  }
5697
5971
  message.proposerAddress = reader.bytes();
5698
5972
  continue;
5699
5973
  }
5700
- if ((tag & 7) == 4 || tag == 0) {
5974
+ if ((tag & 7) === 4 || tag === 0) {
5701
5975
  break;
5702
5976
  }
5703
5977
  reader.skipType(tag & 7);
@@ -5709,47 +5983,59 @@ var TendermintHeader = {
5709
5983
  chainId: isSet(object.chainId) ? String(object.chainId) : "",
5710
5984
  height: isSet(object.height) ? Number(object.height) : 0,
5711
5985
  timestamp: isSet(object.timestamp) ? Number(object.timestamp) : 0,
5712
- blockID: isSet(object.blockID) ? bytesFromBase64(object.blockID) : new Uint8Array(),
5713
- lastCommitHash: isSet(object.lastCommitHash) ? bytesFromBase64(object.lastCommitHash) : new Uint8Array(),
5714
- dataHash: isSet(object.dataHash) ? bytesFromBase64(object.dataHash) : new Uint8Array(),
5715
- validatorsHash: isSet(object.validatorsHash) ? bytesFromBase64(object.validatorsHash) : new Uint8Array(),
5716
- nextValidatorsHash: isSet(object.nextValidatorsHash) ? bytesFromBase64(object.nextValidatorsHash) : new Uint8Array(),
5717
- consensusHash: isSet(object.consensusHash) ? bytesFromBase64(object.consensusHash) : new Uint8Array(),
5718
- appHash: isSet(object.appHash) ? bytesFromBase64(object.appHash) : new Uint8Array(),
5719
- lastResultsHash: isSet(object.lastResultsHash) ? bytesFromBase64(object.lastResultsHash) : new Uint8Array(),
5720
- evidenceHash: isSet(object.evidenceHash) ? bytesFromBase64(object.evidenceHash) : new Uint8Array(),
5721
- proposerAddress: isSet(object.proposerAddress) ? bytesFromBase64(object.proposerAddress) : new Uint8Array()
5986
+ blockID: isSet(object.blockID) ? bytesFromBase64(object.blockID) : new Uint8Array(0),
5987
+ lastCommitHash: isSet(object.lastCommitHash) ? bytesFromBase64(object.lastCommitHash) : new Uint8Array(0),
5988
+ dataHash: isSet(object.dataHash) ? bytesFromBase64(object.dataHash) : new Uint8Array(0),
5989
+ validatorsHash: isSet(object.validatorsHash) ? bytesFromBase64(object.validatorsHash) : new Uint8Array(0),
5990
+ nextValidatorsHash: isSet(object.nextValidatorsHash) ? bytesFromBase64(object.nextValidatorsHash) : new Uint8Array(0),
5991
+ consensusHash: isSet(object.consensusHash) ? bytesFromBase64(object.consensusHash) : new Uint8Array(0),
5992
+ appHash: isSet(object.appHash) ? bytesFromBase64(object.appHash) : new Uint8Array(0),
5993
+ lastResultsHash: isSet(object.lastResultsHash) ? bytesFromBase64(object.lastResultsHash) : new Uint8Array(0),
5994
+ evidenceHash: isSet(object.evidenceHash) ? bytesFromBase64(object.evidenceHash) : new Uint8Array(0),
5995
+ proposerAddress: isSet(object.proposerAddress) ? bytesFromBase64(object.proposerAddress) : new Uint8Array(0)
5722
5996
  };
5723
5997
  },
5724
5998
  toJSON(message) {
5725
5999
  const obj = {};
5726
- message.chainId !== void 0 && (obj.chainId = message.chainId);
5727
- message.height !== void 0 && (obj.height = Math.round(message.height));
5728
- message.timestamp !== void 0 && (obj.timestamp = Math.round(message.timestamp));
5729
- message.blockID !== void 0 && (obj.blockID = base64FromBytes(message.blockID !== void 0 ? message.blockID : new Uint8Array()));
5730
- message.lastCommitHash !== void 0 && (obj.lastCommitHash = base64FromBytes(
5731
- message.lastCommitHash !== void 0 ? message.lastCommitHash : new Uint8Array()
5732
- ));
5733
- message.dataHash !== void 0 && (obj.dataHash = base64FromBytes(message.dataHash !== void 0 ? message.dataHash : new Uint8Array()));
5734
- message.validatorsHash !== void 0 && (obj.validatorsHash = base64FromBytes(
5735
- message.validatorsHash !== void 0 ? message.validatorsHash : new Uint8Array()
5736
- ));
5737
- message.nextValidatorsHash !== void 0 && (obj.nextValidatorsHash = base64FromBytes(
5738
- message.nextValidatorsHash !== void 0 ? message.nextValidatorsHash : new Uint8Array()
5739
- ));
5740
- message.consensusHash !== void 0 && (obj.consensusHash = base64FromBytes(
5741
- message.consensusHash !== void 0 ? message.consensusHash : new Uint8Array()
5742
- ));
5743
- message.appHash !== void 0 && (obj.appHash = base64FromBytes(message.appHash !== void 0 ? message.appHash : new Uint8Array()));
5744
- message.lastResultsHash !== void 0 && (obj.lastResultsHash = base64FromBytes(
5745
- message.lastResultsHash !== void 0 ? message.lastResultsHash : new Uint8Array()
5746
- ));
5747
- message.evidenceHash !== void 0 && (obj.evidenceHash = base64FromBytes(
5748
- message.evidenceHash !== void 0 ? message.evidenceHash : new Uint8Array()
5749
- ));
5750
- message.proposerAddress !== void 0 && (obj.proposerAddress = base64FromBytes(
5751
- message.proposerAddress !== void 0 ? message.proposerAddress : new Uint8Array()
5752
- ));
6000
+ if (message.chainId !== "") {
6001
+ obj.chainId = message.chainId;
6002
+ }
6003
+ if (message.height !== 0) {
6004
+ obj.height = Math.round(message.height);
6005
+ }
6006
+ if (message.timestamp !== 0) {
6007
+ obj.timestamp = Math.round(message.timestamp);
6008
+ }
6009
+ if (message.blockID.length !== 0) {
6010
+ obj.blockID = base64FromBytes(message.blockID);
6011
+ }
6012
+ if (message.lastCommitHash.length !== 0) {
6013
+ obj.lastCommitHash = base64FromBytes(message.lastCommitHash);
6014
+ }
6015
+ if (message.dataHash.length !== 0) {
6016
+ obj.dataHash = base64FromBytes(message.dataHash);
6017
+ }
6018
+ if (message.validatorsHash.length !== 0) {
6019
+ obj.validatorsHash = base64FromBytes(message.validatorsHash);
6020
+ }
6021
+ if (message.nextValidatorsHash.length !== 0) {
6022
+ obj.nextValidatorsHash = base64FromBytes(message.nextValidatorsHash);
6023
+ }
6024
+ if (message.consensusHash.length !== 0) {
6025
+ obj.consensusHash = base64FromBytes(message.consensusHash);
6026
+ }
6027
+ if (message.appHash.length !== 0) {
6028
+ obj.appHash = base64FromBytes(message.appHash);
6029
+ }
6030
+ if (message.lastResultsHash.length !== 0) {
6031
+ obj.lastResultsHash = base64FromBytes(message.lastResultsHash);
6032
+ }
6033
+ if (message.evidenceHash.length !== 0) {
6034
+ obj.evidenceHash = base64FromBytes(message.evidenceHash);
6035
+ }
6036
+ if (message.proposerAddress.length !== 0) {
6037
+ obj.proposerAddress = base64FromBytes(message.proposerAddress);
6038
+ }
5753
6039
  return obj;
5754
6040
  },
5755
6041
  create(base) {
@@ -5760,16 +6046,16 @@ var TendermintHeader = {
5760
6046
  message.chainId = object.chainId ?? "";
5761
6047
  message.height = object.height ?? 0;
5762
6048
  message.timestamp = object.timestamp ?? 0;
5763
- message.blockID = object.blockID ?? new Uint8Array();
5764
- message.lastCommitHash = object.lastCommitHash ?? new Uint8Array();
5765
- message.dataHash = object.dataHash ?? new Uint8Array();
5766
- message.validatorsHash = object.validatorsHash ?? new Uint8Array();
5767
- message.nextValidatorsHash = object.nextValidatorsHash ?? new Uint8Array();
5768
- message.consensusHash = object.consensusHash ?? new Uint8Array();
5769
- message.appHash = object.appHash ?? new Uint8Array();
5770
- message.lastResultsHash = object.lastResultsHash ?? new Uint8Array();
5771
- message.evidenceHash = object.evidenceHash ?? new Uint8Array();
5772
- message.proposerAddress = object.proposerAddress ?? new Uint8Array();
6049
+ message.blockID = object.blockID ?? new Uint8Array(0);
6050
+ message.lastCommitHash = object.lastCommitHash ?? new Uint8Array(0);
6051
+ message.dataHash = object.dataHash ?? new Uint8Array(0);
6052
+ message.validatorsHash = object.validatorsHash ?? new Uint8Array(0);
6053
+ message.nextValidatorsHash = object.nextValidatorsHash ?? new Uint8Array(0);
6054
+ message.consensusHash = object.consensusHash ?? new Uint8Array(0);
6055
+ message.appHash = object.appHash ?? new Uint8Array(0);
6056
+ message.lastResultsHash = object.lastResultsHash ?? new Uint8Array(0);
6057
+ message.evidenceHash = object.evidenceHash ?? new Uint8Array(0);
6058
+ message.proposerAddress = object.proposerAddress ?? new Uint8Array(0);
5773
6059
  return message;
5774
6060
  }
5775
6061
  };
@@ -5803,37 +6089,37 @@ var ProcessResult = {
5803
6089
  const tag = reader.uint32();
5804
6090
  switch (tag >>> 3) {
5805
6091
  case 1:
5806
- if (tag != 10) {
6092
+ if (tag !== 10) {
5807
6093
  break;
5808
6094
  }
5809
6095
  message.votes.push(QuestionResult.decode(reader, reader.uint32()));
5810
6096
  continue;
5811
6097
  case 2:
5812
- if (tag != 18) {
6098
+ if (tag !== 18) {
5813
6099
  break;
5814
6100
  }
5815
6101
  message.processId = reader.bytes();
5816
6102
  continue;
5817
6103
  case 3:
5818
- if (tag != 26) {
6104
+ if (tag !== 26) {
5819
6105
  break;
5820
6106
  }
5821
6107
  message.entityId = reader.bytes();
5822
6108
  continue;
5823
6109
  case 4:
5824
- if (tag != 34) {
6110
+ if (tag !== 34) {
5825
6111
  break;
5826
6112
  }
5827
6113
  message.oracleAddress = reader.bytes();
5828
6114
  continue;
5829
6115
  case 5:
5830
- if (tag != 42) {
6116
+ if (tag !== 42) {
5831
6117
  break;
5832
6118
  }
5833
6119
  message.signature = reader.bytes();
5834
6120
  continue;
5835
6121
  }
5836
- if ((tag & 7) == 4 || tag == 0) {
6122
+ if ((tag & 7) === 4 || tag === 0) {
5837
6123
  break;
5838
6124
  }
5839
6125
  reader.skipType(tag & 7);
@@ -5851,15 +6137,21 @@ var ProcessResult = {
5851
6137
  },
5852
6138
  toJSON(message) {
5853
6139
  const obj = {};
5854
- if (message.votes) {
5855
- obj.votes = message.votes.map((e) => e ? QuestionResult.toJSON(e) : void 0);
5856
- } else {
5857
- obj.votes = [];
5858
- }
5859
- message.processId !== void 0 && (obj.processId = message.processId !== void 0 ? base64FromBytes(message.processId) : void 0);
5860
- message.entityId !== void 0 && (obj.entityId = message.entityId !== void 0 ? base64FromBytes(message.entityId) : void 0);
5861
- message.oracleAddress !== void 0 && (obj.oracleAddress = message.oracleAddress !== void 0 ? base64FromBytes(message.oracleAddress) : void 0);
5862
- message.signature !== void 0 && (obj.signature = message.signature !== void 0 ? base64FromBytes(message.signature) : void 0);
6140
+ if (message.votes?.length) {
6141
+ obj.votes = message.votes.map((e) => QuestionResult.toJSON(e));
6142
+ }
6143
+ if (message.processId !== void 0) {
6144
+ obj.processId = base64FromBytes(message.processId);
6145
+ }
6146
+ if (message.entityId !== void 0) {
6147
+ obj.entityId = base64FromBytes(message.entityId);
6148
+ }
6149
+ if (message.oracleAddress !== void 0) {
6150
+ obj.oracleAddress = base64FromBytes(message.oracleAddress);
6151
+ }
6152
+ if (message.signature !== void 0) {
6153
+ obj.signature = base64FromBytes(message.signature);
6154
+ }
5863
6155
  return obj;
5864
6156
  },
5865
6157
  create(base) {
@@ -5893,13 +6185,13 @@ var QuestionResult = {
5893
6185
  const tag = reader.uint32();
5894
6186
  switch (tag >>> 3) {
5895
6187
  case 1:
5896
- if (tag != 10) {
6188
+ if (tag !== 10) {
5897
6189
  break;
5898
6190
  }
5899
6191
  message.question.push(reader.bytes());
5900
6192
  continue;
5901
6193
  }
5902
- if ((tag & 7) == 4 || tag == 0) {
6194
+ if ((tag & 7) === 4 || tag === 0) {
5903
6195
  break;
5904
6196
  }
5905
6197
  reader.skipType(tag & 7);
@@ -5911,10 +6203,8 @@ var QuestionResult = {
5911
6203
  },
5912
6204
  toJSON(message) {
5913
6205
  const obj = {};
5914
- if (message.question) {
5915
- obj.question = message.question.map((e) => base64FromBytes(e !== void 0 ? e : new Uint8Array()));
5916
- } else {
5917
- obj.question = [];
6206
+ if (message.question?.length) {
6207
+ obj.question = message.question.map((e) => base64FromBytes(e));
5918
6208
  }
5919
6209
  return obj;
5920
6210
  },
@@ -5945,13 +6235,13 @@ var ProcessEndingList = {
5945
6235
  const tag = reader.uint32();
5946
6236
  switch (tag >>> 3) {
5947
6237
  case 1:
5948
- if (tag != 10) {
6238
+ if (tag !== 10) {
5949
6239
  break;
5950
6240
  }
5951
6241
  message.processList.push(reader.bytes());
5952
6242
  continue;
5953
6243
  }
5954
- if ((tag & 7) == 4 || tag == 0) {
6244
+ if ((tag & 7) === 4 || tag === 0) {
5955
6245
  break;
5956
6246
  }
5957
6247
  reader.skipType(tag & 7);
@@ -5965,10 +6255,8 @@ var ProcessEndingList = {
5965
6255
  },
5966
6256
  toJSON(message) {
5967
6257
  const obj = {};
5968
- if (message.processList) {
5969
- obj.processList = message.processList.map((e) => base64FromBytes(e !== void 0 ? e : new Uint8Array()));
5970
- } else {
5971
- obj.processList = [];
6258
+ if (message.processList?.length) {
6259
+ obj.processList = message.processList.map((e) => base64FromBytes(e));
5972
6260
  }
5973
6261
  return obj;
5974
6262
  },
@@ -5999,13 +6287,13 @@ var StoredKeys = {
5999
6287
  const tag = reader.uint32();
6000
6288
  switch (tag >>> 3) {
6001
6289
  case 1:
6002
- if (tag != 10) {
6290
+ if (tag !== 10) {
6003
6291
  break;
6004
6292
  }
6005
6293
  message.pids.push(reader.bytes());
6006
6294
  continue;
6007
6295
  }
6008
- if ((tag & 7) == 4 || tag == 0) {
6296
+ if ((tag & 7) === 4 || tag === 0) {
6009
6297
  break;
6010
6298
  }
6011
6299
  reader.skipType(tag & 7);
@@ -6017,10 +6305,8 @@ var StoredKeys = {
6017
6305
  },
6018
6306
  toJSON(message) {
6019
6307
  const obj = {};
6020
- if (message.pids) {
6021
- obj.pids = message.pids.map((e) => base64FromBytes(e !== void 0 ? e : new Uint8Array()));
6022
- } else {
6023
- obj.pids = [];
6308
+ if (message.pids?.length) {
6309
+ obj.pids = message.pids.map((e) => base64FromBytes(e));
6024
6310
  }
6025
6311
  return obj;
6026
6312
  },