koilib 5.6.1 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. package/LICENSE +21 -21
  2. package/dist/koinos.js +1493 -637
  3. package/dist/koinos.min.js +1 -1
  4. package/lib/Contract.d.ts +4 -4
  5. package/lib/Contract.js +4 -4
  6. package/lib/Contract.js.map +1 -1
  7. package/lib/Provider.d.ts +42 -12
  8. package/lib/Provider.js +99 -6
  9. package/lib/Provider.js.map +1 -1
  10. package/lib/Serializer.d.ts +20 -0
  11. package/lib/Serializer.js +4 -0
  12. package/lib/Serializer.js.map +1 -1
  13. package/lib/Signer.d.ts +0 -10
  14. package/lib/Signer.js +1 -123
  15. package/lib/Signer.js.map +1 -1
  16. package/lib/Transaction.d.ts +3 -3
  17. package/lib/Transaction.js +4 -4
  18. package/lib/Transaction.js.map +1 -1
  19. package/lib/browser/Contract.d.ts +4 -4
  20. package/lib/browser/Contract.js +4 -4
  21. package/lib/browser/Contract.js.map +1 -1
  22. package/lib/browser/Provider.d.ts +42 -12
  23. package/lib/browser/Provider.js +99 -6
  24. package/lib/browser/Provider.js.map +1 -1
  25. package/lib/browser/Serializer.d.ts +20 -0
  26. package/lib/browser/Serializer.js +4 -0
  27. package/lib/browser/Serializer.js.map +1 -1
  28. package/lib/browser/Signer.d.ts +0 -10
  29. package/lib/browser/Signer.js +1 -123
  30. package/lib/browser/Signer.js.map +1 -1
  31. package/lib/browser/Transaction.d.ts +3 -3
  32. package/lib/browser/Transaction.js +4 -4
  33. package/lib/browser/Transaction.js.map +1 -1
  34. package/lib/browser/index.d.ts +1 -1
  35. package/lib/browser/index.js +2 -2
  36. package/lib/browser/index.js.map +1 -1
  37. package/lib/browser/interface.d.ts +17 -2
  38. package/lib/browser/jsonDescriptors/chain-proto.json +74 -3
  39. package/lib/browser/jsonDescriptors/token-proto.json +5 -26
  40. package/lib/browser/protoModules/protocol-proto.js +823 -0
  41. package/lib/browser/protoModules/protocol-proto.js.map +1 -1
  42. package/lib/browser/utilsNode.d.ts +72 -117
  43. package/lib/index.d.ts +1 -1
  44. package/lib/index.js +2 -2
  45. package/lib/index.js.map +1 -1
  46. package/lib/interface.d.ts +17 -2
  47. package/lib/jsonDescriptors/chain-proto.json +74 -3
  48. package/lib/jsonDescriptors/token-proto.json +5 -26
  49. package/lib/protoModules/protocol-proto.js +823 -0
  50. package/lib/protoModules/protocol-proto.js.map +1 -1
  51. package/lib/utilsNode.d.ts +72 -117
  52. package/package.json +1 -1
  53. package/src/Contract.ts +6 -5
  54. package/src/Provider.ts +150 -20
  55. package/src/Serializer.ts +27 -0
  56. package/src/Signer.ts +1 -150
  57. package/src/Transaction.ts +8 -8
  58. package/src/index.ts +1 -1
  59. package/src/interface.ts +19 -2
  60. package/src/jsonDescriptors/chain-proto.json +74 -3
  61. package/src/jsonDescriptors/pow-proto.json +1 -1
  62. package/src/jsonDescriptors/token-proto.json +5 -26
  63. package/src/jsonDescriptors/value-proto.json +13 -23
  64. package/src/protoModules/protocol-proto.js +1043 -4
@@ -38,6 +38,285 @@
38
38
  */
39
39
  var protocol = {};
40
40
 
