trac-msb 0.2.24 → 0.3.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (137) hide show
  1. package/SECURITY.md +2 -2
  2. package/cli/commandHandler.js +317 -20
  3. package/cli/handlers.js +9 -1
  4. package/cli/interactive.js +4 -3
  5. package/cli/tokenSupplyAudit.js +90 -0
  6. package/msb.mjs +1 -0
  7. package/package.json +15 -6
  8. package/rpc/create_server.js +12 -3
  9. package/rpc/handlers.js +103 -0
  10. package/rpc/routes/v1.js +8 -0
  11. package/src/codecs/apply/applyOperationCodec.js +334 -0
  12. package/src/codecs/apply/applyOperations.generated.cjs +6380 -0
  13. package/src/codecs/consensus/v1/consensusV1.generated.cjs +3508 -0
  14. package/src/codecs/consensus/v1/consensusV1OperationCodec.js +161 -0
  15. package/src/codecs/consensus/v1/vdfConfigCodec.js +83 -0
  16. package/src/{utils/protobuf → codecs/network/v1}/networkV1.generated.cjs +664 -393
  17. package/src/codecs/network/v1/networkV1OperationCodec.js +25 -0
  18. package/src/codecs/protobufRuntime.cjs +95 -0
  19. package/src/codecs/state/escrowEntryCodec.js +45 -0
  20. package/src/codecs/state/state.generated.cjs +659 -0
  21. package/src/config/args.js +0 -1
  22. package/src/config/config.js +46 -7
  23. package/src/config/env.js +33 -6
  24. package/src/core/consensus/epochAppenderSelection/EpochAppenderSelectionError.js +55 -0
  25. package/src/core/consensus/epochAppenderSelection/EpochAppenderSelectionOperations.js +118 -0
  26. package/src/core/consensus/epochAppenderSelection/EpochAppenderSelector.js +1042 -0
  27. package/src/core/consensus/epochAppenderSelection/createEpochAppenderSelector.js +23 -0
  28. package/src/core/consensus/epochAppenderSelection/epochAppenderSelectionLedgerReader.js +274 -0
  29. package/src/core/consensus/epochAppenderSelection/epochAppenderSelectionState.js +488 -0
  30. package/src/core/consensus/epochAppenderSelection/epochAppenderSelectionStorage.js +93 -0
  31. package/src/core/consensus/quorum.js +11 -0
  32. package/src/core/consensus/services/EpochCoordinationRound.js +839 -0
  33. package/src/core/consensus/services/EpochCoordinatorOperations.js +211 -0
  34. package/src/core/consensus/services/EpochCoordinatorService.js +335 -0
  35. package/src/core/consensus/services/EpochRoundListeners.js +116 -0
  36. package/src/core/consensus/services/EpochStateMachine.js +141 -0
  37. package/src/core/consensus/services/VDFBare.js +291 -0
  38. package/src/core/consensus/services/VDFNode.js +111 -0
  39. package/src/core/consensus/services/VDFProgressWatchdog.js +79 -0
  40. package/src/core/consensus/services/VDFService.js +87 -0
  41. package/src/core/consensus/services/VDFServiceManager.js +147 -0
  42. package/src/core/consensus/services/createVDFService.js +16 -0
  43. package/src/core/consensus/services/vdf-guardian.js +32 -0
  44. package/src/core/consensus/services/vdf-worker.js +90 -0
  45. package/src/core/network/Network.js +327 -238
  46. package/src/core/network/protocols/consensus/IndexerMessages.js +72 -0
  47. package/src/core/network/protocols/consensus/v1/ConsensusV1ConnectionPolicy.js +57 -0
  48. package/src/core/network/protocols/consensus/v1/ConsensusV1MessageRouter.js +147 -0
  49. package/src/core/network/protocols/consensus/v1/ConsensusV1Protocol.js +72 -0
  50. package/src/core/network/protocols/consensus/v1/IndexerPendingRequestService.js +108 -0
  51. package/src/core/network/protocols/consensus/v1/V1ConsensusProtocolError.js +29 -0
  52. package/src/core/network/protocols/consensus/v1/handlers/V1EpochAppendOperationHandler.js +68 -0
  53. package/src/core/network/protocols/consensus/v1/handlers/V1EpochProofProposalOperationHandler.js +226 -0
  54. package/src/core/network/protocols/consensus/v1/validators/ConsensusValidationSchema.js +192 -0
  55. package/src/core/network/protocols/consensus/v1/validators/V1BaseConsensusOperation.js +428 -0
  56. package/src/core/network/protocols/consensus/v1/validators/V1EpochAppendReply.js +47 -0
  57. package/src/core/network/protocols/consensus/v1/validators/V1EpochAppendRequest.js +17 -0
  58. package/src/core/network/protocols/consensus/v1/validators/V1EpochProofProposalApproval.js +116 -0
  59. package/src/core/network/protocols/consensus/v1/validators/V1EpochProofProposalRequest.js +152 -0
  60. package/src/core/network/protocols/consensus/v1/validators/consensusValidationSchemaHelpers.js +145 -0
  61. package/src/core/network/protocols/shared/ConnectionOperationHandler.js +27 -0
  62. package/src/core/network/protocols/{NetworkMessages.js → validators/ValidatorMessages.js} +24 -14
  63. package/src/core/network/protocols/{ProtocolSession.js → validators/ValidatorProtocolSession.js} +22 -25
  64. package/src/core/network/protocols/{legacy/NetworkMessageRouter.js → validators/legacy/ValidatorLegacyMessageRouter.js} +6 -6
  65. package/src/core/network/protocols/{LegacyProtocol.js → validators/legacy/ValidatorLegacyProtocol.js} +9 -7
  66. package/src/core/network/protocols/{legacy → validators/legacy}/handlers/BaseStateOperationHandler.js +1 -1
  67. package/src/core/network/protocols/{legacy → validators/legacy}/handlers/LegacyGetRequestHandler.js +5 -5
  68. package/src/core/network/protocols/{legacy → validators/legacy}/handlers/LegacyRoleOperationHandler.js +5 -5
  69. package/src/core/network/protocols/{legacy → validators/legacy}/handlers/LegacySubnetworkOperationHandler.js +5 -5
  70. package/src/core/network/protocols/{legacy → validators/legacy}/handlers/LegacyTransferOperationHandler.js +5 -5
  71. package/src/core/network/protocols/{ProtocolInterface.js → validators/shared/ValidatorProtocolInterface.js} +5 -5
  72. package/src/core/network/protocols/{shared → validators/shared}/validators/PartialBootstrapDeploymentValidator.js +1 -1
  73. package/src/core/network/protocols/validators/shared/validators/PartialHtlcValidator.js +325 -0
  74. package/src/core/network/protocols/{shared → validators/shared}/validators/PartialOperationValidator.js +44 -21
  75. package/src/core/network/protocols/{shared → validators/shared}/validators/PartialRoleAccessValidator.js +3 -3
  76. package/src/core/network/protocols/{shared → validators/shared}/validators/PartialTransactionValidator.js +3 -3
  77. package/src/core/network/protocols/{shared → validators/shared}/validators/PartialTransferValidator.js +4 -4
  78. package/src/core/network/protocols/{v1 → validators/v1}/V1ProtocolError.js +1 -1
  79. package/src/core/network/{services/PendingRequestService.js → protocols/validators/v1/ValidatorPendingRequestService.js} +19 -82
  80. package/src/core/network/protocols/{v1/NetworkMessageRouter.js → validators/v1/ValidatorV1MessageRouter.js} +9 -9
  81. package/src/core/network/protocols/{V1Protocol.js → validators/v1/ValidatorV1Protocol.js} +10 -8
  82. package/src/core/network/protocols/{connectionPolicies.js → validators/v1/connectionPolicies.js} +1 -1
  83. package/src/core/network/protocols/{v1 → validators/v1}/handlers/V1BaseOperationHandler.js +6 -23
  84. package/src/core/network/protocols/{v1 → validators/v1}/handlers/V1BroadcastTransactionOperationHandler.js +14 -9
  85. package/src/core/network/protocols/{v1 → validators/v1}/handlers/V1LivenessOperationHandler.js +5 -4
  86. package/src/core/network/protocols/{v1 → validators/v1}/handlers/broadcastTransaction/BroadcastTransactionErrorMapper.js +3 -3
  87. package/src/core/network/protocols/{v1 → validators/v1}/handlers/broadcastTransaction/BroadcastTransactionOperationStrategies.js +44 -1
  88. package/src/core/network/protocols/{v1 → validators/v1}/handlers/broadcastTransaction/BroadcastTransactionPayloadUtils.js +1 -1
  89. package/src/core/network/protocols/{v1 → validators/v1}/validators/V1BaseOperation.js +19 -15
  90. package/src/core/network/protocols/{v1 → validators/v1}/validators/V1BroadcastTransactionRequest.js +2 -2
  91. package/src/core/network/protocols/{v1 → validators/v1}/validators/V1BroadcastTransactionResponse.js +34 -18
  92. package/src/core/network/protocols/{v1 → validators/v1}/validators/V1ValidationSchema.js +3 -3
  93. package/src/core/network/services/IndexerConnectionManager.js +88 -0
  94. package/src/core/network/services/TransactionPoolService.js +11 -18
  95. package/src/core/network/services/TransactionRateLimiterService.js +1 -1
  96. package/src/core/network/services/ValidatorConnectionManager.js +163 -0
  97. package/src/core/network/services/{MessageOrchestrator.js → ValidatorMessageOrchestrator.js} +34 -42
  98. package/src/core/network/services/ValidatorObserverService.js +21 -36
  99. package/src/core/network/shared/BasePendingRequestService.js +67 -0
  100. package/src/core/network/shared/PeerConnectionManager.js +185 -0
  101. package/src/core/state/ConfirmationWatch.js +82 -0
  102. package/src/core/state/State.js +1794 -173
  103. package/src/core/state/StateEventQueue.js +69 -0
  104. package/src/core/state/utils/address.js +10 -6
  105. package/src/core/state/utils/epochProof.js +109 -0
  106. package/src/core/state/utils/escrowEntry.js +178 -0
  107. package/src/core/state/validators/StateValidationSchema.js +757 -0
  108. package/src/core/state/validators/stateValidationRules.js +312 -0
  109. package/src/index.js +255 -65
  110. package/src/messages/consensus/v1/ConsensusMessageBuilder.js +368 -0
  111. package/src/messages/consensus/v1/ConsensusMessageDirector.js +142 -0
  112. package/src/messages/consensus/v1/consensusMessageFactory.js +12 -0
  113. package/src/messages/consensus/v1/epochAppendMessage.js +58 -0
  114. package/src/messages/network/v1/NetworkMessageBuilder.js +15 -7
  115. package/src/messages/state/ApplyStateMessageBuilder.js +499 -13
  116. package/src/messages/state/ApplyStateMessageDirector.js +261 -2
  117. package/src/utils/StateMachine.js +125 -0
  118. package/src/utils/applyOperations.js +45 -2
  119. package/src/utils/buffer.js +239 -59
  120. package/src/utils/consensusConfig.js +76 -0
  121. package/src/utils/constants.js +174 -73
  122. package/src/utils/helpers.js +0 -25
  123. package/src/utils/htlcLock.js +122 -0
  124. package/src/utils/logger.js +10 -4
  125. package/src/utils/migrationUtils.js +2 -1
  126. package/src/utils/normalizers.js +113 -0
  127. package/src/utils/scheduler/SchedulableService.js +107 -0
  128. package/src/utils/{Scheduler.js → scheduler/Scheduler.js} +56 -17
  129. package/src/core/network/services/ConnectionManager.js +0 -406
  130. package/src/utils/check.js +0 -525
  131. package/src/utils/protobuf/applyOperations.cjs +0 -1373
  132. package/src/utils/protobuf/operationHelpers.js +0 -81
  133. /package/src/core/network/protocols/{legacy → validators/legacy}/handlers/LegacyResponseHandler.js +0 -0
  134. /package/src/core/network/protocols/{legacy → validators/legacy}/validators/ValidatorResponse.js +0 -0
  135. /package/src/core/network/protocols/{legacy → validators/legacy}/validators/base/BaseResponse.js +0 -0
  136. /package/src/core/network/protocols/{v1 → validators/v1}/validators/V1LivenessRequest.js +0 -0
  137. /package/src/core/network/protocols/{v1 → validators/v1}/validators/V1LivenessResponse.js +0 -0
@@ -1,17 +1,15 @@
1
1
  /*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
2
2
  "use strict";
3
- if (typeof globalThis !== 'undefined' && typeof globalThis.self === 'undefined') {
4
- globalThis.self = globalThis;
5
- }
6
3
 
4
+ /** @typedef {ReturnType<typeof import("b4a").alloc>} B4aBuffer */
7
5
 
8
- var $protobuf = require("protobufjs/minimal");
6
+ var $protobuf = require("../../protobufRuntime.cjs");
9
7
 
10
8
  // Common aliases
11
9
  var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;
12
10
 
13
11
  // Exported root namespace
14
- var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
12
+ var $root = $protobuf.roots["networkV1"] || ($protobuf.roots["networkV1"] = {});
15
13
 