41
+ protocol.object_space = (function () {
42
+ /**
43
+ * Properties of an object_space.
44
+ * @memberof koinos.protocol
45
+ * @interface Iobject_space
46
+ * @property {boolean|null} [system] object_space system
47
+ * @property {Uint8Array|null} [zone] object_space zone
48
+ * @property {number|null} [id] object_space id
49
+ */
50
+
51
+ /**
52
+ * Constructs a new object_space.
53
+ * @memberof koinos.protocol
54
+ * @classdesc Represents an object_space.
55
+ * @implements Iobject_space
56
+ * @constructor
57
+ * @param {koinos.protocol.Iobject_space=} [properties] Properties to set
58
+ */
59
+ function object_space(properties) {
60
+ if (properties)
61
+ for (
62
+ var keys = Object.keys(properties), i = 0;
63
+ i < keys.length;
64
+ ++i
65
+ )
66
+ if (properties[keys[i]] != null)
67
+ this[keys[i]] = properties[keys[i]];
68
+ }
69
+
70
+ /**
71
+ * object_space system.
72
+ * @member {boolean} system
73
+ * @memberof koinos.protocol.object_space
74
+ * @instance
75
+ */
76
+ object_space.prototype.system = false;
77
+
78
+ /**
79
+ * object_space zone.
80
+ * @member {Uint8Array} zone
81
+ * @memberof koinos.protocol.object_space
82
+ * @instance
83
+ */
84
+ object_space.prototype.zone = $util.newBuffer([]);
85
+
86
+ /**
87
+ * object_space id.
88
+ * @member {number} id
89
+ * @memberof koinos.protocol.object_space
90
+ * @instance
91
+ */
92
+ object_space.prototype.id = 0;
93
+
94
+ /**
95
+ * Creates a new object_space instance using the specified properties.
96
+ * @function create
97
+ * @memberof koinos.protocol.object_space
98
+ * @static
99
+ * @param {koinos.protocol.Iobject_space=} [properties] Properties to set
100
+ * @returns {koinos.protocol.object_space} object_space instance
101
+ */
102
+ object_space.create = function create(properties) {
103
+ return new object_space(properties);
104
+ };
105
+
106
+ /**
107
+ * Encodes the specified object_space message. Does not implicitly {@link koinos.protocol.object_space.verify|verify} messages.
108
+ * @function encode
109
+ * @memberof koinos.protocol.object_space
110
+ * @static
111
+ * @param {koinos.protocol.Iobject_space} message object_space message or plain object to encode
112
+ * @param {$protobuf.Writer} [writer] Writer to encode to
113
+ * @returns {$protobuf.Writer} Writer
114
+ */
115
+ object_space.encode = function encode(message, writer) {
116
+ if (!writer) writer = $Writer.create();
117
+ if (
118
+ message.system != null &&
119
+ Object.hasOwnProperty.call(message, "system")
120
+ )
121
+ writer.uint32(/* id 1, wireType 0 =*/ 8).bool(message.system);
122
+ if (
123
+ message.zone != null &&
124
+ Object.hasOwnProperty.call(message, "zone")
125
+ )
126
+ writer.uint32(/* id 2, wireType 2 =*/ 18).bytes(message.zone);
127
+ if (message.id != null && Object.hasOwnProperty.call(message, "id"))
128
+ writer.uint32(/* id 3, wireType 0 =*/ 24).uint32(message.id);
129
+ return writer;
130
+ };
131
+
132
+ /**
133
+ * Encodes the specified object_space message, length delimited. Does not implicitly {@link koinos.protocol.object_space.verify|verify} messages.
134
+ * @function encodeDelimited
135
+ * @memberof koinos.protocol.object_space
136
+ * @static
137
+ * @param {koinos.protocol.Iobject_space} message object_space message or plain object to encode
138
+ * @param {$protobuf.Writer} [writer] Writer to encode to
139
+ * @returns {$protobuf.Writer} Writer
140
+ */
141
+ object_space.encodeDelimited = function encodeDelimited(
142
+ message,
143
+ writer
144
+ ) {
145
+ return this.encode(message, writer).ldelim();
146
+ };
147
+
148
+ /**
149
+ * Decodes an object_space message from the specified reader or buffer.
150
+ * @function decode
151
+ * @memberof koinos.protocol.object_space
152
+ * @static
153
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
154
+ * @param {number} [length] Message length if known beforehand
155
+ * @returns {koinos.protocol.object_space} object_space
156
+ * @throws {Error} If the payload is not a reader or valid buffer
157
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
158
+ */
159
+ object_space.decode = function decode(reader, length) {
160
+ if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
161
+ var end = length === undefined ? reader.len : reader.pos + length,
162
+ message = new $root.koinos.protocol.object_space();
163
+ while (reader.pos < end) {
164
+ var tag = reader.uint32();
165
+ switch (tag >>> 3) {
166
+ case 1: {
167
+ message.system = reader.bool();
168
+ break;
169
+ }
170
+ case 2: {
171
+ message.zone = reader.bytes();
172
+ break;
173
+ }
174
+ case 3: {
175
+ message.id = reader.uint32();
176
+ break;
177
+ }
178
+ default:
179
+ reader.skipType(tag & 7);
180
+ break;
181
+ }
182
+ }
183
+ return message;
184
+ };
185
+
186
+ /**
187
+ * Decodes an object_space message from the specified reader or buffer, length delimited.
188
+ * @function decodeDelimited
189
+ * @memberof koinos.protocol.object_space
190
+ * @static
191
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
192
+ * @returns {koinos.protocol.object_space} object_space
193
+ * @throws {Error} If the payload is not a reader or valid buffer
194
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
195
+ */
196
+ object_space.decodeDelimited = function decodeDelimited(reader) {
197
+ if (!(reader instanceof $Reader)) reader = new $Reader(reader);
198
+ return this.decode(reader, reader.uint32());
199
+ };
200
+
201
+ /**
202
+ * Verifies an object_space message.
203
+ * @function verify
204
+ * @memberof koinos.protocol.object_space
205
+ * @static
206
+ * @param {Object.<string,*>} message Plain object to verify
207
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
208
+ */
209
+ object_space.verify = function verify(message) {
210
+ if (typeof message !== "object" || message === null)
211
+ return "object expected";
212
+ if (message.system != null && message.hasOwnProperty("system"))
213
+ if (typeof message.system !== "boolean")
214
+ return "system: boolean expected";
215
+ if (message.zone != null && message.hasOwnProperty("zone"))
216
+ if (
217
+ !(
218
+ (message.zone && typeof message.zone.length === "number") ||
219
+ $util.isString(message.zone)
220
+ )
221
+ )
222
+ return "zone: buffer expected";
223
+ if (message.id != null && message.hasOwnProperty("id"))
224
+ if (!$util.isInteger(message.id)) return "id: integer expected";
225
+ return null;
226
+ };
227
+
228
+ /**
229
+ * Creates an object_space message from a plain object. Also converts values to their respective internal types.
230
+ * @function fromObject
231
+ * @memberof koinos.protocol.object_space
232
+ * @static
233
+ * @param {Object.<string,*>} object Plain object
234
+ * @returns {koinos.protocol.object_space} object_space
235
+ */
236
+ object_space.fromObject = function fromObject(object) {
237
+ if (object instanceof $root.koinos.protocol.object_space)
238
+ return object;
239
+ var message = new $root.koinos.protocol.object_space();
240
+ if (object.system != null) message.system = Boolean(object.system);
241
+ if (object.zone != null)
242
+ if (typeof object.zone === "string")
243
+ $util.base64.decode(
244
+ object.zone,
245
+ (message.zone = $util.newBuffer(
246
+ $util.base64.length(object.zone)
247
+ )),
248
+ 0
249
+ );
250
+ else if (object.zone.length >= 0) message.zone = object.zone;
251
+ if (object.id != null) message.id = object.id >>> 0;
252
+ return message;
253
+ };
254
+
255
+ /**
256
+ * Creates a plain object from an object_space message. Also converts values to other types if specified.
257
+ * @function toObject
258
+ * @memberof koinos.protocol.object_space
259
+ * @static
260
+ * @param {koinos.protocol.object_space} message object_space
261
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
262
+ * @returns {Object.<string,*>} Plain object
263
+ */
264
+ object_space.toObject = function toObject(message, options) {
265
+ if (!options) options = {};
266
+ var object = {};
267
+ if (options.defaults) {
268
+ object.system = false;
269
+ if (options.bytes === String) object.zone = "";
270
+ else {
271
+ object.zone = [];
272
+ if (options.bytes !== Array)
273
+ object.zone = $util.newBuffer(object.zone);
274
+ }
275
+ object.id = 0;
276
+ }
277
+ if (message.system != null && message.hasOwnProperty("system"))
278
+ object.system = message.system;
279
+ if (message.zone != null && message.hasOwnProperty("zone"))
280
+ object.zone =
281
+ options.bytes === String
282
+ ? $util.base64.encode(message.zone, 0, message.zone.length)
283
+ : options.bytes === Array
284
+ ? Array.prototype.slice.call(message.zone)
285
+ : message.zone;
286
+ if (message.id != null && message.hasOwnProperty("id"))
287
+ object.id = message.id;
288
+ return object;
289
+ };
290
+
291
+ /**
292
+ * Converts this object_space to JSON.
293
+ * @function toJSON
294
+ * @memberof koinos.protocol.object_space
295
+ * @instance
296
+ * @returns {Object.<string,*>} JSON object
297
+ */
298
+ object_space.prototype.toJSON = function toJSON() {
299
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
300
+ };
301
+
302
+ /**
303
+ * Gets the default type url for object_space
304
+ * @function getTypeUrl
305
+ * @memberof koinos.protocol.object_space
306
+ * @static
307
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
308
+ * @returns {string} The default type url
309
+ */
310
+ object_space.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
311
+ if (typeUrlPrefix === undefined) {
312
+ typeUrlPrefix = "type.googleapis.com";
313
+ }
314
+ return typeUrlPrefix + "/koinos.protocol.object_space";
315
+ };
316
+
317
+ return object_space;
318
+ })();
319
+
41
320
  protocol.event_data = (function () {
42
321
  /**
43
322
  * Properties of an event_data.
@@ -3742,6 +4021,7 @@
3742
4021
  * @property {boolean|null} [reverted] transaction_receipt reverted
3743
4022
  * @property {Array.<koinos.protocol.Ievent_data>|null} [events] transaction_receipt events
3744
4023
  * @property {Array.<string>|null} [logs] transaction_receipt logs
4024
+ * @property {Array.<koinos.protocol.Istate_delta_entry>|null} [state_delta_entries] transaction_receipt state_delta_entries
3745
4025
  */
3746
4026
 
3747
4027
  /**
@@ -3755,6 +4035,7 @@
3755
4035
  function transaction_receipt(properties) {
3756
4036
  this.events = [];
3757
4037
  this.logs = [];
4038
+ this.state_delta_entries = [];
3758
4039
  if (properties)
3759
4040
  for (
3760
4041
  var keys = Object.keys(properties), i = 0;
@@ -3865,6 +4146,14 @@
3865
4146
  */
3866
4147
  transaction_receipt.prototype.logs = $util.emptyArray;
3867
4148
 
4149
+ /**
4150
+ * transaction_receipt state_delta_entries.
4151
+ * @member {Array.<koinos.protocol.Istate_delta_entry>} state_delta_entries
4152
+ * @memberof koinos.protocol.transaction_receipt
4153
+ * @instance
4154
+ */
4155
+ transaction_receipt.prototype.state_delta_entries = $util.emptyArray;
4156
+
3868
4157
  /**
3869
4158
  * Creates a new transaction_receipt instance using the specified properties.
3870
4159
  * @function create
@@ -3951,6 +4240,17 @@
3951
4240
  writer
3952
4241
  .uint32(/* id 11, wireType 2 =*/ 90)
3953
4242
  .string(message.logs[i]);
4243
+ if (
4244
+ message.state_delta_entries != null &&
4245
+ message.state_delta_entries.length
4246
+ )
4247
+ for (var i = 0; i < message.state_delta_entries.length; ++i)
4248
+ $root.koinos.protocol.state_delta_entry
4249
+ .encode(
4250
+ message.state_delta_entries[i],
4251
+ writer.uint32(/* id 12, wireType 2 =*/ 98).fork()
4252
+ )
4253
+ .ldelim();
3954
4254
  return writer;
3955
4255
  };
3956
4256
 
@@ -4040,6 +4340,22 @@
4040
4340
  message.logs.push(reader.string());
4041
4341
  break;
4042
4342
  }
4343
+ case 12: {
4344
+ if (
4345
+ !(
4346
+ message.state_delta_entries &&
4347
+ message.state_delta_entries.length
4348
+ )
4349
+ )
4350
+ message.state_delta_entries = [];
4351
+ message.state_delta_entries.push(
4352
+ $root.koinos.protocol.state_delta_entry.decode(
4353
+ reader,
4354
+ reader.uint32()
4355
+ )
4356
+ );
4357
+ break;
4358
+ }
4043
4359
  default:
4044
4360
  reader.skipType(tag & 7);
4045
4361
  break;
@@ -4180,6 +4496,19 @@
4180
4496
  if (!$util.isString(message.logs[i]))
4181
4497
  return "logs: string[] expected";
4182
4498
  }
4499
+ if (
4500
+ message.state_delta_entries != null &&
4501
+ message.hasOwnProperty("state_delta_entries")
4502
+ ) {
4503
+ if (!Array.isArray(message.state_delta_entries))
4504
+ return "state_delta_entries: array expected";
4505
+ for (var i = 0; i < message.state_delta_entries.length; ++i) {
4506
+ var error = $root.koinos.protocol.state_delta_entry.verify(
4507
+ message.state_delta_entries[i]
4508
+ );
4509
+ if (error) return "state_delta_entries." + error;
4510
+ }
4511
+ }
4183
4512
  return null;
4184
4513
  };
4185
4514
 
@@ -4333,6 +4662,23 @@
4333
4662
  for (var i = 0; i < object.logs.length; ++i)
4334
4663
  message.logs[i] = String(object.logs[i]);
4335
4664
  }
4665
+ if (object.state_delta_entries) {
4666
+ if (!Array.isArray(object.state_delta_entries))
4667
+ throw TypeError(
4668
+ ".koinos.protocol.transaction_receipt.state_delta_entries: array expected"
4669
+ );
4670
+ message.state_delta_entries = [];
4671
+ for (var i = 0; i < object.state_delta_entries.length; ++i) {
4672
+ if (typeof object.state_delta_entries[i] !== "object")
4673
+ throw TypeError(
4674
+ ".koinos.protocol.transaction_receipt.state_delta_entries: object expected"
4675
+ );
4676
+ message.state_delta_entries[i] =
4677
+ $root.koinos.protocol.state_delta_entry.fromObject(
4678
+ object.state_delta_entries[i]
4679
+ );
4680
+ }
4681
+ }
4336
4682
  return message;
4337
4683
  };
4338
4684
 
@@ -4351,6 +4697,7 @@
4351
4697
  if (options.arrays || options.defaults) {
4352
4698
  object.events = [];
4353
4699
  object.logs = [];
4700
+ object.state_delta_entries = [];
4354
4701
  }
4355
4702
  if (options.defaults) {
4356
4703
  if (options.bytes === String) object.id = "";
@@ -4569,6 +4916,18 @@
4569
4916
  for (var j = 0; j < message.logs.length; ++j)
4570
4917
  object.logs[j] = message.logs[j];
4571
4918
  }