16
14
  $root.network = (function() {
17
15
 
@@ -59,7 +57,7 @@ $root.network = (function() {
59
57
  this.capabilities = [];
60
58
  if (properties)
61
59
  for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
62
- if (properties[keys[i]] != null)
60
+ if (properties[keys[i]] != null && keys[i] !== "__proto__")
63
61
  this[keys[i]] = properties[keys[i]];
64
62
  }
65
63
 
@@ -162,9 +160,12 @@ $root.network = (function() {
162
160
  * @param {$protobuf.Writer} [writer] Writer to encode to
163
161
  * @returns {$protobuf.Writer} Writer
164
162
  */
165
- MessageHeader.encode = function encode(message, writer) {
166
- if (!writer)
167
- writer = $Writer.create();
163
+ MessageHeader.encode = function encode(message, writer, q) {
164
+ writer = $Writer.create(writer);
165
+ if (q === undefined)
166
+ q = 0;
167
+ if (q > $util.recursionLimit)
168
+ throw Error("max depth exceeded");
168
169
  if (message.type != null && Object.hasOwnProperty.call(message, "type"))
169
170
  writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type);
170
171
  if (message.id != null && Object.hasOwnProperty.call(message, "id"))
@@ -172,13 +173,13 @@ $root.network = (function() {
172
173
  if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp"))
173
174
  writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.timestamp);
174
175
  if (message.liveness_request != null && Object.hasOwnProperty.call(message, "liveness_request"))
175
- $root.network.v1.LivenessRequest.encode(message.liveness_request, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
176
+ $root.network.v1.LivenessRequest.encode(message.liveness_request, writer.uint32(/* id 4, wireType 2 =*/34).fork(), q + 1).ldelim();
176
177
  if (message.liveness_response != null && Object.hasOwnProperty.call(message, "liveness_response"))
177
- $root.network.v1.LivenessResponse.encode(message.liveness_response, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
178
+ $root.network.v1.LivenessResponse.encode(message.liveness_response, writer.uint32(/* id 5, wireType 2 =*/42).fork(), q + 1).ldelim();
178
179
  if (message.broadcast_transaction_request != null && Object.hasOwnProperty.call(message, "broadcast_transaction_request"))
179
- $root.network.v1.BroadcastTransactionRequest.encode(message.broadcast_transaction_request, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
180
+ $root.network.v1.BroadcastTransactionRequest.encode(message.broadcast_transaction_request, writer.uint32(/* id 6, wireType 2 =*/50).fork(), q + 1).ldelim();
180
181
  if (message.broadcast_transaction_response != null && Object.hasOwnProperty.call(message, "broadcast_transaction_response"))
181
- $root.network.v1.BroadcastTransactionResponse.encode(message.broadcast_transaction_response, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
182
+ $root.network.v1.BroadcastTransactionResponse.encode(message.broadcast_transaction_response, writer.uint32(/* id 7, wireType 2 =*/58).fork(), q + 1).ldelim();
182
183
  if (message.capabilities != null && message.capabilities.length)
183
184
  for (var i = 0; i < message.capabilities.length; ++i)
184
185
  writer.uint32(/* id 8, wireType 2 =*/66).string(message.capabilities[i]);
@@ -195,7 +196,7 @@ $root.network = (function() {
195
196
  * @returns {$protobuf.Writer} Writer
196
197
  */
197
198
  MessageHeader.encodeDelimited = function encodeDelimited(message, writer) {
198
- return this.encode(message, writer).ldelim();
199
+ return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();
199
200
  };
200
201
 
201
202
  /**
@@ -203,15 +204,18 @@ $root.network = (function() {
203
204
  * @function decode
204
205
  * @memberof network.v1.MessageHeader
205
206
  * @static
206
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
207
+ * @param {$protobuf.Reader|B4aBuffer} reader Reader or buffer to decode from
207
208
  * @param {number} [length] Message length if known beforehand
208
209
  * @returns {network.v1.MessageHeader} MessageHeader
209
210
  * @throws {Error} If the payload is not a reader or valid buffer
210
211
  * @throws {$protobuf.util.ProtocolError} If required fields are missing
211
212
  */
212
- MessageHeader.decode = function decode(reader, length, error) {
213
- if (!(reader instanceof $Reader))
214
- reader = $Reader.create(reader);
213
+ MessageHeader.decode = function decode(reader, length, error, long) {
214
+ reader = $Reader.create(reader);
215
+ if (long === undefined)
216
+ long = 0;
217
+ if (long > $Reader.recursionLimit)
218
+ throw Error("maximum nesting depth exceeded");
215
219
  var end = length === undefined ? reader.len : reader.pos + length, message = new $root.network.v1.MessageHeader();
216
220
  while (reader.pos < end) {
217
221
  var tag = reader.uint32();
@@ -231,19 +235,19 @@ $root.network = (function() {
231
235
  break;
232
236
  }
233
237
  case 4: {
234
- message.liveness_request = $root.network.v1.LivenessRequest.decode(reader, reader.uint32());
238
+ message.liveness_request = $root.network.v1.LivenessRequest.decode(reader, reader.uint32(), undefined, long + 1);
235
239
  break;
236
240
  }
237
241
  case 5: {
238
- message.liveness_response = $root.network.v1.LivenessResponse.decode(reader, reader.uint32());
242
+ message.liveness_response = $root.network.v1.LivenessResponse.decode(reader, reader.uint32(), undefined, long + 1);
239
243
  break;
240
244
  }
241
245
  case 6: {
242
- message.broadcast_transaction_request = $root.network.v1.BroadcastTransactionRequest.decode(reader, reader.uint32());
246
+ message.broadcast_transaction_request = $root.network.v1.BroadcastTransactionRequest.decode(reader, reader.uint32(), undefined, long + 1);
243
247
  break;
244
248
  }
245
249
  case 7: {
246
- message.broadcast_transaction_response = $root.network.v1.BroadcastTransactionResponse.decode(reader, reader.uint32());
250
+ message.broadcast_transaction_response = $root.network.v1.BroadcastTransactionResponse.decode(reader, reader.uint32(), undefined, long + 1);
247
251
  break;
248
252
  }
249
253
  case 8: {
@@ -253,7 +257,7 @@ $root.network = (function() {
253
257
  break;
254
258
  }
255
259
  default:
256
- reader.skipType(tag & 7);
260
+ reader.skipType(tag & 7, long);
257
261
  break;
258
262
  }
259
263
  }
@@ -265,14 +269,13 @@ $root.network = (function() {
265
269
  * @function decodeDelimited
266
270
  * @memberof network.v1.MessageHeader
267
271
  * @static
268
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
272
+ * @param {$protobuf.Reader|B4aBuffer} reader Reader or buffer to decode from
269
273
  * @returns {network.v1.MessageHeader} MessageHeader
270
274
  * @throws {Error} If the payload is not a reader or valid buffer
271
275
  * @throws {$protobuf.util.ProtocolError} If required fields are missing
272
276
  */
273
277
  MessageHeader.decodeDelimited = function decodeDelimited(reader) {
274
- if (!(reader instanceof $Reader))
275
- reader = new $Reader(reader);
278
+ reader = $Reader.create(reader);
276
279
  return this.decode(reader, reader.uint32());
277
280
  };
278
281
 
@@ -284,11 +287,15 @@ $root.network = (function() {
284
287
  * @param {Object.<string,*>} message Plain object to verify
285
288
  * @returns {string|null} `null` if valid, otherwise the reason why it is not
286
289
  */
287
- MessageHeader.verify = function verify(message) {
290
+ MessageHeader.verify = function verify(message, long) {
288
291
  if (typeof message !== "object" || message === null)
289
292
  return "object expected";
293
+ if (long === undefined)
294
+ long = 0;
295
+ if (long > $util.recursionLimit)
296
+ return "maximum nesting depth exceeded";
290
297
  var properties = {};
291
- if (message.type != null && message.hasOwnProperty("type"))
298
+ if (message.type != null && Object.hasOwnProperty.call(message, "type"))
292
299
  switch (message.type) {
293
300
  default:
294
301
  return "type: enum value expected";
@@ -299,51 +306,51 @@ $root.network = (function() {
299
306
  case 4:
300
307
  break;
301
308
  }
302
- if (message.id != null && message.hasOwnProperty("id"))
309
+ if (message.id != null && Object.hasOwnProperty.call(message, "id"))
303
310
  if (!$util.isString(message.id))
304
311
  return "id: string expected";
305
- if (message.timestamp != null && message.hasOwnProperty("timestamp"))
312
+ if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp"))
306
313
  if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high)))
307
314
  return "timestamp: integer|Long expected";
308
- if (message.liveness_request != null && message.hasOwnProperty("liveness_request")) {
315
+ if (message.liveness_request != null && Object.hasOwnProperty.call(message, "liveness_request")) {
309
316
  properties.field = 1;
310
317
  {
311
- var error = $root.network.v1.LivenessRequest.verify(message.liveness_request);
318
+ var error = $root.network.v1.LivenessRequest.verify(message.liveness_request, long + 1);
312
319
  if (error)
313
320
  return "liveness_request." + error;
314
321
  }
315
322
  }
316
- if (message.liveness_response != null && message.hasOwnProperty("liveness_response")) {
323
+ if (message.liveness_response != null && Object.hasOwnProperty.call(message, "liveness_response")) {
317
324
  if (properties.field === 1)
318
325
  return "field: multiple values";
319
326
  properties.field = 1;
320
327
  {
321
- var error = $root.network.v1.LivenessResponse.verify(message.liveness_response);
328
+ var error = $root.network.v1.LivenessResponse.verify(message.liveness_response, long + 1);
322
329
  if (error)
323
330
  return "liveness_response." + error;
324
331
  }
325
332
  }
326
- if (message.broadcast_transaction_request != null && message.hasOwnProperty("broadcast_transaction_request")) {
333
+ if (message.broadcast_transaction_request != null && Object.hasOwnProperty.call(message, "broadcast_transaction_request")) {
327
334
  if (properties.field === 1)
328
335
  return "field: multiple values";
329
336
  properties.field = 1;
330
337
  {
331
- var error = $root.network.v1.BroadcastTransactionRequest.verify(message.broadcast_transaction_request);
338
+ var error = $root.network.v1.BroadcastTransactionRequest.verify(message.broadcast_transaction_request, long + 1);
332
339
  if (error)
333
340
  return "broadcast_transaction_request." + error;
334
341
  }
335
342
  }
336
- if (message.broadcast_transaction_response != null && message.hasOwnProperty("broadcast_transaction_response")) {
343
+ if (message.broadcast_transaction_response != null && Object.hasOwnProperty.call(message, "broadcast_transaction_response")) {
337
344
  if (properties.field === 1)
338
345
  return "field: multiple values";
339
346
  properties.field = 1;
340
347
  {
341
- var error = $root.network.v1.BroadcastTransactionResponse.verify(message.broadcast_transaction_response);
348
+ var error = $root.network.v1.BroadcastTransactionResponse.verify(message.broadcast_transaction_response, long + 1);
342
349
  if (error)
343
350
  return "broadcast_transaction_response." + error;
344
351
  }
345
352
  }
346
- if (message.capabilities != null && message.hasOwnProperty("capabilities")) {
353
+ if (message.capabilities != null && Object.hasOwnProperty.call(message, "capabilities")) {
347
354
  if (!Array.isArray(message.capabilities))
348
355
  return "capabilities: array expected";
349
356
  for (var i = 0; i < message.capabilities.length; ++i)
@@ -361,9 +368,15 @@ $root.network = (function() {
361
368
  * @param {Object.<string,*>} object Plain object
362
369
  * @returns {network.v1.MessageHeader} MessageHeader
363
370
  */
364
- MessageHeader.fromObject = function fromObject(object) {
371
+ MessageHeader.fromObject = function fromObject(object, long) {
365
372
  if (object instanceof $root.network.v1.MessageHeader)
366
- return object;
373
+ object = Object.assign({}, object);
374
+ if (!$util.isObject(object))
375
+ throw TypeError(".network.v1.MessageHeader: object expected");
376
+ if (long === undefined)
377
+ long = 0;
378
+ if (long > $util.recursionLimit)
379
+ throw Error("maximum nesting depth exceeded");
367
380
  var message = new $root.network.v1.MessageHeader();
368
381
  switch (object.type) {
369
382
  default:
@@ -397,7 +410,7 @@ $root.network = (function() {
397
410
  message.id = String(object.id);
398
411
  if (object.timestamp != null)
399
412
  if ($util.Long)
400
- (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true;
413
+ message.timestamp = $util.Long.fromValue(object.timestamp, true);
401
414
  else if (typeof object.timestamp === "string")
402
415
  message.timestamp = parseInt(object.timestamp, 10);
403
416
  else if (typeof object.timestamp === "number")
@@ -405,24 +418,24 @@ $root.network = (function() {
405
418
  else if (typeof object.timestamp === "object")
406
419
  message.timestamp = new $util.LongBits(object.timestamp.low >>> 0, object.timestamp.high >>> 0).toNumber(true);
407
420
  if (object.liveness_request != null) {
408
- if (typeof object.liveness_request !== "object")
421
+ if (!$util.isObject(object.liveness_request))
409
422
  throw TypeError(".network.v1.MessageHeader.liveness_request: object expected");
410
- message.liveness_request = $root.network.v1.LivenessRequest.fromObject(object.liveness_request);
423
+ message.liveness_request = $root.network.v1.LivenessRequest.fromObject(object.liveness_request, long + 1);
411
424
  }
412
425
  if (object.liveness_response != null) {
413
- if (typeof object.liveness_response !== "object")
426
+ if (!$util.isObject(object.liveness_response))
414
427
  throw TypeError(".network.v1.MessageHeader.liveness_response: object expected");
415
- message.liveness_response = $root.network.v1.LivenessResponse.fromObject(object.liveness_response);
428
+ message.liveness_response = $root.network.v1.LivenessResponse.fromObject(object.liveness_response, long + 1);
416
429
  }
417
430
  if (object.broadcast_transaction_request != null) {
418
- if (typeof object.broadcast_transaction_request !== "object")
431
+ if (!$util.isObject(object.broadcast_transaction_request))
419
432
  throw TypeError(".network.v1.MessageHeader.broadcast_transaction_request: object expected");
420
- message.broadcast_transaction_request = $root.network.v1.BroadcastTransactionRequest.fromObject(object.broadcast_transaction_request);
433
+ message.broadcast_transaction_request = $root.network.v1.BroadcastTransactionRequest.fromObject(object.broadcast_transaction_request, long + 1);
421
434
  }
422
435
  if (object.broadcast_transaction_response != null) {
423
- if (typeof object.broadcast_transaction_response !== "object")
436
+ if (!$util.isObject(object.broadcast_transaction_response))
424
437
  throw TypeError(".network.v1.MessageHeader.broadcast_transaction_response: object expected");
425
- message.broadcast_transaction_response = $root.network.v1.BroadcastTransactionResponse.fromObject(object.broadcast_transaction_response);
438
+ message.broadcast_transaction_response = $root.network.v1.BroadcastTransactionResponse.fromObject(object.broadcast_transaction_response, long + 1);
426
439
  }
427
440
  if (object.capabilities) {
428
441
  if (!Array.isArray(object.capabilities))
@@ -443,9 +456,13 @@ $root.network = (function() {
443
456
  * @param {$protobuf.IConversionOptions} [options] Conversion options
444
457
  * @returns {Object.<string,*>} Plain object
445
458
  */
446
- MessageHeader.toObject = function toObject(message, options) {
459
+ MessageHeader.toObject = function toObject(message, options, q) {
447
460
  if (!options)
448
461
  options = {};
462
+ if (q === undefined)
463
+ q = 0;
464
+ if (q > $util.recursionLimit)
465
+ throw Error("max depth exceeded");
449
466
  var object = {};
450
467
  if (options.arrays || options.defaults)
451
468
  object.capabilities = [];
@@ -454,36 +471,38 @@ $root.network = (function() {
454
471
  object.id = "";
455
472
  if ($util.Long) {
456
473
  var long = new $util.Long(0, 0, true);
457
- object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
474
+ object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long;
458
475
  } else
459
- object.timestamp = options.longs === String ? "0" : 0;
476
+ object.timestamp = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0;
460
477
  }
461
- if (message.type != null && message.hasOwnProperty("type"))
478
+ if (message.type != null && Object.hasOwnProperty.call(message, "type"))
462
479
  object.type = options.enums === String ? $root.network.v1.MessageType[message.type] === undefined ? message.type : $root.network.v1.MessageType[message.type] : message.type;
463
- if (message.id != null && message.hasOwnProperty("id"))
480
+ if (message.id != null && Object.hasOwnProperty.call(message, "id"))
464
481
  object.id = message.id;
465
- if (message.timestamp != null && message.hasOwnProperty("timestamp"))
466
- if (typeof message.timestamp === "number")
482
+ if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp"))
483
+ if (typeof BigInt !== "undefined" && options.longs === BigInt)
484
+ object.timestamp = typeof message.timestamp === "number" ? BigInt(message.timestamp) : $util.Long.fromBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0, true).toBigInt();
485
+ else if (typeof message.timestamp === "number")
467
486
  object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp;
468
487
  else
469
488
  object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp;
470
- if (message.liveness_request != null && message.hasOwnProperty("liveness_request")) {
471
- object.liveness_request = $root.network.v1.LivenessRequest.toObject(message.liveness_request, options);
489
+ if (message.liveness_request != null && Object.hasOwnProperty.call(message, "liveness_request")) {
490
+ object.liveness_request = $root.network.v1.LivenessRequest.toObject(message.liveness_request, options, q + 1);
472
491
  if (options.oneofs)
473
492
  object.field = "liveness_request";
474
493
  }
475
- if (message.liveness_response != null && message.hasOwnProperty("liveness_response")) {
476
- object.liveness_response = $root.network.v1.LivenessResponse.toObject(message.liveness_response, options);
494
+ if (message.liveness_response != null && Object.hasOwnProperty.call(message, "liveness_response")) {
495
+ object.liveness_response = $root.network.v1.LivenessResponse.toObject(message.liveness_response, options, q + 1);
477
496
  if (options.oneofs)
478
497
  object.field = "liveness_response";
479
498
  }
480
- if (message.broadcast_transaction_request != null && message.hasOwnProperty("broadcast_transaction_request")) {
481
- object.broadcast_transaction_request = $root.network.v1.BroadcastTransactionRequest.toObject(message.broadcast_transaction_request, options);
499
+ if (message.broadcast_transaction_request != null && Object.hasOwnProperty.call(message, "broadcast_transaction_request")) {
500
+ object.broadcast_transaction_request = $root.network.v1.BroadcastTransactionRequest.toObject(message.broadcast_transaction_request, options, q + 1);
482
501
  if (options.oneofs)
483
502
  object.field = "broadcast_transaction_request";
484
503
  }
485
- if (message.broadcast_transaction_response != null && message.hasOwnProperty("broadcast_transaction_response")) {
486
- object.broadcast_transaction_response = $root.network.v1.BroadcastTransactionResponse.toObject(message.broadcast_transaction_response, options);
504
+ if (message.broadcast_transaction_response != null && Object.hasOwnProperty.call(message, "broadcast_transaction_response")) {
505
+ object.broadcast_transaction_response = $root.network.v1.BroadcastTransactionResponse.toObject(message.broadcast_transaction_response, options, q + 1);
487
506
  if (options.oneofs)
488
507
  object.field = "broadcast_transaction_response";
489
508
  }
@@ -550,8 +569,8 @@ $root.network = (function() {
550
569
  * Properties of a LivenessRequest.
551
570
  * @memberof network.v1
552
571
  * @interface ILivenessRequest
553
- * @property {Uint8Array|null} [nonce] LivenessRequest nonce
554
- * @property {Uint8Array|null} [signature] LivenessRequest signature
572
+ * @property {B4aBuffer|null} [nonce] LivenessRequest nonce
573
+ * @property {B4aBuffer|null} [signature] LivenessRequest signature
555
574
  */
556
575
 
557
576
  /**
@@ -565,13 +584,13 @@ $root.network = (function() {
565
584
  function LivenessRequest(properties) {
566
585
  if (properties)
567
586
  for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
568
- if (properties[keys[i]] != null)
587
+ if (properties[keys[i]] != null && keys[i] !== "__proto__")
569
588
  this[keys[i]] = properties[keys[i]];
570
589
  }
571
590
 
572
591
  /**
573
592
  * LivenessRequest nonce.
574
- * @member {Uint8Array} nonce
593
+ * @member {B4aBuffer} nonce
575
594
  * @memberof network.v1.LivenessRequest
576
595
  * @instance
577
596
  */
@@ -579,7 +598,7 @@ $root.network = (function() {
579
598
 
580
599
  /**
581
600
  * LivenessRequest signature.
582
- * @member {Uint8Array} signature
601
+ * @member {B4aBuffer} signature
583
602
  * @memberof network.v1.LivenessRequest
584
603
  * @instance
585
604
  */
@@ -606,9 +625,12 @@ $root.network = (function() {
606
625
  * @param {$protobuf.Writer} [writer] Writer to encode to
607
626
  * @returns {$protobuf.Writer} Writer
608
627
  */
609
- LivenessRequest.encode = function encode(message, writer) {
610
- if (!writer)
611
- writer = $Writer.create();
628
+ LivenessRequest.encode = function encode(message, writer, q) {
629
+ writer = $Writer.create(writer);
630
+ if (q === undefined)
631
+ q = 0;
632
+ if (q > $util.recursionLimit)
633
+ throw Error("max depth exceeded");
612
634
  if (message.nonce != null && Object.hasOwnProperty.call(message, "nonce"))
613
635
  writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.nonce);
614
636
  if (message.signature != null && Object.hasOwnProperty.call(message, "signature"))
@@ -626,7 +648,7 @@ $root.network = (function() {
626
648
  * @returns {$protobuf.Writer} Writer
627
649
  */
628
650
  LivenessRequest.encodeDelimited = function encodeDelimited(message, writer) {
629
- return this.encode(message, writer).ldelim();
651
+ return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();
630
652
  };
631
653
 
632
654
  /**
@@ -634,15 +656,18 @@ $root.network = (function() {
634
656
  * @function decode
635
657
  * @memberof network.v1.LivenessRequest
636
658
  * @static
637
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
659
+ * @param {$protobuf.Reader|B4aBuffer} reader Reader or buffer to decode from
638
660
  * @param {number} [length] Message length if known beforehand
639
661
  * @returns {network.v1.LivenessRequest} LivenessRequest
640
662
  * @throws {Error} If the payload is not a reader or valid buffer
641
663
  * @throws {$protobuf.util.ProtocolError} If required fields are missing
642
664
  */
643
- LivenessRequest.decode = function decode(reader, length, error) {
644
- if (!(reader instanceof $Reader))
645
- reader = $Reader.create(reader);
665
+ LivenessRequest.decode = function decode(reader, length, error, long) {
666
+ reader = $Reader.create(reader);
667
+ if (long === undefined)
668
+ long = 0;
669
+ if (long > $Reader.recursionLimit)
670
+ throw Error("maximum nesting depth exceeded");
646
671
  var end = length === undefined ? reader.len : reader.pos + length, message = new $root.network.v1.LivenessRequest();
647
672
  while (reader.pos < end) {
648
673
  var tag = reader.uint32();
@@ -650,15 +675,15 @@ $root.network = (function() {
650
675
  break;
651
676
  switch (tag >>> 3) {
652
677
  case 1: {
653
- message.nonce = reader.bytes();
678
+ message.nonce = $util.bytesFrom(reader.bytes());
654
679
  break;
655
680
  }
656
681
  case 2: {
657
- message.signature = reader.bytes();
682
+ message.signature = $util.bytesFrom(reader.bytes());
658
683
  break;
659
684
  }
660
685
  default:
661
- reader.skipType(tag & 7);
686
+ reader.skipType(tag & 7, long);
662
687
  break;
663
688
  }
664
689
  }
@@ -670,14 +695,13 @@ $root.network = (function() {
670
695
  * @function decodeDelimited
671
696
  * @memberof network.v1.LivenessRequest
672
697
  * @static
673
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
698
+ * @param {$protobuf.Reader|B4aBuffer} reader Reader or buffer to decode from
674
699
  * @returns {network.v1.LivenessRequest} LivenessRequest
675
700
  * @throws {Error} If the payload is not a reader or valid buffer
676
701
  * @throws {$protobuf.util.ProtocolError} If required fields are missing
677
702
  */
678
703
  LivenessRequest.decodeDelimited = function decodeDelimited(reader) {
679
- if (!(reader instanceof $Reader))
680
- reader = new $Reader(reader);
704
+ reader = $Reader.create(reader);
681
705
  return this.decode(reader, reader.uint32());
682
706
  };
683
707
 
@@ -689,14 +713,18 @@ $root.network = (function() {
689
713
  * @param {Object.<string,*>} message Plain object to verify
690
714
  * @returns {string|null} `null` if valid, otherwise the reason why it is not
691
715
  */
692
- LivenessRequest.verify = function verify(message) {
716
+ LivenessRequest.verify = function verify(message, long) {
693
717
  if (typeof message !== "object" || message === null)
694
718
  return "object expected";
695
- if (message.nonce != null && message.hasOwnProperty("nonce"))
696
- if (!(message.nonce && typeof message.nonce.length === "number" || $util.isString(message.nonce)))
719
+ if (long === undefined)
720
+ long = 0;
721
+ if (long > $util.recursionLimit)
722
+ return "maximum nesting depth exceeded";
723
+ if (message.nonce != null && Object.hasOwnProperty.call(message, "nonce"))
724
+ if (!$util.isBytes(message.nonce))
697
725
  return "nonce: buffer expected";
698
- if (message.signature != null && message.hasOwnProperty("signature"))
699
- if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature)))
726
+ if (message.signature != null && Object.hasOwnProperty.call(message, "signature"))
727
+ if (!$util.isBytes(message.signature))
700
728
  return "signature: buffer expected";
701
729
  return null;
702
730
  };
@@ -709,20 +737,20 @@ $root.network = (function() {
709
737
  * @param {Object.<string,*>} object Plain object
710
738
  * @returns {network.v1.LivenessRequest} LivenessRequest
711
739
  */
712
- LivenessRequest.fromObject = function fromObject(object) {
740
+ LivenessRequest.fromObject = function fromObject(object, long) {
713
741
  if (object instanceof $root.network.v1.LivenessRequest)
714
- return object;
742
+ object = Object.assign({}, object);
743
+ if (!$util.isObject(object))
744
+ throw TypeError(".network.v1.LivenessRequest: object expected");
745
+ if (long === undefined)
746
+ long = 0;
747
+ if (long > $util.recursionLimit)
748
+ throw Error("maximum nesting depth exceeded");
715
749
  var message = new $root.network.v1.LivenessRequest();
716
750
  if (object.nonce != null)
717
- if (typeof object.nonce === "string")
718
- $util.base64.decode(object.nonce, message.nonce = $util.newBuffer($util.base64.length(object.nonce)), 0);
719
- else if (object.nonce.length >= 0)
720
- message.nonce = object.nonce;
751
+ message.nonce = $util.bytesFrom(object.nonce);
721
752
  if (object.signature != null)
722
- if (typeof object.signature === "string")
723
- $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0);
724
- else if (object.signature.length >= 0)
725
- message.signature = object.signature;
753
+ message.signature = $util.bytesFrom(object.signature);
726
754
  return message;
727
755
  };
728
756
 
@@ -735,9 +763,13 @@ $root.network = (function() {
735
763
  * @param {$protobuf.IConversionOptions} [options] Conversion options
736
764
  * @returns {Object.<string,*>} Plain object
737
765
  */
738
- LivenessRequest.toObject = function toObject(message, options) {
766
+ LivenessRequest.toObject = function toObject(message, options, q) {
739
767
  if (!options)
740
768
  options = {};
769
+ if (q === undefined)
770
+ q = 0;
771
+ if (q > $util.recursionLimit)
772
+ throw Error("max depth exceeded");
741
773
  var object = {};
742
774
  if (options.defaults) {
743
775
  if (options.bytes === String)
@@ -755,10 +787,10 @@ $root.network = (function() {
755
787
  object.signature = $util.newBuffer(object.signature);
756
788
  }
757
789
  }
758
- if (message.nonce != null && message.hasOwnProperty("nonce"))
759
- object.nonce = options.bytes === String ? $util.base64.encode(message.nonce, 0, message.nonce.length) : options.bytes === Array ? Array.prototype.slice.call(message.nonce) : message.nonce;
760
- if (message.signature != null && message.hasOwnProperty("signature"))
761
- object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature;
790
+ if (message.nonce != null && Object.hasOwnProperty.call(message, "nonce"))
791
+ object.nonce = $util.bytesTo(message.nonce, options);
792
+ if (message.signature != null && Object.hasOwnProperty.call(message, "signature"))
793
+ object.signature = $util.bytesTo(message.signature, options);
762
794
  return object;
763
795
  };
764
796
 
@@ -797,9 +829,9 @@ $root.network = (function() {
797
829
  * Properties of a LivenessResponse.
798
830
  * @memberof network.v1
799
831
  * @interface ILivenessResponse
800
- * @property {Uint8Array|null} [nonce] LivenessResponse nonce
801
- * @property {Uint8Array|null} [signature] LivenessResponse signature
802
- * @property {network.v1.ResultCode|null} [result] LivenessResponse result
832
+ * @property {B4aBuffer|null} [nonce] LivenessResponse nonce
833
+ * @property {B4aBuffer|null} [signature] LivenessResponse signature
834
+ * @property {common.v1.ResultCode|null} [result] LivenessResponse result
803
835
  */
804
836
 
805
837
  /**
@@ -813,13 +845,13 @@ $root.network = (function() {
813
845
  function LivenessResponse(properties) {
814
846
  if (properties)
815
847
  for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
816
- if (properties[keys[i]] != null)
848
+ if (properties[keys[i]] != null && keys[i] !== "__proto__")
817
849
  this[keys[i]] = properties[keys[i]];
818
850
  }
819
851
 
820
852
  /**
821
853
  * LivenessResponse nonce.
822
- * @member {Uint8Array} nonce
854
+ * @member {B4aBuffer} nonce
823
855
  * @memberof network.v1.LivenessResponse
824
856
  * @instance
825
857
  */
@@ -827,7 +859,7 @@ $root.network = (function() {
827
859
 
828
860
  /**
829
861
  * LivenessResponse signature.
830
- * @member {Uint8Array} signature
862
+ * @member {B4aBuffer} signature
831
863
  * @memberof network.v1.LivenessResponse
832
864
  * @instance
833
865
  */
@@ -835,7 +867,7 @@ $root.network = (function() {
835
867
 
836
868
  /**
837
869
  * LivenessResponse result.
838
- * @member {network.v1.ResultCode} result
870
+ * @member {common.v1.ResultCode} result
839
871
  * @memberof network.v1.LivenessResponse
840
872
  * @instance
841
873
  */
@@ -862,9 +894,12 @@ $root.network = (function() {
862
894
  * @param {$protobuf.Writer} [writer] Writer to encode to
863
895
  * @returns {$protobuf.Writer} Writer
864
896
  */
865
- LivenessResponse.encode = function encode(message, writer) {
866
- if (!writer)
867
- writer = $Writer.create();
897
+ LivenessResponse.encode = function encode(message, writer, q) {
898
+ writer = $Writer.create(writer);
899
+ if (q === undefined)
900
+ q = 0;
901
+ if (q > $util.recursionLimit)
902
+ throw Error("max depth exceeded");
868
903
  if (message.nonce != null && Object.hasOwnProperty.call(message, "nonce"))
869
904
  writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.nonce);
870
905
  if (message.signature != null && Object.hasOwnProperty.call(message, "signature"))
@@ -884,7 +919,7 @@ $root.network = (function() {
884
919
  * @returns {$protobuf.Writer} Writer
885
920
  */
886
921
  LivenessResponse.encodeDelimited = function encodeDelimited(message, writer) {
887
- return this.encode(message, writer).ldelim();
922
+ return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();
888
923
  };
889
924
 
890
925
  /**
@@ -892,15 +927,18 @@ $root.network = (function() {
892
927
  * @function decode
893
928
  * @memberof network.v1.LivenessResponse
894
929
  * @static
895
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
930
+ * @param {$protobuf.Reader|B4aBuffer} reader Reader or buffer to decode from
896
931
  * @param {number} [length] Message length if known beforehand
897
932
  * @returns {network.v1.LivenessResponse} LivenessResponse
898
933
  * @throws {Error} If the payload is not a reader or valid buffer
899
934
  * @throws {$protobuf.util.ProtocolError} If required fields are missing
900
935
  */
901
- LivenessResponse.decode = function decode(reader, length, error) {
902
- if (!(reader instanceof $Reader))
903
- reader = $Reader.create(reader);
936
+ LivenessResponse.decode = function decode(reader, length, error, long) {
937
+ reader = $Reader.create(reader);
938
+ if (long === undefined)
939
+ long = 0;
940
+ if (long > $Reader.recursionLimit)
941
+ throw Error("maximum nesting depth exceeded");
904
942
  var end = length === undefined ? reader.len : reader.pos + length, message = new $root.network.v1.LivenessResponse();
905
943
  while (reader.pos < end) {
906
944
  var tag = reader.uint32();
@@ -908,11 +946,11 @@ $root.network = (function() {
908
946
  break;
909
947
  switch (tag >>> 3) {
910
948
  case 1: {
911
- message.nonce = reader.bytes();
949
+ message.nonce = $util.bytesFrom(reader.bytes());
912
950
  break;
913
951
  }
914
952
  case 2: {
915
- message.signature = reader.bytes();
953
+ message.signature = $util.bytesFrom(reader.bytes());
916
954
  break;
917
955
  }
918
956
  case 3: {
@@ -920,7 +958,7 @@ $root.network = (function() {
920
958
  break;
921
959
  }
922
960
  default:
923
- reader.skipType(tag & 7);
961
+ reader.skipType(tag & 7, long);
924
962
  break;
925
963
  }
926
964
  }
@@ -932,14 +970,13 @@ $root.network = (function() {
932
970
  * @function decodeDelimited
933
971
  * @memberof network.v1.LivenessResponse
934
972
  * @static
935
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
973
+ * @param {$protobuf.Reader|B4aBuffer} reader Reader or buffer to decode from
936
974
  * @returns {network.v1.LivenessResponse} LivenessResponse
937
975
  * @throws {Error} If the payload is not a reader or valid buffer
938
976
  * @throws {$protobuf.util.ProtocolError} If required fields are missing
939
977
  */
940
978
  LivenessResponse.decodeDelimited = function decodeDelimited(reader) {
941
- if (!(reader instanceof $Reader))
942
- reader = new $Reader(reader);
979
+ reader = $Reader.create(reader);
943
980
  return this.decode(reader, reader.uint32());
944
981
  };
945
982
 
@@ -951,16 +988,20 @@ $root.network = (function() {
951
988
  * @param {Object.<string,*>} message Plain object to verify
952
989
  * @returns {string|null} `null` if valid, otherwise the reason why it is not
953
990
  */
954
- LivenessResponse.verify = function verify(message) {
991
+ LivenessResponse.verify = function verify(message, long) {
955
992
  if (typeof message !== "object" || message === null)
956
993
  return "object expected";
957
- if (message.nonce != null && message.hasOwnProperty("nonce"))
958
- if (!(message.nonce && typeof message.nonce.length === "number" || $util.isString(message.nonce)))
994
+ if (long === undefined)
995
+ long = 0;
996
+ if (long > $util.recursionLimit)
997
+ return "maximum nesting depth exceeded";
998
+ if (message.nonce != null && Object.hasOwnProperty.call(message, "nonce"))
999
+ if (!$util.isBytes(message.nonce))
959
1000
  return "nonce: buffer expected";
960
- if (message.signature != null && message.hasOwnProperty("signature"))
961
- if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature)))
1001
+ if (message.signature != null && Object.hasOwnProperty.call(message, "signature"))
1002
+ if (!$util.isBytes(message.signature))
962
1003
  return "signature: buffer expected";
963
- if (message.result != null && message.hasOwnProperty("result"))
1004
+ if (message.result != null && Object.hasOwnProperty.call(message, "result"))
964
1005
  switch (message.result) {
965
1006
  default:
966
1007
  return "result: enum value expected";
@@ -1026,6 +1067,21 @@ $root.network = (function() {
1026
1067
  case 59:
1027
1068
  case 60:
1028
1069
  case 61:
1070
+ case 100:
1071
+ case 101:
1072
+ case 102:
1073
+ case 103:
1074
+ case 104:
1075
+ case 105:
1076
+ case 106:
1077
+ case 107:
1078
+ case 108:
1079
+ case 109:
1080
+ case 110:
1081
+ case 111:
1082
+ case 112:
1083
+ case 113:
1084
+ case 114:
1029
1085
  break;
1030
1086
  }
1031
1087
  return null;
@@ -1039,20 +1095,20 @@ $root.network = (function() {
1039
1095
  * @param {Object.<string,*>} object Plain object
1040
1096
  * @returns {network.v1.LivenessResponse} LivenessResponse
1041
1097
  */
1042
- LivenessResponse.fromObject = function fromObject(object) {
1098
+ LivenessResponse.fromObject = function fromObject(object, long) {
1043
1099
  if (object instanceof $root.network.v1.LivenessResponse)
1044
- return object;
1100
+ object = Object.assign({}, object);
1101
+ if (!$util.isObject(object))
1102
+ throw TypeError(".network.v1.LivenessResponse: object expected");
1103
+ if (long === undefined)
1104
+ long = 0;
1105
+ if (long > $util.recursionLimit)
1106
+ throw Error("maximum nesting depth exceeded");
1045
1107
  var message = new $root.network.v1.LivenessResponse();
1046
1108
  if (object.nonce != null)
1047
- if (typeof object.nonce === "string")
1048
- $util.base64.decode(object.nonce, message.nonce = $util.newBuffer($util.base64.length(object.nonce)), 0);
1049
- else if (object.nonce.length >= 0)
1050
- message.nonce = object.nonce;
1109
+ message.nonce = $util.bytesFrom(object.nonce);
1051
1110
  if (object.signature != null)
1052
- if (typeof object.signature === "string")
1053
- $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0);
1054
- else if (object.signature.length >= 0)
1055
- message.signature = object.signature;
1111
+ message.signature = $util.bytesFrom(object.signature);
1056
1112
  switch (object.result) {
1057
1113
  default:
1058
1114
  if (typeof object.result === "number") {
@@ -1308,6 +1364,66 @@ $root.network = (function() {
1308
1364
  case 61:
1309
1365
  message.result = 61;
1310
1366
  break;
1367
+ case "RESULT_CODE_CONSENSUS_SCHEMA_VALIDATION_FAILED":
1368
+ case 100:
1369
+ message.result = 100;
1370
+ break;
1371
+ case "RESULT_CODE_CONSENSUS_BAD_PROTOCOL_VERSION":
1372
+ case 101:
1373
+ message.result = 101;
1374
+ break;
1375
+ case "RESULT_CODE_CONSENSUS_WRONG_NETWORK_ID":
1376
+ case 102:
1377
+ message.result = 102;
1378
+ break;
1379
+ case "RESULT_CODE_CONSENSUS_CONFIG_MISMATCH":
1380
+ case 103:
1381
+ message.result = 103;
1382
+ break;
1383
+ case "RESULT_CODE_CONSENSUS_VDF_PROOF_INVALID":
1384
+ case 104:
1385
+ message.result = 104;
1386
+ break;
1387
+ case "RESULT_CODE_CONSENSUS_ADDRESS_INVALID":
1388
+ case 105:
1389
+ message.result = 105;
1390
+ break;
1391
+ case "RESULT_CODE_CONSENSUS_PUBLIC_KEY_MISMATCH":
1392
+ case 106:
1393
+ message.result = 106;
1394
+ break;
1395
+ case "RESULT_CODE_CONSENSUS_PROPOSAL_SIGNATURE_INVALID":
1396
+ case 107:
1397
+ message.result = 107;
1398
+ break;
1399
+ case "RESULT_CODE_CONSENSUS_RESPONSE_SIGNATURE_INVALID":
1400
+ case 108:
1401
+ message.result = 108;
1402
+ break;
1403
+ case "RESULT_CODE_CONSENSUS_APPROVAL_SIGNATURE_INVALID":
1404
+ case 109:
1405
+ message.result = 109;
1406
+ break;
1407
+ case "RESULT_CODE_CONSENSUS_OPERATION_TYPE_INVALID":
1408
+ case 110:
1409
+ message.result = 110;
1410
+ break;
1411
+ case "RESULT_CODE_CONSENSUS_RESPONSE_APPROVAL_INVALID":
1412
+ case 111:
1413
+ message.result = 111;
1414
+ break;
1415
+ case "RESULT_CODE_CONSENSUS_EPOCH_INVALID":
1416
+ case 112:
1417
+ message.result = 112;
1418
+ break;
1419
+ case "RESULT_CODE_CONSENSUS_PREVIOUS_EPOCH_RECORD_HASH_INVALID":
1420
+ case 113:
1421
+ message.result = 113;
1422
+ break;
1423
+ case "RESULT_CODE_CONSENSUS_INDEXER_ROLE_INVALID":
1424
+ case 114:
1425
+ message.result = 114;
1426
+ break;
1311
1427
  }
1312
1428
  return message;
1313
1429
  };
@@ -1321,9 +1437,13 @@ $root.network = (function() {
1321
1437
  * @param {$protobuf.IConversionOptions} [options] Conversion options
1322
1438
  * @returns {Object.<string,*>} Plain object
1323
1439
  */
1324
- LivenessResponse.toObject = function toObject(message, options) {
1440
+ LivenessResponse.toObject = function toObject(message, options, q) {
1325
1441
  if (!options)
1326
1442
  options = {};
1443
+ if (q === undefined)
1444
+ q = 0;
1445
+ if (q > $util.recursionLimit)
1446
+ throw Error("max depth exceeded");
1327
1447
  var object = {};
1328
1448
  if (options.defaults) {
1329
1449
  if (options.bytes === String)
@@ -1342,12 +1462,12 @@ $root.network = (function() {
1342
1462
  }
1343
1463
  object.result = options.enums === String ? "RESULT_CODE_UNSPECIFIED" : 0;
1344
1464
  }
1345
- if (message.nonce != null && message.hasOwnProperty("nonce"))
1346
- object.nonce = options.bytes === String ? $util.base64.encode(message.nonce, 0, message.nonce.length) : options.bytes === Array ? Array.prototype.slice.call(message.nonce) : message.nonce;
1347
- if (message.signature != null && message.hasOwnProperty("signature"))
1348
- object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature;
1349
- if (message.result != null && message.hasOwnProperty("result"))
1350
- object.result = options.enums === String ? $root.network.v1.ResultCode[message.result] === undefined ? message.result : $root.network.v1.ResultCode[message.result] : message.result;
1465
+ if (message.nonce != null && Object.hasOwnProperty.call(message, "nonce"))
1466
+ object.nonce = $util.bytesTo(message.nonce, options);
1467
+ if (message.signature != null && Object.hasOwnProperty.call(message, "signature"))
1468
+ object.signature = $util.bytesTo(message.signature, options);
1469
+ if (message.result != null && Object.hasOwnProperty.call(message, "result"))
1470
+ object.result = options.enums === String ? $root.common.v1.ResultCode[message.result] === undefined ? message.result : $root.common.v1.ResultCode[message.result] : message.result;
1351
1471
  return object;
1352
1472
  };
1353
1473
 
@@ -1380,149 +1500,15 @@ $root.network = (function() {
1380
1500
  return LivenessResponse;
1381
1501
  })();
1382
1502
 
1383
- /**
1384
- * ResultCode enum.
1385
- * @name network.v1.ResultCode
1386
- * @enum {number}
1387
- * @property {number} RESULT_CODE_UNSPECIFIED=0 RESULT_CODE_UNSPECIFIED value
1388
- * @property {number} RESULT_CODE_OK=1 RESULT_CODE_OK value
1389
- * @property {number} RESULT_CODE_INVALID_PAYLOAD=2 RESULT_CODE_INVALID_PAYLOAD value
1390
- * @property {number} RESULT_CODE_RATE_LIMITED=3 RESULT_CODE_RATE_LIMITED value
1391
- * @property {number} RESULT_CODE_SIGNATURE_INVALID=4 RESULT_CODE_SIGNATURE_INVALID value
1392
- * @property {number} RESULT_CODE_UNEXPECTED_ERROR=5 RESULT_CODE_UNEXPECTED_ERROR value
1393
- * @property {number} RESULT_CODE_TIMEOUT=6 RESULT_CODE_TIMEOUT value
1394
- * @property {number} RESULT_CODE_NODE_HAS_NO_WRITE_ACCESS=7 RESULT_CODE_NODE_HAS_NO_WRITE_ACCESS value
1395
- * @property {number} RESULT_CODE_TX_ACCEPTED_PROOF_UNAVAILABLE=8 RESULT_CODE_TX_ACCEPTED_PROOF_UNAVAILABLE value
1396
- * @property {number} RESULT_CODE_NODE_OVERLOADED=9 RESULT_CODE_NODE_OVERLOADED value
1397
- * @property {number} RESULT_CODE_TX_ALREADY_PENDING=10 RESULT_CODE_TX_ALREADY_PENDING value
1398
- * @property {number} RESULT_CODE_OPERATION_TYPE_UNKNOWN=11 RESULT_CODE_OPERATION_TYPE_UNKNOWN value
1399
- * @property {number} RESULT_CODE_SCHEMA_VALIDATION_FAILED=12 RESULT_CODE_SCHEMA_VALIDATION_FAILED value
1400
- * @property {number} RESULT_CODE_REQUESTER_ADDRESS_INVALID=13 RESULT_CODE_REQUESTER_ADDRESS_INVALID value
1401
- * @property {number} RESULT_CODE_REQUESTER_PUBLIC_KEY_INVALID=14 RESULT_CODE_REQUESTER_PUBLIC_KEY_INVALID value
1402
- * @property {number} RESULT_CODE_TX_HASH_MISMATCH=15 RESULT_CODE_TX_HASH_MISMATCH value
1403
- * @property {number} RESULT_CODE_TX_SIGNATURE_INVALID=16 RESULT_CODE_TX_SIGNATURE_INVALID value
1404
- * @property {number} RESULT_CODE_TX_EXPIRED=17 RESULT_CODE_TX_EXPIRED value
1405
- * @property {number} RESULT_CODE_TX_ALREADY_EXISTS=18 RESULT_CODE_TX_ALREADY_EXISTS value
1406
- * @property {number} RESULT_CODE_OPERATION_ALREADY_COMPLETED=19 RESULT_CODE_OPERATION_ALREADY_COMPLETED value
1407
- * @property {number} RESULT_CODE_REQUESTER_NOT_FOUND=20 RESULT_CODE_REQUESTER_NOT_FOUND value
1408
- * @property {number} RESULT_CODE_INSUFFICIENT_FEE_BALANCE=21 RESULT_CODE_INSUFFICIENT_FEE_BALANCE value
1409
- * @property {number} RESULT_CODE_EXTERNAL_BOOTSTRAP_EQUALS_MSB_BOOTSTRAP=22 RESULT_CODE_EXTERNAL_BOOTSTRAP_EQUALS_MSB_BOOTSTRAP value
1410
- * @property {number} RESULT_CODE_SELF_VALIDATION_FORBIDDEN=23 RESULT_CODE_SELF_VALIDATION_FORBIDDEN value
1411
- * @property {number} RESULT_CODE_ROLE_NODE_ENTRY_NOT_FOUND=24 RESULT_CODE_ROLE_NODE_ENTRY_NOT_FOUND value
1412
- * @property {number} RESULT_CODE_ROLE_NODE_ALREADY_WRITER=25 RESULT_CODE_ROLE_NODE_ALREADY_WRITER value
1413
- * @property {number} RESULT_CODE_ROLE_NODE_NOT_WHITELISTED=26 RESULT_CODE_ROLE_NODE_NOT_WHITELISTED value
1414
- * @property {number} RESULT_CODE_ROLE_NODE_NOT_WRITER=27 RESULT_CODE_ROLE_NODE_NOT_WRITER value
1415
- * @property {number} RESULT_CODE_ROLE_NODE_IS_INDEXER=28 RESULT_CODE_ROLE_NODE_IS_INDEXER value
1416
- * @property {number} RESULT_CODE_ROLE_ADMIN_ENTRY_MISSING=29 RESULT_CODE_ROLE_ADMIN_ENTRY_MISSING value
1417
- * @property {number} RESULT_CODE_ROLE_INVALID_RECOVERY_CASE=30 RESULT_CODE_ROLE_INVALID_RECOVERY_CASE value
1418
- * @property {number} RESULT_CODE_ROLE_UNKNOWN_OPERATION=31 RESULT_CODE_ROLE_UNKNOWN_OPERATION value
1419
- * @property {number} RESULT_CODE_ROLE_INVALID_WRITER_KEY=32 RESULT_CODE_ROLE_INVALID_WRITER_KEY value
1420
- * @property {number} RESULT_CODE_ROLE_INSUFFICIENT_FEE_BALANCE=33 RESULT_CODE_ROLE_INSUFFICIENT_FEE_BALANCE value
1421
- * @property {number} RESULT_CODE_MSB_BOOTSTRAP_MISMATCH=34 RESULT_CODE_MSB_BOOTSTRAP_MISMATCH value
1422
- * @property {number} RESULT_CODE_EXTERNAL_BOOTSTRAP_NOT_DEPLOYED=35 RESULT_CODE_EXTERNAL_BOOTSTRAP_NOT_DEPLOYED value
1423
- * @property {number} RESULT_CODE_EXTERNAL_BOOTSTRAP_TX_MISSING=36 RESULT_CODE_EXTERNAL_BOOTSTRAP_TX_MISSING value
1424
- * @property {number} RESULT_CODE_EXTERNAL_BOOTSTRAP_MISMATCH=37 RESULT_CODE_EXTERNAL_BOOTSTRAP_MISMATCH value
1425
- * @property {number} RESULT_CODE_BOOTSTRAP_ALREADY_EXISTS=38 RESULT_CODE_BOOTSTRAP_ALREADY_EXISTS value
1426
- * @property {number} RESULT_CODE_TRANSFER_RECIPIENT_ADDRESS_INVALID=39 RESULT_CODE_TRANSFER_RECIPIENT_ADDRESS_INVALID value
1427
- * @property {number} RESULT_CODE_TRANSFER_RECIPIENT_PUBLIC_KEY_INVALID=40 RESULT_CODE_TRANSFER_RECIPIENT_PUBLIC_KEY_INVALID value
1428
- * @property {number} RESULT_CODE_TRANSFER_AMOUNT_TOO_LARGE=41 RESULT_CODE_TRANSFER_AMOUNT_TOO_LARGE value
1429
- * @property {number} RESULT_CODE_TRANSFER_SENDER_NOT_FOUND=42 RESULT_CODE_TRANSFER_SENDER_NOT_FOUND value
1430
- * @property {number} RESULT_CODE_TRANSFER_INSUFFICIENT_BALANCE=43 RESULT_CODE_TRANSFER_INSUFFICIENT_BALANCE value
1431
- * @property {number} RESULT_CODE_TRANSFER_RECIPIENT_BALANCE_OVERFLOW=44 RESULT_CODE_TRANSFER_RECIPIENT_BALANCE_OVERFLOW value
1432
- * @property {number} RESULT_CODE_TX_HASH_INVALID_FORMAT=45 RESULT_CODE_TX_HASH_INVALID_FORMAT value
1433
- * @property {number} RESULT_CODE_INTERNAL_ENQUEUE_VALIDATION_FAILED=46 RESULT_CODE_INTERNAL_ENQUEUE_VALIDATION_FAILED value
1434
- * @property {number} RESULT_CODE_TX_COMMITTED_RECEIPT_MISSING=47 RESULT_CODE_TX_COMMITTED_RECEIPT_MISSING value
1435
- * @property {number} RESULT_CODE_VALIDATOR_RESPONSE_TX_TYPE_INVALID=48 RESULT_CODE_VALIDATOR_RESPONSE_TX_TYPE_INVALID value
1436
- * @property {number} RESULT_CODE_VALIDATOR_RESPONSE_TX_TYPE_UNKNOWN=49 RESULT_CODE_VALIDATOR_RESPONSE_TX_TYPE_UNKNOWN value
1437
- * @property {number} RESULT_CODE_VALIDATOR_RESPONSE_TX_TYPE_UNSUPPORTED=50 RESULT_CODE_VALIDATOR_RESPONSE_TX_TYPE_UNSUPPORTED value
1438
- * @property {number} RESULT_CODE_VALIDATOR_RESPONSE_SCHEMA_INVALID=51 RESULT_CODE_VALIDATOR_RESPONSE_SCHEMA_INVALID value
1439
- * @property {number} RESULT_CODE_PENDING_REQUEST_MISSING_TX_DATA=52 RESULT_CODE_PENDING_REQUEST_MISSING_TX_DATA value
1440
- * @property {number} RESULT_CODE_PROOF_PAYLOAD_MISMATCH=53 RESULT_CODE_PROOF_PAYLOAD_MISMATCH value
1441
- * @property {number} RESULT_CODE_VALIDATOR_WRITER_KEY_NOT_REGISTERED=54 RESULT_CODE_VALIDATOR_WRITER_KEY_NOT_REGISTERED value
1442
- * @property {number} RESULT_CODE_VALIDATOR_ADDRESS_MISMATCH=55 RESULT_CODE_VALIDATOR_ADDRESS_MISMATCH value
1443
- * @property {number} RESULT_CODE_VALIDATOR_NODE_ENTRY_NOT_FOUND=56 RESULT_CODE_VALIDATOR_NODE_ENTRY_NOT_FOUND value
1444
- * @property {number} RESULT_CODE_VALIDATOR_NODE_NOT_WRITER=57 RESULT_CODE_VALIDATOR_NODE_NOT_WRITER value
1445
- * @property {number} RESULT_CODE_VALIDATOR_WRITER_KEY_MISMATCH=58 RESULT_CODE_VALIDATOR_WRITER_KEY_MISMATCH value
1446
- * @property {number} RESULT_CODE_VALIDATOR_TX_OBJECT_INVALID=59 RESULT_CODE_VALIDATOR_TX_OBJECT_INVALID value
1447
- * @property {number} RESULT_CODE_VALIDATOR_VA_MISSING=60 RESULT_CODE_VALIDATOR_VA_MISSING value
1448
- * @property {number} RESULT_CODE_TX_INVALID_PAYLOAD=61 RESULT_CODE_TX_INVALID_PAYLOAD value
1449
- */
1450
- v1.ResultCode = (function() {
1451
- var valuesById = {}, values = Object.create(valuesById);
1452
- values[valuesById[0] = "RESULT_CODE_UNSPECIFIED"] = 0;
1453
- values[valuesById[1] = "RESULT_CODE_OK"] = 1;
1454
- values[valuesById[2] = "RESULT_CODE_INVALID_PAYLOAD"] = 2;
1455
- values[valuesById[3] = "RESULT_CODE_RATE_LIMITED"] = 3;
1456
- values[valuesById[4] = "RESULT_CODE_SIGNATURE_INVALID"] = 4;
1457
- values[valuesById[5] = "RESULT_CODE_UNEXPECTED_ERROR"] = 5;
1458
- values[valuesById[6] = "RESULT_CODE_TIMEOUT"] = 6;
1459
- values[valuesById[7] = "RESULT_CODE_NODE_HAS_NO_WRITE_ACCESS"] = 7;
1460
- values[valuesById[8] = "RESULT_CODE_TX_ACCEPTED_PROOF_UNAVAILABLE"] = 8;
1461
- values[valuesById[9] = "RESULT_CODE_NODE_OVERLOADED"] = 9;
1462
- values[valuesById[10] = "RESULT_CODE_TX_ALREADY_PENDING"] = 10;
1463
- values[valuesById[11] = "RESULT_CODE_OPERATION_TYPE_UNKNOWN"] = 11;
1464
- values[valuesById[12] = "RESULT_CODE_SCHEMA_VALIDATION_FAILED"] = 12;
1465
- values[valuesById[13] = "RESULT_CODE_REQUESTER_ADDRESS_INVALID"] = 13;
1466
- values[valuesById[14] = "RESULT_CODE_REQUESTER_PUBLIC_KEY_INVALID"] = 14;
1467
- values[valuesById[15] = "RESULT_CODE_TX_HASH_MISMATCH"] = 15;
1468
- values[valuesById[16] = "RESULT_CODE_TX_SIGNATURE_INVALID"] = 16;
1469
- values[valuesById[17] = "RESULT_CODE_TX_EXPIRED"] = 17;
1470
- values[valuesById[18] = "RESULT_CODE_TX_ALREADY_EXISTS"] = 18;
1471
- values[valuesById[19] = "RESULT_CODE_OPERATION_ALREADY_COMPLETED"] = 19;
1472
- values[valuesById[20] = "RESULT_CODE_REQUESTER_NOT_FOUND"] = 20;
1473
- values[valuesById[21] = "RESULT_CODE_INSUFFICIENT_FEE_BALANCE"] = 21;
1474
- values[valuesById[22] = "RESULT_CODE_EXTERNAL_BOOTSTRAP_EQUALS_MSB_BOOTSTRAP"] = 22;
1475
- values[valuesById[23] = "RESULT_CODE_SELF_VALIDATION_FORBIDDEN"] = 23;
1476
- values[valuesById[24] = "RESULT_CODE_ROLE_NODE_ENTRY_NOT_FOUND"] = 24;
1477
- values[valuesById[25] = "RESULT_CODE_ROLE_NODE_ALREADY_WRITER"] = 25;
1478
- values[valuesById[26] = "RESULT_CODE_ROLE_NODE_NOT_WHITELISTED"] = 26;
1479
- values[valuesById[27] = "RESULT_CODE_ROLE_NODE_NOT_WRITER"] = 27;
1480
- values[valuesById[28] = "RESULT_CODE_ROLE_NODE_IS_INDEXER"] = 28;
1481
- values[valuesById[29] = "RESULT_CODE_ROLE_ADMIN_ENTRY_MISSING"] = 29;
1482
- values[valuesById[30] = "RESULT_CODE_ROLE_INVALID_RECOVERY_CASE"] = 30;
1483
- values[valuesById[31] = "RESULT_CODE_ROLE_UNKNOWN_OPERATION"] = 31;
1484
- values[valuesById[32] = "RESULT_CODE_ROLE_INVALID_WRITER_KEY"] = 32;
1485
- values[valuesById[33] = "RESULT_CODE_ROLE_INSUFFICIENT_FEE_BALANCE"] = 33;
1486
- values[valuesById[34] = "RESULT_CODE_MSB_BOOTSTRAP_MISMATCH"] = 34;
1487
- values[valuesById[35] = "RESULT_CODE_EXTERNAL_BOOTSTRAP_NOT_DEPLOYED"] = 35;
1488
- values[valuesById[36] = "RESULT_CODE_EXTERNAL_BOOTSTRAP_TX_MISSING"] = 36;
1489
- values[valuesById[37] = "RESULT_CODE_EXTERNAL_BOOTSTRAP_MISMATCH"] = 37;
1490
- values[valuesById[38] = "RESULT_CODE_BOOTSTRAP_ALREADY_EXISTS"] = 38;
1491
- values[valuesById[39] = "RESULT_CODE_TRANSFER_RECIPIENT_ADDRESS_INVALID"] = 39;
1492
- values[valuesById[40] = "RESULT_CODE_TRANSFER_RECIPIENT_PUBLIC_KEY_INVALID"] = 40;
1493
- values[valuesById[41] = "RESULT_CODE_TRANSFER_AMOUNT_TOO_LARGE"] = 41;
1494
- values[valuesById[42] = "RESULT_CODE_TRANSFER_SENDER_NOT_FOUND"] = 42;
1495
- values[valuesById[43] = "RESULT_CODE_TRANSFER_INSUFFICIENT_BALANCE"] = 43;
1496
- values[valuesById[44] = "RESULT_CODE_TRANSFER_RECIPIENT_BALANCE_OVERFLOW"] = 44;
1497
- values[valuesById[45] = "RESULT_CODE_TX_HASH_INVALID_FORMAT"] = 45;
1498
- values[valuesById[46] = "RESULT_CODE_INTERNAL_ENQUEUE_VALIDATION_FAILED"] = 46;
1499
- values[valuesById[47] = "RESULT_CODE_TX_COMMITTED_RECEIPT_MISSING"] = 47;
1500
- values[valuesById[48] = "RESULT_CODE_VALIDATOR_RESPONSE_TX_TYPE_INVALID"] = 48;
1501
- values[valuesById[49] = "RESULT_CODE_VALIDATOR_RESPONSE_TX_TYPE_UNKNOWN"] = 49;
1502
- values[valuesById[50] = "RESULT_CODE_VALIDATOR_RESPONSE_TX_TYPE_UNSUPPORTED"] = 50;
1503
- values[valuesById[51] = "RESULT_CODE_VALIDATOR_RESPONSE_SCHEMA_INVALID"] = 51;
1504
- values[valuesById[52] = "RESULT_CODE_PENDING_REQUEST_MISSING_TX_DATA"] = 52;
1505
- values[valuesById[53] = "RESULT_CODE_PROOF_PAYLOAD_MISMATCH"] = 53;
1506
- values[valuesById[54] = "RESULT_CODE_VALIDATOR_WRITER_KEY_NOT_REGISTERED"] = 54;
1507
- values[valuesById[55] = "RESULT_CODE_VALIDATOR_ADDRESS_MISMATCH"] = 55;
1508
- values[valuesById[56] = "RESULT_CODE_VALIDATOR_NODE_ENTRY_NOT_FOUND"] = 56;
1509
- values[valuesById[57] = "RESULT_CODE_VALIDATOR_NODE_NOT_WRITER"] = 57;
1510
- values[valuesById[58] = "RESULT_CODE_VALIDATOR_WRITER_KEY_MISMATCH"] = 58;
1511
- values[valuesById[59] = "RESULT_CODE_VALIDATOR_TX_OBJECT_INVALID"] = 59;
1512
- values[valuesById[60] = "RESULT_CODE_VALIDATOR_VA_MISSING"] = 60;
1513
- values[valuesById[61] = "RESULT_CODE_TX_INVALID_PAYLOAD"] = 61;
1514
- return values;
1515
- })();
1516
-
1517
1503
  v1.BroadcastTransactionRequest = (function() {
1518
1504
 
1519
1505
  /**
1520
1506
  * Properties of a BroadcastTransactionRequest.
1521
1507
  * @memberof network.v1
1522
1508
  * @interface IBroadcastTransactionRequest
1523
- * @property {Uint8Array|null} [data] BroadcastTransactionRequest data
1524
- * @property {Uint8Array|null} [nonce] BroadcastTransactionRequest nonce
1525
- * @property {Uint8Array|null} [signature] BroadcastTransactionRequest signature
1509
+ * @property {B4aBuffer|null} [data] BroadcastTransactionRequest data
1510
+ * @property {B4aBuffer|null} [nonce] BroadcastTransactionRequest nonce
1511
+ * @property {B4aBuffer|null} [signature] BroadcastTransactionRequest signature
1526
1512
  */
1527
1513
 
1528
1514
  /**
@@ -1536,13 +1522,13 @@ $root.network = (function() {
1536
1522
  function BroadcastTransactionRequest(properties) {
1537
1523
  if (properties)
1538
1524
  for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1539
- if (properties[keys[i]] != null)
1525
+ if (properties[keys[i]] != null && keys[i] !== "__proto__")
1540
1526
  this[keys[i]] = properties[keys[i]];
1541
1527
  }
1542
1528
 
1543
1529
  /**
1544
1530
  * BroadcastTransactionRequest data.
1545
- * @member {Uint8Array} data
1531
+ * @member {B4aBuffer} data
1546
1532
  * @memberof network.v1.BroadcastTransactionRequest
1547
1533
  * @instance
1548
1534
  */
@@ -1550,7 +1536,7 @@ $root.network = (function() {
1550
1536
 
1551
1537
  /**
1552
1538
  * BroadcastTransactionRequest nonce.
1553
- * @member {Uint8Array} nonce
1539
+ * @member {B4aBuffer} nonce
1554
1540
  * @memberof network.v1.BroadcastTransactionRequest
1555
1541
  * @instance
1556
1542
  */
@@ -1558,7 +1544,7 @@ $root.network = (function() {
1558
1544
 
1559
1545
  /**
1560
1546
  * BroadcastTransactionRequest signature.
1561
- * @member {Uint8Array} signature
1547
+ * @member {B4aBuffer} signature
1562
1548
  * @memberof network.v1.BroadcastTransactionRequest
1563
1549
  * @instance
1564
1550
  */
@@ -1585,9 +1571,12 @@ $root.network = (function() {
1585
1571
  * @param {$protobuf.Writer} [writer] Writer to encode to
1586
1572
  * @returns {$protobuf.Writer} Writer
1587
1573
  */
1588
- BroadcastTransactionRequest.encode = function encode(message, writer) {
1589
- if (!writer)
1590
- writer = $Writer.create();
1574
+ BroadcastTransactionRequest.encode = function encode(message, writer, q) {
1575
+ writer = $Writer.create(writer);
1576
+ if (q === undefined)
1577
+ q = 0;
1578
+ if (q > $util.recursionLimit)
1579
+ throw Error("max depth exceeded");
1591
1580
  if (message.data != null && Object.hasOwnProperty.call(message, "data"))
1592
1581
  writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.data);
1593
1582
  if (message.nonce != null && Object.hasOwnProperty.call(message, "nonce"))
@@ -1607,7 +1596,7 @@ $root.network = (function() {
1607
1596
  * @returns {$protobuf.Writer} Writer
1608
1597
  */
1609
1598
  BroadcastTransactionRequest.encodeDelimited = function encodeDelimited(message, writer) {
1610
- return this.encode(message, writer).ldelim();
1599
+ return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();
1611
1600
  };
1612
1601
 
1613
1602
  /**
@@ -1615,15 +1604,18 @@ $root.network = (function() {
1615
1604
  * @function decode
1616
1605
  * @memberof network.v1.BroadcastTransactionRequest
1617
1606
  * @static
1618
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1607
+ * @param {$protobuf.Reader|B4aBuffer} reader Reader or buffer to decode from
1619
1608
  * @param {number} [length] Message length if known beforehand
1620
1609
  * @returns {network.v1.BroadcastTransactionRequest} BroadcastTransactionRequest
1621
1610
  * @throws {Error} If the payload is not a reader or valid buffer
1622
1611
  * @throws {$protobuf.util.ProtocolError} If required fields are missing
1623
1612
  */
1624
- BroadcastTransactionRequest.decode = function decode(reader, length, error) {
1625
- if (!(reader instanceof $Reader))
1626
- reader = $Reader.create(reader);
1613
+ BroadcastTransactionRequest.decode = function decode(reader, length, error, long) {
1614
+ reader = $Reader.create(reader);
1615
+ if (long === undefined)
1616
+ long = 0;
1617
+ if (long > $Reader.recursionLimit)
1618
+ throw Error("maximum nesting depth exceeded");
1627
1619
  var end = length === undefined ? reader.len : reader.pos + length, message = new $root.network.v1.BroadcastTransactionRequest();
1628
1620
  while (reader.pos < end) {
1629
1621
  var tag = reader.uint32();
@@ -1631,19 +1623,19 @@ $root.network = (function() {
1631
1623
  break;
1632
1624
  switch (tag >>> 3) {
1633
1625
  case 1: {
1634
- message.data = reader.bytes();
1626
+ message.data = $util.bytesFrom(reader.bytes());
1635
1627
  break;
1636
1628
  }
1637
1629
  case 2: {
1638
- message.nonce = reader.bytes();
1630
+ message.nonce = $util.bytesFrom(reader.bytes());
1639
1631
  break;
1640
1632
  }
1641
1633
  case 3: {
1642
- message.signature = reader.bytes();
1634
+ message.signature = $util.bytesFrom(reader.bytes());
1643
1635
  break;
1644
1636
  }
1645
1637
  default:
1646
- reader.skipType(tag & 7);
1638
+ reader.skipType(tag & 7, long);
1647
1639
  break;
1648
1640
  }
1649
1641
  }
@@ -1655,14 +1647,13 @@ $root.network = (function() {
1655
1647
  * @function decodeDelimited
1656
1648
  * @memberof network.v1.BroadcastTransactionRequest
1657
1649
  * @static
1658
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1650
+ * @param {$protobuf.Reader|B4aBuffer} reader Reader or buffer to decode from
1659
1651
  * @returns {network.v1.BroadcastTransactionRequest} BroadcastTransactionRequest
1660
1652
  * @throws {Error} If the payload is not a reader or valid buffer
1661
1653
  * @throws {$protobuf.util.ProtocolError} If required fields are missing
1662
1654
  */
1663
1655
  BroadcastTransactionRequest.decodeDelimited = function decodeDelimited(reader) {
1664
- if (!(reader instanceof $Reader))
1665
- reader = new $Reader(reader);
1656
+ reader = $Reader.create(reader);
1666
1657
  return this.decode(reader, reader.uint32());
1667
1658
  };
1668
1659
 
@@ -1674,17 +1665,21 @@ $root.network = (function() {
1674
1665
  * @param {Object.<string,*>} message Plain object to verify
1675
1666
  * @returns {string|null} `null` if valid, otherwise the reason why it is not
1676
1667
  */
1677
- BroadcastTransactionRequest.verify = function verify(message) {
1668
+ BroadcastTransactionRequest.verify = function verify(message, long) {
1678
1669
  if (typeof message !== "object" || message === null)
1679
1670
  return "object expected";
1680
- if (message.data != null && message.hasOwnProperty("data"))
1681
- if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data)))
1671
+ if (long === undefined)
1672
+ long = 0;
1673
+ if (long > $util.recursionLimit)
1674
+ return "maximum nesting depth exceeded";
1675
+ if (message.data != null && Object.hasOwnProperty.call(message, "data"))
1676
+ if (!$util.isBytes(message.data))
1682
1677
  return "data: buffer expected";
1683
- if (message.nonce != null && message.hasOwnProperty("nonce"))
1684
- if (!(message.nonce && typeof message.nonce.length === "number" || $util.isString(message.nonce)))
1678
+ if (message.nonce != null && Object.hasOwnProperty.call(message, "nonce"))
1679
+ if (!$util.isBytes(message.nonce))
1685
1680
  return "nonce: buffer expected";
1686
- if (message.signature != null && message.hasOwnProperty("signature"))
1687
- if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature)))
1681
+ if (message.signature != null && Object.hasOwnProperty.call(message, "signature"))
1682
+ if (!$util.isBytes(message.signature))
1688
1683
  return "signature: buffer expected";
1689
1684
  return null;
1690
1685
  };
@@ -1697,25 +1692,22 @@ $root.network = (function() {
1697
1692
  * @param {Object.<string,*>} object Plain object
1698
1693
  * @returns {network.v1.BroadcastTransactionRequest} BroadcastTransactionRequest
1699
1694
  */
1700
- BroadcastTransactionRequest.fromObject = function fromObject(object) {
1695
+ BroadcastTransactionRequest.fromObject = function fromObject(object, long) {
1701
1696
  if (object instanceof $root.network.v1.BroadcastTransactionRequest)
1702
- return object;
1697
+ object = Object.assign({}, object);
1698
+ if (!$util.isObject(object))
1699
+ throw TypeError(".network.v1.BroadcastTransactionRequest: object expected");
1700
+ if (long === undefined)
1701
+ long = 0;
1702
+ if (long > $util.recursionLimit)
1703
+ throw Error("maximum nesting depth exceeded");
1703
1704
  var message = new $root.network.v1.BroadcastTransactionRequest();
1704
1705
  if (object.data != null)
1705
- if (typeof object.data === "string")
1706
- $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0);
1707
- else if (object.data.length >= 0)
1708
- message.data = object.data;
1706
+ message.data = $util.bytesFrom(object.data);
1709
1707
  if (object.nonce != null)
1710
- if (typeof object.nonce === "string")
1711
- $util.base64.decode(object.nonce, message.nonce = $util.newBuffer($util.base64.length(object.nonce)), 0);
1712
- else if (object.nonce.length >= 0)
1713
- message.nonce = object.nonce;
1708
+ message.nonce = $util.bytesFrom(object.nonce);
1714
1709
  if (object.signature != null)
1715
- if (typeof object.signature === "string")
1716
- $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0);
1717
- else if (object.signature.length >= 0)
1718
- message.signature = object.signature;
1710
+ message.signature = $util.bytesFrom(object.signature);
1719
1711
  return message;
1720
1712
  };
1721
1713
 
@@ -1728,9 +1720,13 @@ $root.network = (function() {
1728
1720
  * @param {$protobuf.IConversionOptions} [options] Conversion options
1729
1721
  * @returns {Object.<string,*>} Plain object
1730
1722
  */
1731
- BroadcastTransactionRequest.toObject = function toObject(message, options) {
1723
+ BroadcastTransactionRequest.toObject = function toObject(message, options, q) {
1732
1724
  if (!options)
1733
1725
  options = {};
1726
+ if (q === undefined)
1727
+ q = 0;
1728
+ if (q > $util.recursionLimit)
1729
+ throw Error("max depth exceeded");
1734
1730
  var object = {};
1735
1731
  if (options.defaults) {
1736
1732
  if (options.bytes === String)
@@ -1755,12 +1751,12 @@ $root.network = (function() {
1755
1751
  object.signature = $util.newBuffer(object.signature);
1756
1752
  }
1757
1753
  }
1758
- if (message.data != null && message.hasOwnProperty("data"))
1759
- object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data;
1760
- if (message.nonce != null && message.hasOwnProperty("nonce"))
1761
- object.nonce = options.bytes === String ? $util.base64.encode(message.nonce, 0, message.nonce.length) : options.bytes === Array ? Array.prototype.slice.call(message.nonce) : message.nonce;
1762
- if (message.signature != null && message.hasOwnProperty("signature"))
1763
- object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature;
1754
+ if (message.data != null && Object.hasOwnProperty.call(message, "data"))
1755
+ object.data = $util.bytesTo(message.data, options);
1756
+ if (message.nonce != null && Object.hasOwnProperty.call(message, "nonce"))
1757
+ object.nonce = $util.bytesTo(message.nonce, options);
1758
+ if (message.signature != null && Object.hasOwnProperty.call(message, "signature"))
1759
+ object.signature = $util.bytesTo(message.signature, options);
1764
1760
  return object;
1765
1761
  };
1766
1762
 
@@ -1799,11 +1795,11 @@ $root.network = (function() {
1799
1795
  * Properties of a BroadcastTransactionResponse.
1800
1796
  * @memberof network.v1
1801
1797
  * @interface IBroadcastTransactionResponse
1802
- * @property {Uint8Array|null} [nonce] BroadcastTransactionResponse nonce
1803
- * @property {Uint8Array|null} [signature] BroadcastTransactionResponse signature
1804
- * @property {Uint8Array|null} [proof] BroadcastTransactionResponse proof
1798
+ * @property {B4aBuffer|null} [nonce] BroadcastTransactionResponse nonce
1799
+ * @property {B4aBuffer|null} [signature] BroadcastTransactionResponse signature
1800
+ * @property {B4aBuffer|null} [proof] BroadcastTransactionResponse proof
1805
1801
  * @property {number|Long|null} [timestamp] BroadcastTransactionResponse timestamp
1806
- * @property {network.v1.ResultCode|null} [result] BroadcastTransactionResponse result
1802
+ * @property {common.v1.ResultCode|null} [result] BroadcastTransactionResponse result
1807
1803
  */
1808
1804
 
1809
1805
  /**
@@ -1817,13 +1813,13 @@ $root.network = (function() {
1817
1813
  function BroadcastTransactionResponse(properties) {
1818
1814
  if (properties)
1819
1815
  for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1820
- if (properties[keys[i]] != null)
1816
+ if (properties[keys[i]] != null && keys[i] !== "__proto__")
1821
1817
  this[keys[i]] = properties[keys[i]];
1822
1818
  }
1823
1819
 
1824
1820
  /**
1825
1821
  * BroadcastTransactionResponse nonce.
1826
- * @member {Uint8Array} nonce
1822
+ * @member {B4aBuffer} nonce
1827
1823
  * @memberof network.v1.BroadcastTransactionResponse
1828
1824
  * @instance
1829
1825
  */
@@ -1831,7 +1827,7 @@ $root.network = (function() {
1831
1827
 
1832
1828
  /**
1833
1829
  * BroadcastTransactionResponse signature.
1834
- * @member {Uint8Array} signature
1830
+ * @member {B4aBuffer} signature
1835
1831
  * @memberof network.v1.BroadcastTransactionResponse
1836
1832
  * @instance
1837
1833
  */
@@ -1839,7 +1835,7 @@ $root.network = (function() {
1839
1835
 
1840
1836
  /**
1841
1837
  * BroadcastTransactionResponse proof.
1842
- * @member {Uint8Array} proof
1838
+ * @member {B4aBuffer} proof
1843
1839
  * @memberof network.v1.BroadcastTransactionResponse
1844
1840
  * @instance
1845
1841
  */
@@ -1855,7 +1851,7 @@ $root.network = (function() {
1855
1851
 
1856
1852
  /**
1857
1853
  * BroadcastTransactionResponse result.
1858
- * @member {network.v1.ResultCode} result
1854
+ * @member {common.v1.ResultCode} result
1859
1855
  * @memberof network.v1.BroadcastTransactionResponse
1860
1856
  * @instance
1861
1857
  */
@@ -1882,9 +1878,12 @@ $root.network = (function() {
1882
1878
  * @param {$protobuf.Writer} [writer] Writer to encode to
1883
1879
  * @returns {$protobuf.Writer} Writer
1884
1880
  */
1885
- BroadcastTransactionResponse.encode = function encode(message, writer) {
1886
- if (!writer)
1887
- writer = $Writer.create();
1881
+ BroadcastTransactionResponse.encode = function encode(message, writer, q) {
1882
+ writer = $Writer.create(writer);
1883
+ if (q === undefined)
1884
+ q = 0;
1885
+ if (q > $util.recursionLimit)
1886
+ throw Error("max depth exceeded");
1888
1887
  if (message.nonce != null && Object.hasOwnProperty.call(message, "nonce"))
1889
1888
  writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.nonce);
1890
1889
  if (message.signature != null && Object.hasOwnProperty.call(message, "signature"))
@@ -1908,7 +1907,7 @@ $root.network = (function() {
1908
1907
  * @returns {$protobuf.Writer} Writer
1909
1908
  */
1910
1909
  BroadcastTransactionResponse.encodeDelimited = function encodeDelimited(message, writer) {
1911
- return this.encode(message, writer).ldelim();
1910
+ return this.encode(message, writer && writer.len ? writer.fork() : writer).ldelim();
1912
1911
  };
1913
1912
 
1914
1913
  /**
@@ -1916,15 +1915,18 @@ $root.network = (function() {
1916
1915
  * @function decode
1917
1916
  * @memberof network.v1.BroadcastTransactionResponse
1918
1917
  * @static
1919
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1918
+ * @param {$protobuf.Reader|B4aBuffer} reader Reader or buffer to decode from
1920
1919
  * @param {number} [length] Message length if known beforehand
1921
1920
  * @returns {network.v1.BroadcastTransactionResponse} BroadcastTransactionResponse
1922
1921
  * @throws {Error} If the payload is not a reader or valid buffer
1923
1922
  * @throws {$protobuf.util.ProtocolError} If required fields are missing
1924
1923
  */
1925
- BroadcastTransactionResponse.decode = function decode(reader, length, error) {
1926
- if (!(reader instanceof $Reader))
1927
- reader = $Reader.create(reader);
1924
+ BroadcastTransactionResponse.decode = function decode(reader, length, error, long) {
1925
+ reader = $Reader.create(reader);
1926
+ if (long === undefined)
1927
+ long = 0;
1928
+ if (long > $Reader.recursionLimit)
1929
+ throw Error("maximum nesting depth exceeded");
1928
1930
  var end = length === undefined ? reader.len : reader.pos + length, message = new $root.network.v1.BroadcastTransactionResponse();
1929
1931
  while (reader.pos < end) {
1930
1932
  var tag = reader.uint32();
@@ -1932,15 +1934,15 @@ $root.network = (function() {
1932
1934
  break;
1933
1935
  switch (tag >>> 3) {
1934
1936
  case 1: {
1935
- message.nonce = reader.bytes();
1937
+ message.nonce = $util.bytesFrom(reader.bytes());
1936
1938
  break;
1937
1939
  }
1938
1940
  case 2: {
1939
- message.signature = reader.bytes();
1941
+ message.signature = $util.bytesFrom(reader.bytes());
1940
1942
  break;
1941
1943
  }
1942
1944
  case 3: {
1943
- message.proof = reader.bytes();
1945
+ message.proof = $util.bytesFrom(reader.bytes());
1944
1946
  break;
1945
1947
  }
1946
1948
  case 4: {
@@ -1952,7 +1954,7 @@ $root.network = (function() {
1952
1954
  break;
1953
1955
  }
1954
1956
  default:
1955
- reader.skipType(tag & 7);
1957
+ reader.skipType(tag & 7, long);
1956
1958
  break;
1957
1959
  }
1958
1960
  }
@@ -1964,14 +1966,13 @@ $root.network = (function() {
1964
1966
  * @function decodeDelimited
1965
1967
  * @memberof network.v1.BroadcastTransactionResponse
1966
1968
  * @static
1967
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1969
+ * @param {$protobuf.Reader|B4aBuffer} reader Reader or buffer to decode from
1968
1970
  * @returns {network.v1.BroadcastTransactionResponse} BroadcastTransactionResponse
1969
1971
  * @throws {Error} If the payload is not a reader or valid buffer
1970
1972
  * @throws {$protobuf.util.ProtocolError} If required fields are missing
1971
1973
  */
1972
1974
  BroadcastTransactionResponse.decodeDelimited = function decodeDelimited(reader) {
1973
- if (!(reader instanceof $Reader))
1974
- reader = new $Reader(reader);
1975
+ reader = $Reader.create(reader);
1975
1976
  return this.decode(reader, reader.uint32());
1976
1977
  };
1977
1978
 
@@ -1983,22 +1984,26 @@ $root.network = (function() {
1983
1984
  * @param {Object.<string,*>} message Plain object to verify
1984
1985
  * @returns {string|null} `null` if valid, otherwise the reason why it is not
1985
1986
  */
1986
- BroadcastTransactionResponse.verify = function verify(message) {
1987
+ BroadcastTransactionResponse.verify = function verify(message, long) {
1987
1988
  if (typeof message !== "object" || message === null)
1988
1989
  return "object expected";
1989
- if (message.nonce != null && message.hasOwnProperty("nonce"))
1990
- if (!(message.nonce && typeof message.nonce.length === "number" || $util.isString(message.nonce)))
1990
+ if (long === undefined)
1991
+ long = 0;
1992
+ if (long > $util.recursionLimit)
1993
+ return "maximum nesting depth exceeded";
1994
+ if (message.nonce != null && Object.hasOwnProperty.call(message, "nonce"))
1995
+ if (!$util.isBytes(message.nonce))
1991
1996
  return "nonce: buffer expected";
1992
- if (message.signature != null && message.hasOwnProperty("signature"))
1993
- if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature)))
1997
+ if (message.signature != null && Object.hasOwnProperty.call(message, "signature"))
1998
+ if (!$util.isBytes(message.signature))
1994
1999
  return "signature: buffer expected";
1995
- if (message.proof != null && message.hasOwnProperty("proof"))
1996
- if (!(message.proof && typeof message.proof.length === "number" || $util.isString(message.proof)))
2000
+ if (message.proof != null && Object.hasOwnProperty.call(message, "proof"))
2001
+ if (!$util.isBytes(message.proof))
1997
2002
  return "proof: buffer expected";
1998
- if (message.timestamp != null && message.hasOwnProperty("timestamp"))
2003
+ if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp"))
1999
2004
  if (!$util.isInteger(message.timestamp) && !(message.timestamp && $util.isInteger(message.timestamp.low) && $util.isInteger(message.timestamp.high)))
2000
2005
  return "timestamp: integer|Long expected";
2001
- if (message.result != null && message.hasOwnProperty("result"))
2006
+ if (message.result != null && Object.hasOwnProperty.call(message, "result"))
2002
2007
  switch (message.result) {
2003
2008
  default:
2004
2009
  return "result: enum value expected";
@@ -2064,6 +2069,21 @@ $root.network = (function() {
2064
2069
  case 59:
2065
2070
  case 60:
2066
2071
  case 61:
2072
+ case 100:
2073
+ case 101:
2074
+ case 102:
2075
+ case 103:
2076
+ case 104:
2077
+ case 105:
2078
+ case 106:
2079
+ case 107:
2080
+ case 108:
2081
+ case 109:
2082
+ case 110:
2083
+ case 111:
2084
+ case 112:
2085
+ case 113:
2086
+ case 114:
2067
2087
  break;
2068
2088
  }
2069
2089
  return null;
@@ -2077,28 +2097,25 @@ $root.network = (function() {
2077
2097
  * @param {Object.<string,*>} object Plain object
2078
2098
  * @returns {network.v1.BroadcastTransactionResponse} BroadcastTransactionResponse
2079
2099
  */
2080
- BroadcastTransactionResponse.fromObject = function fromObject(object) {
2100
+ BroadcastTransactionResponse.fromObject = function fromObject(object, long) {
2081
2101
  if (object instanceof $root.network.v1.BroadcastTransactionResponse)
2082
- return object;
2102
+ object = Object.assign({}, object);
2103
+ if (!$util.isObject(object))
2104
+ throw TypeError(".network.v1.BroadcastTransactionResponse: object expected");
2105
+ if (long === undefined)
2106
+ long = 0;
2107
+ if (long > $util.recursionLimit)
2108
+ throw Error("maximum nesting depth exceeded");
2083
2109
  var message = new $root.network.v1.BroadcastTransactionResponse();
2084
2110
  if (object.nonce != null)
2085
- if (typeof object.nonce === "string")
2086
- $util.base64.decode(object.nonce, message.nonce = $util.newBuffer($util.base64.length(object.nonce)), 0);
2087
- else if (object.nonce.length >= 0)
2088
- message.nonce = object.nonce;
2111
+ message.nonce = $util.bytesFrom(object.nonce);
2089
2112
  if (object.signature != null)
2090
- if (typeof object.signature === "string")
2091
- $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0);
2092
- else if (object.signature.length >= 0)
2093
- message.signature = object.signature;
2113
+ message.signature = $util.bytesFrom(object.signature);
2094
2114
  if (object.proof != null)
2095
- if (typeof object.proof === "string")
2096
- $util.base64.decode(object.proof, message.proof = $util.newBuffer($util.base64.length(object.proof)), 0);
2097
- else if (object.proof.length >= 0)
2098
- message.proof = object.proof;
2115
+ message.proof = $util.bytesFrom(object.proof);
2099
2116
  if (object.timestamp != null)
2100
2117
  if ($util.Long)
2101
- (message.timestamp = $util.Long.fromValue(object.timestamp)).unsigned = true;
2118
+ message.timestamp = $util.Long.fromValue(object.timestamp, true);
2102
2119
  else if (typeof object.timestamp === "string")
2103
2120
  message.timestamp = parseInt(object.timestamp, 10);
2104
2121
  else if (typeof object.timestamp === "number")
@@ -2360,6 +2377,66 @@ $root.network = (function() {
2360
2377
  case 61:
2361
2378
  message.result = 61;
2362
2379
  break;
2380
+ case "RESULT_CODE_CONSENSUS_SCHEMA_VALIDATION_FAILED":
2381
+ case 100:
2382
+ message.result = 100;
2383
+ break;
2384
+ case "RESULT_CODE_CONSENSUS_BAD_PROTOCOL_VERSION":
2385
+ case 101:
2386
+ message.result = 101;
2387
+ break;
2388
+ case "RESULT_CODE_CONSENSUS_WRONG_NETWORK_ID":
2389
+ case 102:
2390
+ message.result = 102;
2391
+ break;
2392
+ case "RESULT_CODE_CONSENSUS_CONFIG_MISMATCH":
2393
+ case 103:
2394
+ message.result = 103;
2395
+ break;
2396
+ case "RESULT_CODE_CONSENSUS_VDF_PROOF_INVALID":
2397
+ case 104:
2398
+ message.result = 104;
2399
+ break;
2400
+ case "RESULT_CODE_CONSENSUS_ADDRESS_INVALID":
2401
+ case 105:
2402
+ message.result = 105;
2403
+ break;
2404
+ case "RESULT_CODE_CONSENSUS_PUBLIC_KEY_MISMATCH":
2405
+ case 106:
2406
+ message.result = 106;
2407
+ break;
2408
+ case "RESULT_CODE_CONSENSUS_PROPOSAL_SIGNATURE_INVALID":
2409
+ case 107:
2410
+ message.result = 107;
2411
+ break;
2412
+ case "RESULT_CODE_CONSENSUS_RESPONSE_SIGNATURE_INVALID":
2413
+ case 108:
2414
+ message.result = 108;
2415
+ break;
2416
+ case "RESULT_CODE_CONSENSUS_APPROVAL_SIGNATURE_INVALID":
2417
+ case 109:
2418
+ message.result = 109;
2419
+ break;
2420
+ case "RESULT_CODE_CONSENSUS_OPERATION_TYPE_INVALID":
2421
+ case 110:
2422
+ message.result = 110;
2423
+ break;
2424
+ case "RESULT_CODE_CONSENSUS_RESPONSE_APPROVAL_INVALID":
2425
+ case 111:
2426
+ message.result = 111;
2427
+ break;
2428
+ case "RESULT_CODE_CONSENSUS_EPOCH_INVALID":
2429
+ case 112:
2430
+ message.result = 112;
2431
+ break;
2432
+ case "RESULT_CODE_CONSENSUS_PREVIOUS_EPOCH_RECORD_HASH_INVALID":
2433
+ case 113:
2434
+ message.result = 113;
2435
+ break;
2436
+ case "RESULT_CODE_CONSENSUS_INDEXER_ROLE_INVALID":
2437
+ case 114:
2438
+ message.result = 114;
2439
+ break;
2363
2440
  }
2364
2441
  return message;
2365
2442
  };
@@ -2373,9 +2450,13 @@ $root.network = (function() {
2373
2450
  * @param {$protobuf.IConversionOptions} [options] Conversion options
2374
2451
  * @returns {Object.<string,*>} Plain object
2375
2452
  */
2376
- BroadcastTransactionResponse.toObject = function toObject(message, options) {
2453
+ BroadcastTransactionResponse.toObject = function toObject(message, options, q) {
2377
2454
  if (!options)
2378
2455
  options = {};
2456
+ if (q === undefined)
2457
+ q = 0;
2458
+ if (q > $util.recursionLimit)
2459
+ throw Error("max depth exceeded");
2379
2460
  var object = {};
2380
2461
  if (options.defaults) {
2381
2462
  if (options.bytes === String)
@@ -2401,24 +2482,26 @@ $root.network = (function() {
2401
2482
  }
2402
2483
  if ($util.Long) {
2403
2484
  var long = new $util.Long(0, 0, true);
2404
- object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
2485
+ object.timestamp = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : typeof BigInt !== "undefined" && options.longs === BigInt ? long.toBigInt() : long;
2405
2486
  } else
2406
- object.timestamp = options.longs === String ? "0" : 0;
2487
+ object.timestamp = options.longs === String ? "0" : typeof BigInt !== "undefined" && options.longs === BigInt ? BigInt("0") : 0;
2407
2488
  object.result = options.enums === String ? "RESULT_CODE_UNSPECIFIED" : 0;
2408
2489
  }
2409
- if (message.nonce != null && message.hasOwnProperty("nonce"))
2410
- object.nonce = options.bytes === String ? $util.base64.encode(message.nonce, 0, message.nonce.length) : options.bytes === Array ? Array.prototype.slice.call(message.nonce) : message.nonce;
2411
- if (message.signature != null && message.hasOwnProperty("signature"))
2412
- object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature;
2413
- if (message.proof != null && message.hasOwnProperty("proof"))
2414
- object.proof = options.bytes === String ? $util.base64.encode(message.proof, 0, message.proof.length) : options.bytes === Array ? Array.prototype.slice.call(message.proof) : message.proof;
2415
- if (message.timestamp != null && message.hasOwnProperty("timestamp"))
2416
- if (typeof message.timestamp === "number")
2490
+ if (message.nonce != null && Object.hasOwnProperty.call(message, "nonce"))
2491
+ object.nonce = $util.bytesTo(message.nonce, options);
2492
+ if (message.signature != null && Object.hasOwnProperty.call(message, "signature"))
2493
+ object.signature = $util.bytesTo(message.signature, options);
2494
+ if (message.proof != null && Object.hasOwnProperty.call(message, "proof"))
2495
+ object.proof = $util.bytesTo(message.proof, options);
2496
+ if (message.timestamp != null && Object.hasOwnProperty.call(message, "timestamp"))
2497
+ if (typeof BigInt !== "undefined" && options.longs === BigInt)
2498
+ object.timestamp = typeof message.timestamp === "number" ? BigInt(message.timestamp) : $util.Long.fromBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0, true).toBigInt();
2499
+ else if (typeof message.timestamp === "number")
2417
2500
  object.timestamp = options.longs === String ? String(message.timestamp) : message.timestamp;
2418
2501
  else
2419
2502
  object.timestamp = options.longs === String ? $util.Long.prototype.toString.call(message.timestamp) : options.longs === Number ? new $util.LongBits(message.timestamp.low >>> 0, message.timestamp.high >>> 0).toNumber(true) : message.timestamp;
2420
- if (message.result != null && message.hasOwnProperty("result"))
2421
- object.result = options.enums === String ? $root.network.v1.ResultCode[message.result] === undefined ? message.result : $root.network.v1.ResultCode[message.result] : message.result;
2503
+ if (message.result != null && Object.hasOwnProperty.call(message, "result"))
2504
+ object.result = options.enums === String ? $root.common.v1.ResultCode[message.result] === undefined ? message.result : $root.common.v1.ResultCode[message.result] : message.result;
2422
2505
  return object;
2423
2506
  };
2424
2507
 
@@ -2457,4 +2540,192 @@ $root.network = (function() {
2457
2540
  return network;
2458
2541
  })();
2459
2542
 
2543
+ $root.common = (function() {
2544
+
2545
+ /**
2546
+ * Namespace common.
2547
+ * @exports common
2548
+ * @namespace
2549
+ */
2550
+ var common = {};
2551
+
2552
+ common.v1 = (function() {
2553
+
2554
+ /**
2555
+ * Namespace v1.
2556
+ * @memberof common
2557
+ * @namespace
2558
+ */
2559
+ var v1 = {};
2560
+
2561
+ /**
2562
+ * ResultCode enum.
2563
+ * @name common.v1.ResultCode
2564
+ * @enum {number}
2565
+ * @property {number} RESULT_CODE_UNSPECIFIED=0 RESULT_CODE_UNSPECIFIED value
2566
+ * @property {number} RESULT_CODE_OK=1 RESULT_CODE_OK value
2567
+ * @property {number} RESULT_CODE_INVALID_PAYLOAD=2 RESULT_CODE_INVALID_PAYLOAD value
2568
+ * @property {number} RESULT_CODE_RATE_LIMITED=3 RESULT_CODE_RATE_LIMITED value
2569
+ * @property {number} RESULT_CODE_SIGNATURE_INVALID=4 RESULT_CODE_SIGNATURE_INVALID value
2570
+ * @property {number} RESULT_CODE_UNEXPECTED_ERROR=5 RESULT_CODE_UNEXPECTED_ERROR value
2571
+ * @property {number} RESULT_CODE_TIMEOUT=6 RESULT_CODE_TIMEOUT value
2572
+ * @property {number} RESULT_CODE_NODE_HAS_NO_WRITE_ACCESS=7 RESULT_CODE_NODE_HAS_NO_WRITE_ACCESS value
2573
+ * @property {number} RESULT_CODE_TX_ACCEPTED_PROOF_UNAVAILABLE=8 RESULT_CODE_TX_ACCEPTED_PROOF_UNAVAILABLE value
2574
+ * @property {number} RESULT_CODE_NODE_OVERLOADED=9 RESULT_CODE_NODE_OVERLOADED value
2575
+ * @property {number} RESULT_CODE_TX_ALREADY_PENDING=10 RESULT_CODE_TX_ALREADY_PENDING value
2576
+ * @property {number} RESULT_CODE_OPERATION_TYPE_UNKNOWN=11 RESULT_CODE_OPERATION_TYPE_UNKNOWN value
2577
+ * @property {number} RESULT_CODE_SCHEMA_VALIDATION_FAILED=12 RESULT_CODE_SCHEMA_VALIDATION_FAILED value
2578
+ * @property {number} RESULT_CODE_REQUESTER_ADDRESS_INVALID=13 RESULT_CODE_REQUESTER_ADDRESS_INVALID value
2579
+ * @property {number} RESULT_CODE_REQUESTER_PUBLIC_KEY_INVALID=14 RESULT_CODE_REQUESTER_PUBLIC_KEY_INVALID value
2580
+ * @property {number} RESULT_CODE_TX_HASH_MISMATCH=15 RESULT_CODE_TX_HASH_MISMATCH value
2581
+ * @property {number} RESULT_CODE_TX_SIGNATURE_INVALID=16 RESULT_CODE_TX_SIGNATURE_INVALID value
2582
+ * @property {number} RESULT_CODE_TX_EXPIRED=17 RESULT_CODE_TX_EXPIRED value
2583
+ * @property {number} RESULT_CODE_TX_ALREADY_EXISTS=18 RESULT_CODE_TX_ALREADY_EXISTS value
2584
+ * @property {number} RESULT_CODE_OPERATION_ALREADY_COMPLETED=19 RESULT_CODE_OPERATION_ALREADY_COMPLETED value
2585
+ * @property {number} RESULT_CODE_REQUESTER_NOT_FOUND=20 RESULT_CODE_REQUESTER_NOT_FOUND value
2586
+ * @property {number} RESULT_CODE_INSUFFICIENT_FEE_BALANCE=21 RESULT_CODE_INSUFFICIENT_FEE_BALANCE value
2587
+ * @property {number} RESULT_CODE_EXTERNAL_BOOTSTRAP_EQUALS_MSB_BOOTSTRAP=22 RESULT_CODE_EXTERNAL_BOOTSTRAP_EQUALS_MSB_BOOTSTRAP value
2588
+ * @property {number} RESULT_CODE_SELF_VALIDATION_FORBIDDEN=23 RESULT_CODE_SELF_VALIDATION_FORBIDDEN value
2589
+ * @property {number} RESULT_CODE_ROLE_NODE_ENTRY_NOT_FOUND=24 RESULT_CODE_ROLE_NODE_ENTRY_NOT_FOUND value
2590
+ * @property {number} RESULT_CODE_ROLE_NODE_ALREADY_WRITER=25 RESULT_CODE_ROLE_NODE_ALREADY_WRITER value
2591
+ * @property {number} RESULT_CODE_ROLE_NODE_NOT_WHITELISTED=26 RESULT_CODE_ROLE_NODE_NOT_WHITELISTED value
2592
+ * @property {number} RESULT_CODE_ROLE_NODE_NOT_WRITER=27 RESULT_CODE_ROLE_NODE_NOT_WRITER value
2593
+ * @property {number} RESULT_CODE_ROLE_NODE_IS_INDEXER=28 RESULT_CODE_ROLE_NODE_IS_INDEXER value
2594
+ * @property {number} RESULT_CODE_ROLE_ADMIN_ENTRY_MISSING=29 RESULT_CODE_ROLE_ADMIN_ENTRY_MISSING value
2595
+ * @property {number} RESULT_CODE_ROLE_INVALID_RECOVERY_CASE=30 RESULT_CODE_ROLE_INVALID_RECOVERY_CASE value
2596
+ * @property {number} RESULT_CODE_ROLE_UNKNOWN_OPERATION=31 RESULT_CODE_ROLE_UNKNOWN_OPERATION value
2597
+ * @property {number} RESULT_CODE_ROLE_INVALID_WRITER_KEY=32 RESULT_CODE_ROLE_INVALID_WRITER_KEY value
2598
+ * @property {number} RESULT_CODE_ROLE_INSUFFICIENT_FEE_BALANCE=33 RESULT_CODE_ROLE_INSUFFICIENT_FEE_BALANCE value
2599
+ * @property {number} RESULT_CODE_MSB_BOOTSTRAP_MISMATCH=34 RESULT_CODE_MSB_BOOTSTRAP_MISMATCH value
2600
+ * @property {number} RESULT_CODE_EXTERNAL_BOOTSTRAP_NOT_DEPLOYED=35 RESULT_CODE_EXTERNAL_BOOTSTRAP_NOT_DEPLOYED value
2601
+ * @property {number} RESULT_CODE_EXTERNAL_BOOTSTRAP_TX_MISSING=36 RESULT_CODE_EXTERNAL_BOOTSTRAP_TX_MISSING value
2602
+ * @property {number} RESULT_CODE_EXTERNAL_BOOTSTRAP_MISMATCH=37 RESULT_CODE_EXTERNAL_BOOTSTRAP_MISMATCH value
2603
+ * @property {number} RESULT_CODE_BOOTSTRAP_ALREADY_EXISTS=38 RESULT_CODE_BOOTSTRAP_ALREADY_EXISTS value
2604
+ * @property {number} RESULT_CODE_TRANSFER_RECIPIENT_ADDRESS_INVALID=39 RESULT_CODE_TRANSFER_RECIPIENT_ADDRESS_INVALID value
2605
+ * @property {number} RESULT_CODE_TRANSFER_RECIPIENT_PUBLIC_KEY_INVALID=40 RESULT_CODE_TRANSFER_RECIPIENT_PUBLIC_KEY_INVALID value
2606
+ * @property {number} RESULT_CODE_TRANSFER_AMOUNT_TOO_LARGE=41 RESULT_CODE_TRANSFER_AMOUNT_TOO_LARGE value
2607
+ * @property {number} RESULT_CODE_TRANSFER_SENDER_NOT_FOUND=42 RESULT_CODE_TRANSFER_SENDER_NOT_FOUND value
2608
+ * @property {number} RESULT_CODE_TRANSFER_INSUFFICIENT_BALANCE=43 RESULT_CODE_TRANSFER_INSUFFICIENT_BALANCE value
2609
+ * @property {number} RESULT_CODE_TRANSFER_RECIPIENT_BALANCE_OVERFLOW=44 RESULT_CODE_TRANSFER_RECIPIENT_BALANCE_OVERFLOW value
2610
+ * @property {number} RESULT_CODE_TX_HASH_INVALID_FORMAT=45 RESULT_CODE_TX_HASH_INVALID_FORMAT value
2611
+ * @property {number} RESULT_CODE_INTERNAL_ENQUEUE_VALIDATION_FAILED=46 RESULT_CODE_INTERNAL_ENQUEUE_VALIDATION_FAILED value
2612
+ * @property {number} RESULT_CODE_TX_COMMITTED_RECEIPT_MISSING=47 RESULT_CODE_TX_COMMITTED_RECEIPT_MISSING value
2613
+ * @property {number} RESULT_CODE_VALIDATOR_RESPONSE_TX_TYPE_INVALID=48 RESULT_CODE_VALIDATOR_RESPONSE_TX_TYPE_INVALID value
2614
+ * @property {number} RESULT_CODE_VALIDATOR_RESPONSE_TX_TYPE_UNKNOWN=49 RESULT_CODE_VALIDATOR_RESPONSE_TX_TYPE_UNKNOWN value
2615
+ * @property {number} RESULT_CODE_VALIDATOR_RESPONSE_TX_TYPE_UNSUPPORTED=50 RESULT_CODE_VALIDATOR_RESPONSE_TX_TYPE_UNSUPPORTED value
2616
+ * @property {number} RESULT_CODE_VALIDATOR_RESPONSE_SCHEMA_INVALID=51 RESULT_CODE_VALIDATOR_RESPONSE_SCHEMA_INVALID value
2617
+ * @property {number} RESULT_CODE_PENDING_REQUEST_MISSING_TX_DATA=52 RESULT_CODE_PENDING_REQUEST_MISSING_TX_DATA value
2618
+ * @property {number} RESULT_CODE_PROOF_PAYLOAD_MISMATCH=53 RESULT_CODE_PROOF_PAYLOAD_MISMATCH value
2619
+ * @property {number} RESULT_CODE_VALIDATOR_WRITER_KEY_NOT_REGISTERED=54 RESULT_CODE_VALIDATOR_WRITER_KEY_NOT_REGISTERED value
2620
+ * @property {number} RESULT_CODE_VALIDATOR_ADDRESS_MISMATCH=55 RESULT_CODE_VALIDATOR_ADDRESS_MISMATCH value
2621
+ * @property {number} RESULT_CODE_VALIDATOR_NODE_ENTRY_NOT_FOUND=56 RESULT_CODE_VALIDATOR_NODE_ENTRY_NOT_FOUND value
2622
+ * @property {number} RESULT_CODE_VALIDATOR_NODE_NOT_WRITER=57 RESULT_CODE_VALIDATOR_NODE_NOT_WRITER value
2623
+ * @property {number} RESULT_CODE_VALIDATOR_WRITER_KEY_MISMATCH=58 RESULT_CODE_VALIDATOR_WRITER_KEY_MISMATCH value
2624
+ * @property {number} RESULT_CODE_VALIDATOR_TX_OBJECT_INVALID=59 RESULT_CODE_VALIDATOR_TX_OBJECT_INVALID value
2625
+ * @property {number} RESULT_CODE_VALIDATOR_VA_MISSING=60 RESULT_CODE_VALIDATOR_VA_MISSING value
2626
+ * @property {number} RESULT_CODE_TX_INVALID_PAYLOAD=61 RESULT_CODE_TX_INVALID_PAYLOAD value
2627
+ * @property {number} RESULT_CODE_CONSENSUS_SCHEMA_VALIDATION_FAILED=100 RESULT_CODE_CONSENSUS_SCHEMA_VALIDATION_FAILED value
2628
+ * @property {number} RESULT_CODE_CONSENSUS_BAD_PROTOCOL_VERSION=101 RESULT_CODE_CONSENSUS_BAD_PROTOCOL_VERSION value
2629
+ * @property {number} RESULT_CODE_CONSENSUS_WRONG_NETWORK_ID=102 RESULT_CODE_CONSENSUS_WRONG_NETWORK_ID value
2630
+ * @property {number} RESULT_CODE_CONSENSUS_CONFIG_MISMATCH=103 RESULT_CODE_CONSENSUS_CONFIG_MISMATCH value
2631
+ * @property {number} RESULT_CODE_CONSENSUS_VDF_PROOF_INVALID=104 RESULT_CODE_CONSENSUS_VDF_PROOF_INVALID value
2632
+ * @property {number} RESULT_CODE_CONSENSUS_ADDRESS_INVALID=105 RESULT_CODE_CONSENSUS_ADDRESS_INVALID value
2633
+ * @property {number} RESULT_CODE_CONSENSUS_PUBLIC_KEY_MISMATCH=106 RESULT_CODE_CONSENSUS_PUBLIC_KEY_MISMATCH value
2634
+ * @property {number} RESULT_CODE_CONSENSUS_PROPOSAL_SIGNATURE_INVALID=107 RESULT_CODE_CONSENSUS_PROPOSAL_SIGNATURE_INVALID value
2635
+ * @property {number} RESULT_CODE_CONSENSUS_RESPONSE_SIGNATURE_INVALID=108 RESULT_CODE_CONSENSUS_RESPONSE_SIGNATURE_INVALID value
2636
+ * @property {number} RESULT_CODE_CONSENSUS_APPROVAL_SIGNATURE_INVALID=109 RESULT_CODE_CONSENSUS_APPROVAL_SIGNATURE_INVALID value
2637
+ * @property {number} RESULT_CODE_CONSENSUS_OPERATION_TYPE_INVALID=110 RESULT_CODE_CONSENSUS_OPERATION_TYPE_INVALID value
2638
+ * @property {number} RESULT_CODE_CONSENSUS_RESPONSE_APPROVAL_INVALID=111 RESULT_CODE_CONSENSUS_RESPONSE_APPROVAL_INVALID value
2639
+ * @property {number} RESULT_CODE_CONSENSUS_EPOCH_INVALID=112 RESULT_CODE_CONSENSUS_EPOCH_INVALID value
2640
+ * @property {number} RESULT_CODE_CONSENSUS_PREVIOUS_EPOCH_RECORD_HASH_INVALID=113 RESULT_CODE_CONSENSUS_PREVIOUS_EPOCH_RECORD_HASH_INVALID value
2641
+ * @property {number} RESULT_CODE_CONSENSUS_INDEXER_ROLE_INVALID=114 RESULT_CODE_CONSENSUS_INDEXER_ROLE_INVALID value
2642
+ */
2643
+ v1.ResultCode = (function() {
2644
+ var valuesById = {}, values = Object.create(valuesById);
2645
+ values[valuesById[0] = "RESULT_CODE_UNSPECIFIED"] = 0;
2646
+ values[valuesById[1] = "RESULT_CODE_OK"] = 1;
2647
+ values[valuesById[2] = "RESULT_CODE_INVALID_PAYLOAD"] = 2;
2648
+ values[valuesById[3] = "RESULT_CODE_RATE_LIMITED"] = 3;
2649
+ values[valuesById[4] = "RESULT_CODE_SIGNATURE_INVALID"] = 4;
2650
+ values[valuesById[5] = "RESULT_CODE_UNEXPECTED_ERROR"] = 5;
2651
+ values[valuesById[6] = "RESULT_CODE_TIMEOUT"] = 6;
2652
+ values[valuesById[7] = "RESULT_CODE_NODE_HAS_NO_WRITE_ACCESS"] = 7;
2653
+ values[valuesById[8] = "RESULT_CODE_TX_ACCEPTED_PROOF_UNAVAILABLE"] = 8;
2654
+ values[valuesById[9] = "RESULT_CODE_NODE_OVERLOADED"] = 9;
2655
+ values[valuesById[10] = "RESULT_CODE_TX_ALREADY_PENDING"] = 10;
2656
+ values[valuesById[11] = "RESULT_CODE_OPERATION_TYPE_UNKNOWN"] = 11;
2657
+ values[valuesById[12] = "RESULT_CODE_SCHEMA_VALIDATION_FAILED"] = 12;
2658
+ values[valuesById[13] = "RESULT_CODE_REQUESTER_ADDRESS_INVALID"] = 13;
2659
+ values[valuesById[14] = "RESULT_CODE_REQUESTER_PUBLIC_KEY_INVALID"] = 14;
2660
+ values[valuesById[15] = "RESULT_CODE_TX_HASH_MISMATCH"] = 15;
2661
+ values[valuesById[16] = "RESULT_CODE_TX_SIGNATURE_INVALID"] = 16;
2662
+ values[valuesById[17] = "RESULT_CODE_TX_EXPIRED"] = 17;
2663
+ values[valuesById[18] = "RESULT_CODE_TX_ALREADY_EXISTS"] = 18;
2664
+ values[valuesById[19] = "RESULT_CODE_OPERATION_ALREADY_COMPLETED"] = 19;
2665
+ values[valuesById[20] = "RESULT_CODE_REQUESTER_NOT_FOUND"] = 20;
2666
+ values[valuesById[21] = "RESULT_CODE_INSUFFICIENT_FEE_BALANCE"] = 21;
2667
+ values[valuesById[22] = "RESULT_CODE_EXTERNAL_BOOTSTRAP_EQUALS_MSB_BOOTSTRAP"] = 22;
2668
+ values[valuesById[23] = "RESULT_CODE_SELF_VALIDATION_FORBIDDEN"] = 23;
2669
+ values[valuesById[24] = "RESULT_CODE_ROLE_NODE_ENTRY_NOT_FOUND"] = 24;
2670
+ values[valuesById[25] = "RESULT_CODE_ROLE_NODE_ALREADY_WRITER"] = 25;
2671
+ values[valuesById[26] = "RESULT_CODE_ROLE_NODE_NOT_WHITELISTED"] = 26;
2672
+ values[valuesById[27] = "RESULT_CODE_ROLE_NODE_NOT_WRITER"] = 27;
2673
+ values[valuesById[28] = "RESULT_CODE_ROLE_NODE_IS_INDEXER"] = 28;
2674
+ values[valuesById[29] = "RESULT_CODE_ROLE_ADMIN_ENTRY_MISSING"] = 29;
2675
+ values[valuesById[30] = "RESULT_CODE_ROLE_INVALID_RECOVERY_CASE"] = 30;
2676
+ values[valuesById[31] = "RESULT_CODE_ROLE_UNKNOWN_OPERATION"] = 31;
2677
+ values[valuesById[32] = "RESULT_CODE_ROLE_INVALID_WRITER_KEY"] = 32;
2678
+ values[valuesById[33] = "RESULT_CODE_ROLE_INSUFFICIENT_FEE_BALANCE"] = 33;
2679
+ values[valuesById[34] = "RESULT_CODE_MSB_BOOTSTRAP_MISMATCH"] = 34;
2680
+ values[valuesById[35] = "RESULT_CODE_EXTERNAL_BOOTSTRAP_NOT_DEPLOYED"] = 35;
2681
+ values[valuesById[36] = "RESULT_CODE_EXTERNAL_BOOTSTRAP_TX_MISSING"] = 36;
2682
+ values[valuesById[37] = "RESULT_CODE_EXTERNAL_BOOTSTRAP_MISMATCH"] = 37;
2683
+ values[valuesById[38] = "RESULT_CODE_BOOTSTRAP_ALREADY_EXISTS"] = 38;
2684
+ values[valuesById[39] = "RESULT_CODE_TRANSFER_RECIPIENT_ADDRESS_INVALID"] = 39;
2685
+ values[valuesById[40] = "RESULT_CODE_TRANSFER_RECIPIENT_PUBLIC_KEY_INVALID"] = 40;
2686
+ values[valuesById[41] = "RESULT_CODE_TRANSFER_AMOUNT_TOO_LARGE"] = 41;
2687
+ values[valuesById[42] = "RESULT_CODE_TRANSFER_SENDER_NOT_FOUND"] = 42;
2688
+ values[valuesById[43] = "RESULT_CODE_TRANSFER_INSUFFICIENT_BALANCE"] = 43;
2689
+ values[valuesById[44] = "RESULT_CODE_TRANSFER_RECIPIENT_BALANCE_OVERFLOW"] = 44;
2690
+ values[valuesById[45] = "RESULT_CODE_TX_HASH_INVALID_FORMAT"] = 45;
2691
+ values[valuesById[46] = "RESULT_CODE_INTERNAL_ENQUEUE_VALIDATION_FAILED"] = 46;
2692
+ values[valuesById[47] = "RESULT_CODE_TX_COMMITTED_RECEIPT_MISSING"] = 47;
2693
+ values[valuesById[48] = "RESULT_CODE_VALIDATOR_RESPONSE_TX_TYPE_INVALID"] = 48;
2694
+ values[valuesById[49] = "RESULT_CODE_VALIDATOR_RESPONSE_TX_TYPE_UNKNOWN"] = 49;
2695
+ values[valuesById[50] = "RESULT_CODE_VALIDATOR_RESPONSE_TX_TYPE_UNSUPPORTED"] = 50;
2696
+ values[valuesById[51] = "RESULT_CODE_VALIDATOR_RESPONSE_SCHEMA_INVALID"] = 51;
2697
+ values[valuesById[52] = "RESULT_CODE_PENDING_REQUEST_MISSING_TX_DATA"] = 52;
2698
+ values[valuesById[53] = "RESULT_CODE_PROOF_PAYLOAD_MISMATCH"] = 53;
2699
+ values[valuesById[54] = "RESULT_CODE_VALIDATOR_WRITER_KEY_NOT_REGISTERED"] = 54;
2700
+ values[valuesById[55] = "RESULT_CODE_VALIDATOR_ADDRESS_MISMATCH"] = 55;
2701
+ values[valuesById[56] = "RESULT_CODE_VALIDATOR_NODE_ENTRY_NOT_FOUND"] = 56;
2702
+ values[valuesById[57] = "RESULT_CODE_VALIDATOR_NODE_NOT_WRITER"] = 57;
2703
+ values[valuesById[58] = "RESULT_CODE_VALIDATOR_WRITER_KEY_MISMATCH"] = 58;
2704
+ values[valuesById[59] = "RESULT_CODE_VALIDATOR_TX_OBJECT_INVALID"] = 59;
2705
+ values[valuesById[60] = "RESULT_CODE_VALIDATOR_VA_MISSING"] = 60;
2706
+ values[valuesById[61] = "RESULT_CODE_TX_INVALID_PAYLOAD"] = 61;
2707
+ values[valuesById[100] = "RESULT_CODE_CONSENSUS_SCHEMA_VALIDATION_FAILED"] = 100;
2708
+ values[valuesById[101] = "RESULT_CODE_CONSENSUS_BAD_PROTOCOL_VERSION"] = 101;
2709
+ values[valuesById[102] = "RESULT_CODE_CONSENSUS_WRONG_NETWORK_ID"] = 102;
2710
+ values[valuesById[103] = "RESULT_CODE_CONSENSUS_CONFIG_MISMATCH"] = 103;
2711
+ values[valuesById[104] = "RESULT_CODE_CONSENSUS_VDF_PROOF_INVALID"] = 104;
2712
+ values[valuesById[105] = "RESULT_CODE_CONSENSUS_ADDRESS_INVALID"] = 105;
2713
+ values[valuesById[106] = "RESULT_CODE_CONSENSUS_PUBLIC_KEY_MISMATCH"] = 106;
2714
+ values[valuesById[107] = "RESULT_CODE_CONSENSUS_PROPOSAL_SIGNATURE_INVALID"] = 107;
2715
+ values[valuesById[108] = "RESULT_CODE_CONSENSUS_RESPONSE_SIGNATURE_INVALID"] = 108;
2716
+ values[valuesById[109] = "RESULT_CODE_CONSENSUS_APPROVAL_SIGNATURE_INVALID"] = 109;
2717
+ values[valuesById[110] = "RESULT_CODE_CONSENSUS_OPERATION_TYPE_INVALID"] = 110;
2718
+ values[valuesById[111] = "RESULT_CODE_CONSENSUS_RESPONSE_APPROVAL_INVALID"] = 111;
2719
+ values[valuesById[112] = "RESULT_CODE_CONSENSUS_EPOCH_INVALID"] = 112;
2720
+ values[valuesById[113] = "RESULT_CODE_CONSENSUS_PREVIOUS_EPOCH_RECORD_HASH_INVALID"] = 113;
2721
+ values[valuesById[114] = "RESULT_CODE_CONSENSUS_INDEXER_ROLE_INVALID"] = 114;
2722
+ return values;
2723
+ })();
2724
+
2725
+ return v1;
2726
+ })();
2727
+
2728
+ return common;
2729
+ })();
2730
+
2460
2731
  module.exports = $root;