4919
+ if (
4920
+ message.state_delta_entries &&
4921
+ message.state_delta_entries.length
4922
+ ) {
4923
+ object.state_delta_entries = [];
4924
+ for (var j = 0; j < message.state_delta_entries.length; ++j)
4925
+ object.state_delta_entries[j] =
4926
+ $root.koinos.protocol.state_delta_entry.toObject(
4927
+ message.state_delta_entries[j],
4928
+ options
4929
+ );
4930
+ }
4572
4931
  return object;
4573
4932
  };
4574
4933
 
@@ -5646,6 +6005,10 @@
5646
6005
  * @property {Array.<koinos.protocol.Ievent_data>|null} [events] block_receipt events
5647
6006
  * @property {Array.<koinos.protocol.Itransaction_receipt>|null} [transaction_receipts] block_receipt transaction_receipts
5648
6007
  * @property {Array.<string>|null} [logs] block_receipt logs
6008
+ * @property {number|Long|null} [disk_storage_charged] block_receipt disk_storage_charged
6009
+ * @property {number|Long|null} [network_bandwidth_charged] block_receipt network_bandwidth_charged
6010
+ * @property {number|Long|null} [compute_bandwidth_charged] block_receipt compute_bandwidth_charged
6011
+ * @property {Array.<koinos.protocol.Istate_delta_entry>|null} [state_delta_entries] block_receipt state_delta_entries
5649
6012
  */
5650
6013
 
5651
6014
  /**
@@ -5660,6 +6023,7 @@
5660
6023
  this.events = [];
5661
6024
  this.transaction_receipts = [];
5662
6025
  this.logs = [];
6026
+ this.state_delta_entries = [];
5663
6027
  if (properties)
5664
6028
  for (
5665
6029
  var keys = Object.keys(properties), i = 0;
@@ -5750,6 +6114,44 @@
5750
6114
  */
5751
6115
  block_receipt.prototype.logs = $util.emptyArray;
5752
6116
 
6117
+ /**
6118
+ * block_receipt disk_storage_charged.
6119
+ * @member {number|Long} disk_storage_charged
6120
+ * @memberof koinos.protocol.block_receipt
6121
+ * @instance
6122
+ */
6123
+ block_receipt.prototype.disk_storage_charged = $util.Long
6124
+ ? $util.Long.fromBits(0, 0, true)
6125
+ : 0;
6126
+
6127
+ /**
6128
+ * block_receipt network_bandwidth_charged.
6129
+ * @member {number|Long} network_bandwidth_charged
6130
+ * @memberof koinos.protocol.block_receipt
6131
+ * @instance
6132
+ */
6133
+ block_receipt.prototype.network_bandwidth_charged = $util.Long
6134
+ ? $util.Long.fromBits(0, 0, true)
6135
+ : 0;
6136
+
6137
+ /**
6138
+ * block_receipt compute_bandwidth_charged.
6139
+ * @member {number|Long} compute_bandwidth_charged
6140
+ * @memberof koinos.protocol.block_receipt
6141
+ * @instance
6142
+ */
6143
+ block_receipt.prototype.compute_bandwidth_charged = $util.Long
6144
+ ? $util.Long.fromBits(0, 0, true)
6145
+ : 0;
6146
+
6147
+ /**
6148
+ * block_receipt state_delta_entries.
6149
+ * @member {Array.<koinos.protocol.Istate_delta_entry>} state_delta_entries
6150
+ * @memberof koinos.protocol.block_receipt
6151
+ * @instance
6152
+ */
6153
+ block_receipt.prototype.state_delta_entries = $util.emptyArray;
6154
+
5753
6155
  /**
5754
6156
  * Creates a new block_receipt instance using the specified properties.
5755
6157
  * @function create
@@ -5830,6 +6232,38 @@
5830
6232
  if (message.logs != null && message.logs.length)
5831
6233
  for (var i = 0; i < message.logs.length; ++i)
5832
6234
  writer.uint32(/* id 9, wireType 2 =*/ 74).string(message.logs[i]);
6235
+ if (
6236
+ message.disk_storage_charged != null &&
6237
+ Object.hasOwnProperty.call(message, "disk_storage_charged")
6238
+ )
6239
+ writer
6240
+ .uint32(/* id 10, wireType 0 =*/ 80)
6241
+ .uint64(message.disk_storage_charged);
6242
+ if (
6243
+ message.network_bandwidth_charged != null &&
6244
+ Object.hasOwnProperty.call(message, "network_bandwidth_charged")
6245
+ )
6246
+ writer
6247
+ .uint32(/* id 11, wireType 0 =*/ 88)
6248
+ .uint64(message.network_bandwidth_charged);
6249
+ if (
6250
+ message.compute_bandwidth_charged != null &&
6251
+ Object.hasOwnProperty.call(message, "compute_bandwidth_charged")
6252
+ )
6253
+ writer
6254
+ .uint32(/* id 12, wireType 0 =*/ 96)
6255
+ .uint64(message.compute_bandwidth_charged);
6256
+ if (
6257
+ message.state_delta_entries != null &&
6258
+ message.state_delta_entries.length
6259
+ )
6260
+ for (var i = 0; i < message.state_delta_entries.length; ++i)
6261
+ $root.koinos.protocol.state_delta_entry
6262
+ .encode(
6263
+ message.state_delta_entries[i],
6264
+ writer.uint32(/* id 13, wireType 2 =*/ 106).fork()
6265
+ )
6266
+ .ldelim();
5833
6267
  return writer;
5834
6268
  };
5835
6269
 
@@ -5923,11 +6357,39 @@
5923
6357
  message.logs.push(reader.string());
5924
6358
  break;
5925
6359
  }
5926
- default:
5927
- reader.skipType(tag & 7);
6360
+ case 10: {
6361
+ message.disk_storage_charged = reader.uint64();
5928
6362
  break;
5929
- }
5930
- }
6363
+ }
6364
+ case 11: {
6365
+ message.network_bandwidth_charged = reader.uint64();
6366
+ break;
6367
+ }
6368
+ case 12: {
6369
+ message.compute_bandwidth_charged = reader.uint64();
6370
+ break;
6371
+ }
6372
+ case 13: {
6373
+ if (
6374
+ !(
6375
+ message.state_delta_entries &&
6376
+ message.state_delta_entries.length
6377
+ )
6378
+ )
6379
+ message.state_delta_entries = [];
6380
+ message.state_delta_entries.push(
6381
+ $root.koinos.protocol.state_delta_entry.decode(
6382
+ reader,
6383
+ reader.uint32()
6384
+ )
6385
+ );
6386
+ break;
6387
+ }
6388
+ default:
6389
+ reader.skipType(tag & 7);
6390
+ break;
6391
+ }
6392
+ }
5931
6393
  return message;
5932
6394
  };
5933
6395
 
@@ -6054,6 +6516,58 @@
6054
6516
  if (!$util.isString(message.logs[i]))
6055
6517
  return "logs: string[] expected";
6056
6518
  }
6519
+ if (
6520
+ message.disk_storage_charged != null &&
6521
+ message.hasOwnProperty("disk_storage_charged")
6522
+ )
6523
+ if (
6524
+ !$util.isInteger(message.disk_storage_charged) &&
6525
+ !(
6526
+ message.disk_storage_charged &&
6527
+ $util.isInteger(message.disk_storage_charged.low) &&
6528
+ $util.isInteger(message.disk_storage_charged.high)
6529
+ )
6530
+ )
6531
+ return "disk_storage_charged: integer|Long expected";
6532
+ if (
6533
+ message.network_bandwidth_charged != null &&
6534
+ message.hasOwnProperty("network_bandwidth_charged")
6535
+ )
6536
+ if (
6537
+ !$util.isInteger(message.network_bandwidth_charged) &&
6538
+ !(
6539
+ message.network_bandwidth_charged &&
6540
+ $util.isInteger(message.network_bandwidth_charged.low) &&
6541
+ $util.isInteger(message.network_bandwidth_charged.high)
6542
+ )
6543
+ )
6544
+ return "network_bandwidth_charged: integer|Long expected";
6545
+ if (
6546
+ message.compute_bandwidth_charged != null &&
6547
+ message.hasOwnProperty("compute_bandwidth_charged")
6548
+ )
6549
+ if (
6550
+ !$util.isInteger(message.compute_bandwidth_charged) &&
6551
+ !(
6552
+ message.compute_bandwidth_charged &&
6553
+ $util.isInteger(message.compute_bandwidth_charged.low) &&
6554
+ $util.isInteger(message.compute_bandwidth_charged.high)
6555
+ )
6556
+ )
6557
+ return "compute_bandwidth_charged: integer|Long expected";
6558
+ if (
6559
+ message.state_delta_entries != null &&
6560
+ message.hasOwnProperty("state_delta_entries")
6561
+ ) {
6562
+ if (!Array.isArray(message.state_delta_entries))
6563
+ return "state_delta_entries: array expected";
6564
+ for (var i = 0; i < message.state_delta_entries.length; ++i) {
6565
+ var error = $root.koinos.protocol.state_delta_entry.verify(
6566
+ message.state_delta_entries[i]
6567
+ );
6568
+ if (error) return "state_delta_entries." + error;
6569
+ }
6570
+ }
6057
6571
  return null;
6058
6572
  };
6059
6573
 
@@ -6195,6 +6709,76 @@
6195
6709
  for (var i = 0; i < object.logs.length; ++i)
6196
6710
  message.logs[i] = String(object.logs[i]);
6197
6711
  }
6712
+ if (object.disk_storage_charged != null)
6713
+ if ($util.Long)
6714
+ (message.disk_storage_charged = $util.Long.fromValue(
6715
+ object.disk_storage_charged
6716
+ )).unsigned = true;
6717
+ else if (typeof object.disk_storage_charged === "string")
6718
+ message.disk_storage_charged = parseInt(
6719
+ object.disk_storage_charged,
6720
+ 10
6721
+ );
6722
+ else if (typeof object.disk_storage_charged === "number")
6723
+ message.disk_storage_charged = object.disk_storage_charged;
6724
+ else if (typeof object.disk_storage_charged === "object")
6725
+ message.disk_storage_charged = new $util.LongBits(
6726
+ object.disk_storage_charged.low >>> 0,
6727
+ object.disk_storage_charged.high >>> 0
6728
+ ).toNumber(true);
6729
+ if (object.network_bandwidth_charged != null)
6730
+ if ($util.Long)
6731
+ (message.network_bandwidth_charged = $util.Long.fromValue(
6732
+ object.network_bandwidth_charged
6733
+ )).unsigned = true;
6734
+ else if (typeof object.network_bandwidth_charged === "string")
6735
+ message.network_bandwidth_charged = parseInt(
6736
+ object.network_bandwidth_charged,
6737
+ 10
6738
+ );
6739
+ else if (typeof object.network_bandwidth_charged === "number")
6740
+ message.network_bandwidth_charged =
6741
+ object.network_bandwidth_charged;
6742
+ else if (typeof object.network_bandwidth_charged === "object")
6743
+ message.network_bandwidth_charged = new $util.LongBits(
6744
+ object.network_bandwidth_charged.low >>> 0,
6745
+ object.network_bandwidth_charged.high >>> 0
6746
+ ).toNumber(true);
6747
+ if (object.compute_bandwidth_charged != null)
6748
+ if ($util.Long)
6749
+ (message.compute_bandwidth_charged = $util.Long.fromValue(
6750
+ object.compute_bandwidth_charged
6751
+ )).unsigned = true;
6752
+ else if (typeof object.compute_bandwidth_charged === "string")
6753
+ message.compute_bandwidth_charged = parseInt(
6754
+ object.compute_bandwidth_charged,
6755
+ 10
6756
+ );
6757
+ else if (typeof object.compute_bandwidth_charged === "number")
6758
+ message.compute_bandwidth_charged =
6759
+ object.compute_bandwidth_charged;
6760
+ else if (typeof object.compute_bandwidth_charged === "object")
6761
+ message.compute_bandwidth_charged = new $util.LongBits(
6762
+ object.compute_bandwidth_charged.low >>> 0,
6763
+ object.compute_bandwidth_charged.high >>> 0
6764
+ ).toNumber(true);
6765
+ if (object.state_delta_entries) {
6766
+ if (!Array.isArray(object.state_delta_entries))
6767
+ throw TypeError(
6768
+ ".koinos.protocol.block_receipt.state_delta_entries: array expected"
6769
+ );
6770
+ message.state_delta_entries = [];
6771
+ for (var i = 0; i < object.state_delta_entries.length; ++i) {
6772
+ if (typeof object.state_delta_entries[i] !== "object")
6773
+ throw TypeError(
6774
+ ".koinos.protocol.block_receipt.state_delta_entries: object expected"
6775
+ );
6776
+ message.state_delta_entries[i] =
6777
+ $root.koinos.protocol.state_delta_entry.fromObject(
6778
+ object.state_delta_entries[i]
6779
+ );
6780
+ }
6781
+ }
6198
6782
  return message;
6199
6783
  };
6200
6784
 
@@ -6214,6 +6798,7 @@
6214
6798
  object.events = [];
6215
6799
  object.transaction_receipts = [];
6216
6800
  object.logs = [];
6801
+ object.state_delta_entries = [];
6217
6802
  }
6218
6803
  if (options.defaults) {
6219
6804
  if (options.bytes === String) object.id = "";
@@ -6271,6 +6856,38 @@
6271
6856
  object.state_merkle_root
6272
6857
  );
6273
6858
  }
6859
+ if ($util.Long) {
6860
+ var long = new $util.Long(0, 0, true);
6861
+ object.disk_storage_charged =
6862
+ options.longs === String
6863
+ ? long.toString()
6864
+ : options.longs === Number
6865
+ ? long.toNumber()
6866
+ : long;
6867
+ } else
6868
+ object.disk_storage_charged = options.longs === String ? "0" : 0;
6869
+ if ($util.Long) {
6870
+ var long = new $util.Long(0, 0, true);
6871
+ object.network_bandwidth_charged =
6872
+ options.longs === String
6873
+ ? long.toString()
6874
+ : options.longs === Number
6875
+ ? long.toNumber()
6876
+ : long;
6877
+ } else
6878
+ object.network_bandwidth_charged =
6879
+ options.longs === String ? "0" : 0;
6880
+ if ($util.Long) {
6881
+ var long = new $util.Long(0, 0, true);
6882
+ object.compute_bandwidth_charged =
6883
+ options.longs === String
6884
+ ? long.toString()
6885
+ : options.longs === Number
6886
+ ? long.toNumber()
6887
+ : long;
6888
+ } else
6889
+ object.compute_bandwidth_charged =
6890
+ options.longs === String ? "0" : 0;
6274
6891
  }
6275
6892
  if (message.id != null && message.hasOwnProperty("id"))
6276
6893
  object.id =
@@ -6397,6 +7014,81 @@
6397
7014
  for (var j = 0; j < message.logs.length; ++j)
6398
7015
  object.logs[j] = message.logs[j];
6399
7016
  }
7017
+ if (
7018
+ message.disk_storage_charged != null &&
7019
+ message.hasOwnProperty("disk_storage_charged")
7020
+ )
7021
+ if (typeof message.disk_storage_charged === "number")
7022
+ object.disk_storage_charged =
7023
+ options.longs === String
7024
+ ? String(message.disk_storage_charged)
7025
+ : message.disk_storage_charged;
7026
+ else
7027
+ object.disk_storage_charged =
7028
+ options.longs === String
7029
+ ? $util.Long.prototype.toString.call(
7030
+ message.disk_storage_charged
7031
+ )
7032
+ : options.longs === Number
7033
+ ? new $util.LongBits(
7034
+ message.disk_storage_charged.low >>> 0,
7035
+ message.disk_storage_charged.high >>> 0
7036
+ ).toNumber(true)
7037
+ : message.disk_storage_charged;
7038
+ if (
7039
+ message.network_bandwidth_charged != null &&
7040
+ message.hasOwnProperty("network_bandwidth_charged")
7041
+ )
7042
+ if (typeof message.network_bandwidth_charged === "number")
7043
+ object.network_bandwidth_charged =
7044
+ options.longs === String
7045
+ ? String(message.network_bandwidth_charged)
7046
+ : message.network_bandwidth_charged;
7047
+ else
7048
+ object.network_bandwidth_charged =
7049
+ options.longs === String
7050
+ ? $util.Long.prototype.toString.call(
7051
+ message.network_bandwidth_charged
7052
+ )
7053
+ : options.longs === Number
7054
+ ? new $util.LongBits(
7055
+ message.network_bandwidth_charged.low >>> 0,
7056
+ message.network_bandwidth_charged.high >>> 0
7057
+ ).toNumber(true)
7058
+ : message.network_bandwidth_charged;
7059
+ if (
7060
+ message.compute_bandwidth_charged != null &&
7061
+ message.hasOwnProperty("compute_bandwidth_charged")
7062
+ )
7063
+ if (typeof message.compute_bandwidth_charged === "number")
7064
+ object.compute_bandwidth_charged =
7065
+ options.longs === String
7066
+ ? String(message.compute_bandwidth_charged)
7067
+ : message.compute_bandwidth_charged;
7068
+ else
7069
+ object.compute_bandwidth_charged =
7070
+ options.longs === String
7071
+ ? $util.Long.prototype.toString.call(
7072
+ message.compute_bandwidth_charged
7073
+ )
7074
+ : options.longs === Number
7075
+ ? new $util.LongBits(
7076
+ message.compute_bandwidth_charged.low >>> 0,
7077
+ message.compute_bandwidth_charged.high >>> 0
7078
+ ).toNumber(true)
7079
+ : message.compute_bandwidth_charged;
7080
+ if (
7081
+ message.state_delta_entries &&
7082
+ message.state_delta_entries.length
7083
+ ) {
7084
+ object.state_delta_entries = [];
7085
+ for (var j = 0; j < message.state_delta_entries.length; ++j)
7086
+ object.state_delta_entries[j] =
7087
+ $root.koinos.protocol.state_delta_entry.toObject(
7088
+ message.state_delta_entries[j],
7089
+ options
7090
+ );
7091
+ }
6400
7092
  return object;
6401
7093
  };
6402
7094
 
@@ -6429,6 +7121,353 @@
6429
7121
  return block_receipt;
6430
7122
  })();
6431
7123
 
7124
+ protocol.state_delta_entry = (function () {
7125
+ /**
7126
+ * Properties of a state_delta_entry.
7127
+ * @memberof koinos.protocol
7128
+ * @interface Istate_delta_entry
7129
+ * @property {koinos.protocol.Iobject_space|null} [object_space] state_delta_entry object_space
7130
+ * @property {Uint8Array|null} [key] state_delta_entry key
7131
+ * @property {Uint8Array|null} [value] state_delta_entry value
7132
+ */
7133
+
7134
+ /**
7135
+ * Constructs a new state_delta_entry.
7136
+ * @memberof koinos.protocol
7137
+ * @classdesc Represents a state_delta_entry.
7138
+ * @implements Istate_delta_entry
7139
+ * @constructor
7140
+ * @param {koinos.protocol.Istate_delta_entry=} [properties] Properties to set
7141
+ */
7142
+ function state_delta_entry(properties) {
7143
+ if (properties)
7144
+ for (
7145
+ var keys = Object.keys(properties), i = 0;
7146
+ i < keys.length;
7147
+ ++i
7148
+ )
7149
+ if (properties[keys[i]] != null)
7150
+ this[keys[i]] = properties[keys[i]];
7151
+ }
7152
+
7153
+ /**
7154
+ * state_delta_entry object_space.
7155
+ * @member {koinos.protocol.Iobject_space|null|undefined} object_space
7156
+ * @memberof koinos.protocol.state_delta_entry
7157
+ * @instance
7158
+ */
7159
+ state_delta_entry.prototype.object_space = null;
7160
+
7161
+ /**
7162
+ * state_delta_entry key.
7163
+ * @member {Uint8Array} key
7164
+ * @memberof koinos.protocol.state_delta_entry
7165
+ * @instance
7166
+ */
7167
+ state_delta_entry.prototype.key = $util.newBuffer([]);
7168
+
7169
+ /**
7170
+ * state_delta_entry value.
7171
+ * @member {Uint8Array|null|undefined} value
7172
+ * @memberof koinos.protocol.state_delta_entry
7173
+ * @instance
7174
+ */
7175
+ state_delta_entry.prototype.value = null;
7176
+
7177
+ // OneOf field names bound to virtual getters and setters
7178
+ var $oneOfFields;
7179
+
7180
+ /**
7181
+ * state_delta_entry _value.
7182
+ * @member {"value"|undefined} _value
7183
+ * @memberof koinos.protocol.state_delta_entry
7184
+ * @instance
7185
+ */
7186
+ Object.defineProperty(state_delta_entry.prototype, "_value", {
7187
+ get: $util.oneOfGetter(($oneOfFields = ["value"])),
7188
+ set: $util.oneOfSetter($oneOfFields),
7189
+ });
7190
+
7191
+ /**
7192
+ * Creates a new state_delta_entry instance using the specified properties.
7193
+ * @function create
7194
+ * @memberof koinos.protocol.state_delta_entry
7195
+ * @static
7196
+ * @param {koinos.protocol.Istate_delta_entry=} [properties] Properties to set
7197
+ * @returns {koinos.protocol.state_delta_entry} state_delta_entry instance
7198
+ */
7199
+ state_delta_entry.create = function create(properties) {
7200
+ return new state_delta_entry(properties);
7201
+ };
7202
+
7203
+ /**
7204
+ * Encodes the specified state_delta_entry message. Does not implicitly {@link koinos.protocol.state_delta_entry.verify|verify} messages.
7205
+ * @function encode
7206
+ * @memberof koinos.protocol.state_delta_entry
7207
+ * @static
7208
+ * @param {koinos.protocol.Istate_delta_entry} message state_delta_entry message or plain object to encode
7209
+ * @param {$protobuf.Writer} [writer] Writer to encode to
7210
+ * @returns {$protobuf.Writer} Writer
7211
+ */
7212
+ state_delta_entry.encode = function encode(message, writer) {
7213
+ if (!writer) writer = $Writer.create();
7214
+ if (
7215
+ message.object_space != null &&
7216
+ Object.hasOwnProperty.call(message, "object_space")
7217
+ )
7218
+ $root.koinos.protocol.object_space
7219
+ .encode(
7220
+ message.object_space,
7221
+ writer.uint32(/* id 1, wireType 2 =*/ 10).fork()
7222
+ )
7223
+ .ldelim();
7224
+ if (message.key != null && Object.hasOwnProperty.call(message, "key"))
7225
+ writer.uint32(/* id 2, wireType 2 =*/ 18).bytes(message.key);
7226
+ if (
7227
+ message.value != null &&
7228
+ Object.hasOwnProperty.call(message, "value")
7229
+ )
7230
+ writer.uint32(/* id 3, wireType 2 =*/ 26).bytes(message.value);
7231
+ return writer;
7232
+ };
7233
+
7234
+ /**
7235
+ * Encodes the specified state_delta_entry message, length delimited. Does not implicitly {@link koinos.protocol.state_delta_entry.verify|verify} messages.
7236
+ * @function encodeDelimited
7237
+ * @memberof koinos.protocol.state_delta_entry
7238
+ * @static
7239
+ * @param {koinos.protocol.Istate_delta_entry} message state_delta_entry message or plain object to encode
7240
+ * @param {$protobuf.Writer} [writer] Writer to encode to
7241
+ * @returns {$protobuf.Writer} Writer
7242
+ */
7243
+ state_delta_entry.encodeDelimited = function encodeDelimited(
7244
+ message,
7245
+ writer
7246
+ ) {
7247
+ return this.encode(message, writer).ldelim();
7248
+ };
7249
+
7250
+ /**
7251
+ * Decodes a state_delta_entry message from the specified reader or buffer.
7252
+ * @function decode
7253
+ * @memberof koinos.protocol.state_delta_entry
7254
+ * @static
7255
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
7256
+ * @param {number} [length] Message length if known beforehand
7257
+ * @returns {koinos.protocol.state_delta_entry} state_delta_entry
7258
+ * @throws {Error} If the payload is not a reader or valid buffer
7259
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
7260
+ */
7261
+ state_delta_entry.decode = function decode(reader, length) {
7262
+ if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
7263
+ var end = length === undefined ? reader.len : reader.pos + length,
7264
+ message = new $root.koinos.protocol.state_delta_entry();
7265
+ while (reader.pos < end) {
7266
+ var tag = reader.uint32();
7267
+ switch (tag >>> 3) {
7268
+ case 1: {
7269
+ message.object_space =
7270
+ $root.koinos.protocol.object_space.decode(
7271
+ reader,
7272
+ reader.uint32()
7273
+ );
7274
+ break;
7275
+ }
7276
+ case 2: {
7277
+ message.key = reader.bytes();
7278
+ break;
7279
+ }
7280
+ case 3: {
7281
+ message.value = reader.bytes();
7282
+ break;
7283
+ }
7284
+ default:
7285
+ reader.skipType(tag & 7);
7286
+ break;
7287
+ }
7288
+ }
7289
+ return message;
7290
+ };
7291
+
7292
+ /**
7293
+ * Decodes a state_delta_entry message from the specified reader or buffer, length delimited.
7294
+ * @function decodeDelimited
7295
+ * @memberof koinos.protocol.state_delta_entry
7296
+ * @static
7297
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
7298
+ * @returns {koinos.protocol.state_delta_entry} state_delta_entry
7299
+ * @throws {Error} If the payload is not a reader or valid buffer
7300
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
7301
+ */
7302
+ state_delta_entry.decodeDelimited = function decodeDelimited(reader) {
7303
+ if (!(reader instanceof $Reader)) reader = new $Reader(reader);
7304
+ return this.decode(reader, reader.uint32());
7305
+ };
7306
+
7307
+ /**
7308
+ * Verifies a state_delta_entry message.
7309
+ * @function verify
7310
+ * @memberof koinos.protocol.state_delta_entry
7311
+ * @static
7312
+ * @param {Object.<string,*>} message Plain object to verify
7313
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
7314
+ */
7315
+ state_delta_entry.verify = function verify(message) {
7316
+ if (typeof message !== "object" || message === null)
7317
+ return "object expected";
7318
+ var properties = {};
7319
+ if (
7320
+ message.object_space != null &&
7321
+ message.hasOwnProperty("object_space")
7322
+ ) {
7323
+ var error = $root.koinos.protocol.object_space.verify(
7324
+ message.object_space
7325
+ );
7326
+ if (error) return "object_space." + error;
7327
+ }
7328
+ if (message.key != null && message.hasOwnProperty("key"))
7329
+ if (
7330
+ !(
7331
+ (message.key && typeof message.key.length === "number") ||
7332
+ $util.isString(message.key)
7333
+ )
7334
+ )
7335
+ return "key: buffer expected";
7336
+ if (message.value != null && message.hasOwnProperty("value")) {
7337
+ properties._value = 1;
7338
+ if (
7339
+ !(
7340
+ (message.value && typeof message.value.length === "number") ||
7341
+ $util.isString(message.value)
7342
+ )
7343
+ )
7344
+ return "value: buffer expected";
7345
+ }
7346
+ return null;
7347
+ };
7348
+
7349
+ /**
7350
+ * Creates a state_delta_entry message from a plain object. Also converts values to their respective internal types.
7351
+ * @function fromObject
7352
+ * @memberof koinos.protocol.state_delta_entry
7353
+ * @static
7354
+ * @param {Object.<string,*>} object Plain object
7355
+ * @returns {koinos.protocol.state_delta_entry} state_delta_entry
7356
+ */
7357
+ state_delta_entry.fromObject = function fromObject(object) {
7358
+ if (object instanceof $root.koinos.protocol.state_delta_entry)
7359
+ return object;
7360
+ var message = new $root.koinos.protocol.state_delta_entry();
7361
+ if (object.object_space != null) {
7362
+ if (typeof object.object_space !== "object")
7363
+ throw TypeError(
7364
+ ".koinos.protocol.state_delta_entry.object_space: object expected"
7365
+ );
7366
+ message.object_space =
7367
+ $root.koinos.protocol.object_space.fromObject(
7368
+ object.object_space
7369
+ );
7370
+ }
7371
+ if (object.key != null)
7372
+ if (typeof object.key === "string")
7373
+ $util.base64.decode(
7374
+ object.key,
7375
+ (message.key = $util.newBuffer(
7376
+ $util.base64.length(object.key)
7377
+ )),
7378
+ 0
7379
+ );
7380
+ else if (object.key.length >= 0) message.key = object.key;
7381
+ if (object.value != null)
7382
+ if (typeof object.value === "string")
7383
+ $util.base64.decode(
7384
+ object.value,
7385
+ (message.value = $util.newBuffer(
7386
+ $util.base64.length(object.value)
7387
+ )),
7388
+ 0
7389
+ );
7390
+ else if (object.value.length >= 0) message.value = object.value;
7391
+ return message;
7392
+ };
7393
+
7394
+ /**
7395
+ * Creates a plain object from a state_delta_entry message. Also converts values to other types if specified.
7396
+ * @function toObject
7397
+ * @memberof koinos.protocol.state_delta_entry
7398
+ * @static
7399
+ * @param {koinos.protocol.state_delta_entry} message state_delta_entry
7400
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
7401
+ * @returns {Object.<string,*>} Plain object
7402
+ */
7403
+ state_delta_entry.toObject = function toObject(message, options) {
7404
+ if (!options) options = {};
7405
+ var object = {};
7406
+ if (options.defaults) {
7407
+ object.object_space = null;
7408
+ if (options.bytes === String) object.key = "";
7409
+ else {
7410
+ object.key = [];
7411
+ if (options.bytes !== Array)
7412
+ object.key = $util.newBuffer(object.key);
7413
+ }
7414
+ }
7415
+ if (
7416
+ message.object_space != null &&
7417
+ message.hasOwnProperty("object_space")
7418
+ )
7419
+ object.object_space = $root.koinos.protocol.object_space.toObject(
7420
+ message.object_space,
7421
+ options
7422
+ );
7423
+ if (message.key != null && message.hasOwnProperty("key"))
7424
+ object.key =
7425
+ options.bytes === String
7426
+ ? $util.base64.encode(message.key, 0, message.key.length)
7427
+ : options.bytes === Array
7428
+ ? Array.prototype.slice.call(message.key)
7429
+ : message.key;
7430
+ if (message.value != null && message.hasOwnProperty("value")) {
7431
+ object.value =
7432
+ options.bytes === String
7433
+ ? $util.base64.encode(message.value, 0, message.value.length)
7434
+ : options.bytes === Array
7435
+ ? Array.prototype.slice.call(message.value)
7436
+ : message.value;
7437
+ if (options.oneofs) object._value = "value";
7438
+ }
7439
+ return object;
7440
+ };
7441
+
7442
+ /**
7443
+ * Converts this state_delta_entry to JSON.
7444
+ * @function toJSON
7445
+ * @memberof koinos.protocol.state_delta_entry
7446
+ * @instance
7447
+ * @returns {Object.<string,*>} JSON object
7448
+ */
7449
+ state_delta_entry.prototype.toJSON = function toJSON() {
7450
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
7451
+ };
7452
+
7453
+ /**
7454
+ * Gets the default type url for state_delta_entry
7455
+ * @function getTypeUrl
7456
+ * @memberof koinos.protocol.state_delta_entry
7457
+ * @static
7458
+ * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
7459
+ * @returns {string} The default type url
7460
+ */
7461
+ state_delta_entry.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
7462
+ if (typeUrlPrefix === undefined) {
7463
+ typeUrlPrefix = "type.googleapis.com";
7464
+ }
7465
+ return typeUrlPrefix + "/koinos.protocol.state_delta_entry";
7466
+ };
7467
+
7468
+ return state_delta_entry;
7469
+ })();
7470
+
6432
7471
  return protocol;
6433
7472
  })();
6434
7473