koilib 5.6.0 → 5.7.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.
- package/dist/koinos.js +5056 -4042
- package/dist/koinos.min.js +1 -1
- package/lib/Contract.d.ts +4 -4
- package/lib/Contract.js +4 -4
- package/lib/Contract.js.map +1 -1
- package/lib/Provider.d.ts +42 -12
- package/lib/Provider.js +99 -6
- package/lib/Provider.js.map +1 -1
- package/lib/Serializer.d.ts +20 -0
- package/lib/Serializer.js +4 -0
- package/lib/Serializer.js.map +1 -1
- package/lib/Signer.d.ts +0 -10
- package/lib/Signer.js +1 -123
- package/lib/Signer.js.map +1 -1
- package/lib/Transaction.d.ts +3 -3
- package/lib/Transaction.js +4 -4
- package/lib/Transaction.js.map +1 -1
- package/lib/browser/Contract.d.ts +4 -4
- package/lib/browser/Contract.js +4 -4
- package/lib/browser/Contract.js.map +1 -1
- package/lib/browser/Provider.d.ts +42 -12
- package/lib/browser/Provider.js +99 -6
- package/lib/browser/Provider.js.map +1 -1
- package/lib/browser/Serializer.d.ts +20 -0
- package/lib/browser/Serializer.js +4 -0
- package/lib/browser/Serializer.js.map +1 -1
- package/lib/browser/Signer.d.ts +0 -10
- package/lib/browser/Signer.js +1 -123
- package/lib/browser/Signer.js.map +1 -1
- package/lib/browser/Transaction.d.ts +3 -3
- package/lib/browser/Transaction.js +4 -4
- package/lib/browser/Transaction.js.map +1 -1
- package/lib/browser/index.d.ts +1 -1
- package/lib/browser/index.js +2 -2
- package/lib/browser/index.js.map +1 -1
- package/lib/browser/interface.d.ts +17 -2
- package/lib/browser/jsonDescriptors/chain-proto.json +74 -3
- package/lib/browser/jsonDescriptors/token-proto.json +5 -26
- package/lib/browser/protoModules/protocol-proto.js +823 -0
- package/lib/browser/protoModules/protocol-proto.js.map +1 -1
- package/lib/browser/utilsNode.d.ts +72 -117
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -2
- package/lib/index.js.map +1 -1
- package/lib/interface.d.ts +17 -2
- package/lib/jsonDescriptors/chain-proto.json +74 -3
- package/lib/jsonDescriptors/token-proto.json +5 -26
- package/lib/protoModules/protocol-proto.js +823 -0
- package/lib/protoModules/protocol-proto.js.map +1 -1
- package/lib/utilsNode.d.ts +72 -117
- package/package.json +6 -6
- package/src/Contract.ts +6 -5
- package/src/Provider.ts +150 -20
- package/src/Serializer.ts +27 -0
- package/src/Signer.ts +1 -150
- package/src/Transaction.ts +8 -8
- package/src/index.ts +1 -1
- package/src/interface.ts +19 -2
- package/src/jsonDescriptors/chain-proto.json +74 -3
- package/src/jsonDescriptors/pow-proto.json +1 -1
- package/src/jsonDescriptors/token-proto.json +5 -26
- package/src/jsonDescriptors/value-proto.json +13 -23
- package/src/protoModules/protocol-proto.js +1043 -4
|
@@ -29,6 +29,256 @@
|
|
|
29
29
|
* @namespace
|
|
30
30
|
*/
|
|
31
31
|
var protocol = {};
|
|
32
|
+
protocol.object_space = (function () {
|
|
33
|
+
/**
|
|
34
|
+
* Properties of an object_space.
|
|
35
|
+
* @memberof koinos.protocol
|
|
36
|
+
* @interface Iobject_space
|
|
37
|
+
* @property {boolean|null} [system] object_space system
|
|
38
|
+
* @property {Uint8Array|null} [zone] object_space zone
|
|
39
|
+
* @property {number|null} [id] object_space id
|
|
40
|
+
*/
|
|
41
|
+
/**
|
|
42
|
+
* Constructs a new object_space.
|
|
43
|
+
* @memberof koinos.protocol
|
|
44
|
+
* @classdesc Represents an object_space.
|
|
45
|
+
* @implements Iobject_space
|
|
46
|
+
* @constructor
|
|
47
|
+
* @param {koinos.protocol.Iobject_space=} [properties] Properties to set
|
|
48
|
+
*/
|
|
49
|
+
function object_space(properties) {
|
|
50
|
+
if (properties)
|
|
51
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
52
|
+
if (properties[keys[i]] != null)
|
|
53
|
+
this[keys[i]] = properties[keys[i]];
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* object_space system.
|
|
57
|
+
* @member {boolean} system
|
|
58
|
+
* @memberof koinos.protocol.object_space
|
|
59
|
+
* @instance
|
|
60
|
+
*/
|
|
61
|
+
object_space.prototype.system = false;
|
|
62
|
+
/**
|
|
63
|
+
* object_space zone.
|
|
64
|
+
* @member {Uint8Array} zone
|
|
65
|
+
* @memberof koinos.protocol.object_space
|
|
66
|
+
* @instance
|
|
67
|
+
*/
|
|
68
|
+
object_space.prototype.zone = $util.newBuffer([]);
|
|
69
|
+
/**
|
|
70
|
+
* object_space id.
|
|
71
|
+
* @member {number} id
|
|
72
|
+
* @memberof koinos.protocol.object_space
|
|
73
|
+
* @instance
|
|
74
|
+
*/
|
|
75
|
+
object_space.prototype.id = 0;
|
|
76
|
+
/**
|
|
77
|
+
* Creates a new object_space instance using the specified properties.
|
|
78
|
+
* @function create
|
|
79
|
+
* @memberof koinos.protocol.object_space
|
|
80
|
+
* @static
|
|
81
|
+
* @param {koinos.protocol.Iobject_space=} [properties] Properties to set
|
|
82
|
+
* @returns {koinos.protocol.object_space} object_space instance
|
|
83
|
+
*/
|
|
84
|
+
object_space.create = function create(properties) {
|
|
85
|
+
return new object_space(properties);
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Encodes the specified object_space message. Does not implicitly {@link koinos.protocol.object_space.verify|verify} messages.
|
|
89
|
+
* @function encode
|
|
90
|
+
* @memberof koinos.protocol.object_space
|
|
91
|
+
* @static
|
|
92
|
+
* @param {koinos.protocol.Iobject_space} message object_space message or plain object to encode
|
|
93
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
94
|
+
* @returns {$protobuf.Writer} Writer
|
|
95
|
+
*/
|
|
96
|
+
object_space.encode = function encode(message, writer) {
|
|
97
|
+
if (!writer)
|
|
98
|
+
writer = $Writer.create();
|
|
99
|
+
if (message.system != null &&
|
|
100
|
+
Object.hasOwnProperty.call(message, "system"))
|
|
101
|
+
writer.uint32(/* id 1, wireType 0 =*/ 8).bool(message.system);
|
|
102
|
+
if (message.zone != null &&
|
|
103
|
+
Object.hasOwnProperty.call(message, "zone"))
|
|
104
|
+
writer.uint32(/* id 2, wireType 2 =*/ 18).bytes(message.zone);
|
|
105
|
+
if (message.id != null && Object.hasOwnProperty.call(message, "id"))
|
|
106
|
+
writer.uint32(/* id 3, wireType 0 =*/ 24).uint32(message.id);
|
|
107
|
+
return writer;
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* Encodes the specified object_space message, length delimited. Does not implicitly {@link koinos.protocol.object_space.verify|verify} messages.
|
|
111
|
+
* @function encodeDelimited
|
|
112
|
+
* @memberof koinos.protocol.object_space
|
|
113
|
+
* @static
|
|
114
|
+
* @param {koinos.protocol.Iobject_space} message object_space message or plain object to encode
|
|
115
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
116
|
+
* @returns {$protobuf.Writer} Writer
|
|
117
|
+
*/
|
|
118
|
+
object_space.encodeDelimited = function encodeDelimited(message, writer) {
|
|
119
|
+
return this.encode(message, writer).ldelim();
|
|
120
|
+
};
|
|
121
|
+
/**
|
|
122
|
+
* Decodes an object_space message from the specified reader or buffer.
|
|
123
|
+
* @function decode
|
|
124
|
+
* @memberof koinos.protocol.object_space
|
|
125
|
+
* @static
|
|
126
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
127
|
+
* @param {number} [length] Message length if known beforehand
|
|
128
|
+
* @returns {koinos.protocol.object_space} object_space
|
|
129
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
130
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
131
|
+
*/
|
|
132
|
+
object_space.decode = function decode(reader, length) {
|
|
133
|
+
if (!(reader instanceof $Reader))
|
|
134
|
+
reader = $Reader.create(reader);
|
|
135
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.koinos.protocol.object_space();
|
|
136
|
+
while (reader.pos < end) {
|
|
137
|
+
var tag = reader.uint32();
|
|
138
|
+
switch (tag >>> 3) {
|
|
139
|
+
case 1: {
|
|
140
|
+
message.system = reader.bool();
|
|
141
|
+
break;
|
|
142
|
+
}
|
|
143
|
+
case 2: {
|
|
144
|
+
message.zone = reader.bytes();
|
|
145
|
+
break;
|
|
146
|
+
}
|
|
147
|
+
case 3: {
|
|
148
|
+
message.id = reader.uint32();
|
|
149
|
+
break;
|
|
150
|
+
}
|
|
151
|
+
default:
|
|
152
|
+
reader.skipType(tag & 7);
|
|
153
|
+
break;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
return message;
|
|
157
|
+
};
|
|
158
|
+
/**
|
|
159
|
+
* Decodes an object_space message from the specified reader or buffer, length delimited.
|
|
160
|
+
* @function decodeDelimited
|
|
161
|
+
* @memberof koinos.protocol.object_space
|
|
162
|
+
* @static
|
|
163
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
164
|
+
* @returns {koinos.protocol.object_space} object_space
|
|
165
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
166
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
167
|
+
*/
|
|
168
|
+
object_space.decodeDelimited = function decodeDelimited(reader) {
|
|
169
|
+
if (!(reader instanceof $Reader))
|
|
170
|
+
reader = new $Reader(reader);
|
|
171
|
+
return this.decode(reader, reader.uint32());
|
|
172
|
+
};
|
|
173
|
+
/**
|
|
174
|
+
* Verifies an object_space message.
|
|
175
|
+
* @function verify
|
|
176
|
+
* @memberof koinos.protocol.object_space
|
|
177
|
+
* @static
|
|
178
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
179
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
180
|
+
*/
|
|
181
|
+
object_space.verify = function verify(message) {
|
|
182
|
+
if (typeof message !== "object" || message === null)
|
|
183
|
+
return "object expected";
|
|
184
|
+
if (message.system != null && message.hasOwnProperty("system"))
|
|
185
|
+
if (typeof message.system !== "boolean")
|
|
186
|
+
return "system: boolean expected";
|
|
187
|
+
if (message.zone != null && message.hasOwnProperty("zone"))
|
|
188
|
+
if (!((message.zone && typeof message.zone.length === "number") ||
|
|
189
|
+
$util.isString(message.zone)))
|
|
190
|
+
return "zone: buffer expected";
|
|
191
|
+
if (message.id != null && message.hasOwnProperty("id"))
|
|
192
|
+
if (!$util.isInteger(message.id))
|
|
193
|
+
return "id: integer expected";
|
|
194
|
+
return null;
|
|
195
|
+
};
|
|
196
|
+
/**
|
|
197
|
+
* Creates an object_space message from a plain object. Also converts values to their respective internal types.
|
|
198
|
+
* @function fromObject
|
|
199
|
+
* @memberof koinos.protocol.object_space
|
|
200
|
+
* @static
|
|
201
|
+
* @param {Object.<string,*>} object Plain object
|
|
202
|
+
* @returns {koinos.protocol.object_space} object_space
|
|
203
|
+
*/
|
|
204
|
+
object_space.fromObject = function fromObject(object) {
|
|
205
|
+
if (object instanceof $root.koinos.protocol.object_space)
|
|
206
|
+
return object;
|
|
207
|
+
var message = new $root.koinos.protocol.object_space();
|
|
208
|
+
if (object.system != null)
|
|
209
|
+
message.system = Boolean(object.system);
|
|
210
|
+
if (object.zone != null)
|
|
211
|
+
if (typeof object.zone === "string")
|
|
212
|
+
$util.base64.decode(object.zone, (message.zone = $util.newBuffer($util.base64.length(object.zone))), 0);
|
|
213
|
+
else if (object.zone.length >= 0)
|
|
214
|
+
message.zone = object.zone;
|
|
215
|
+
if (object.id != null)
|
|
216
|
+
message.id = object.id >>> 0;
|
|
217
|
+
return message;
|
|
218
|
+
};
|
|
219
|
+
/**
|
|
220
|
+
* Creates a plain object from an object_space message. Also converts values to other types if specified.
|
|
221
|
+
* @function toObject
|
|
222
|
+
* @memberof koinos.protocol.object_space
|
|
223
|
+
* @static
|
|
224
|
+
* @param {koinos.protocol.object_space} message object_space
|
|
225
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
226
|
+
* @returns {Object.<string,*>} Plain object
|
|
227
|
+
*/
|
|
228
|
+
object_space.toObject = function toObject(message, options) {
|
|
229
|
+
if (!options)
|
|
230
|
+
options = {};
|
|
231
|
+
var object = {};
|
|
232
|
+
if (options.defaults) {
|
|
233
|
+
object.system = false;
|
|
234
|
+
if (options.bytes === String)
|
|
235
|
+
object.zone = "";
|
|
236
|
+
else {
|
|
237
|
+
object.zone = [];
|
|
238
|
+
if (options.bytes !== Array)
|
|
239
|
+
object.zone = $util.newBuffer(object.zone);
|
|
240
|
+
}
|
|
241
|
+
object.id = 0;
|
|
242
|
+
}
|
|
243
|
+
if (message.system != null && message.hasOwnProperty("system"))
|
|
244
|
+
object.system = message.system;
|
|
245
|
+
if (message.zone != null && message.hasOwnProperty("zone"))
|
|
246
|
+
object.zone =
|
|
247
|
+
options.bytes === String
|
|
248
|
+
? $util.base64.encode(message.zone, 0, message.zone.length)
|
|
249
|
+
: options.bytes === Array
|
|
250
|
+
? Array.prototype.slice.call(message.zone)
|
|
251
|
+
: message.zone;
|
|
252
|
+
if (message.id != null && message.hasOwnProperty("id"))
|
|
253
|
+
object.id = message.id;
|
|
254
|
+
return object;
|
|
255
|
+
};
|
|
256
|
+
/**
|
|
257
|
+
* Converts this object_space to JSON.
|
|
258
|
+
* @function toJSON
|
|
259
|
+
* @memberof koinos.protocol.object_space
|
|
260
|
+
* @instance
|
|
261
|
+
* @returns {Object.<string,*>} JSON object
|
|
262
|
+
*/
|
|
263
|
+
object_space.prototype.toJSON = function toJSON() {
|
|
264
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
265
|
+
};
|
|
266
|
+
/**
|
|
267
|
+
* Gets the default type url for object_space
|
|
268
|
+
* @function getTypeUrl
|
|
269
|
+
* @memberof koinos.protocol.object_space
|
|
270
|
+
* @static
|
|
271
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
272
|
+
* @returns {string} The default type url
|
|
273
|
+
*/
|
|
274
|
+
object_space.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
275
|
+
if (typeUrlPrefix === undefined) {
|
|
276
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
277
|
+
}
|
|
278
|
+
return typeUrlPrefix + "/koinos.protocol.object_space";
|
|
279
|
+
};
|
|
280
|
+
return object_space;
|
|
281
|
+
})();
|
|
32
282
|
protocol.event_data = (function () {
|
|
33
283
|
/**
|
|
34
284
|
* Properties of an event_data.
|
|
@@ -3064,6 +3314,7 @@
|
|
|
3064
3314
|
* @property {boolean|null} [reverted] transaction_receipt reverted
|
|
3065
3315
|
* @property {Array.<koinos.protocol.Ievent_data>|null} [events] transaction_receipt events
|
|
3066
3316
|
* @property {Array.<string>|null} [logs] transaction_receipt logs
|
|
3317
|
+
* @property {Array.<koinos.protocol.Istate_delta_entry>|null} [state_delta_entries] transaction_receipt state_delta_entries
|
|
3067
3318
|
*/
|
|
3068
3319
|
/**
|
|
3069
3320
|
* Constructs a new transaction_receipt.
|
|
@@ -3076,6 +3327,7 @@
|
|
|
3076
3327
|
function transaction_receipt(properties) {
|
|
3077
3328
|
this.events = [];
|
|
3078
3329
|
this.logs = [];
|
|
3330
|
+
this.state_delta_entries = [];
|
|
3079
3331
|
if (properties)
|
|
3080
3332
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
3081
3333
|
if (properties[keys[i]] != null)
|
|
@@ -3170,6 +3422,13 @@
|
|
|
3170
3422
|
* @instance
|
|
3171
3423
|
*/
|
|
3172
3424
|
transaction_receipt.prototype.logs = $util.emptyArray;
|
|
3425
|
+
/**
|
|
3426
|
+
* transaction_receipt state_delta_entries.
|
|
3427
|
+
* @member {Array.<koinos.protocol.Istate_delta_entry>} state_delta_entries
|
|
3428
|
+
* @memberof koinos.protocol.transaction_receipt
|
|
3429
|
+
* @instance
|
|
3430
|
+
*/
|
|
3431
|
+
transaction_receipt.prototype.state_delta_entries = $util.emptyArray;
|
|
3173
3432
|
/**
|
|
3174
3433
|
* Creates a new transaction_receipt instance using the specified properties.
|
|
3175
3434
|
* @function create
|
|
@@ -3237,6 +3496,12 @@
|
|
|
3237
3496
|
writer
|
|
3238
3497
|
.uint32(/* id 11, wireType 2 =*/ 90)
|
|
3239
3498
|
.string(message.logs[i]);
|
|
3499
|
+
if (message.state_delta_entries != null &&
|
|
3500
|
+
message.state_delta_entries.length)
|
|
3501
|
+
for (var i = 0; i < message.state_delta_entries.length; ++i)
|
|
3502
|
+
$root.koinos.protocol.state_delta_entry
|
|
3503
|
+
.encode(message.state_delta_entries[i], writer.uint32(/* id 12, wireType 2 =*/ 98).fork())
|
|
3504
|
+
.ldelim();
|
|
3240
3505
|
return writer;
|
|
3241
3506
|
};
|
|
3242
3507
|
/**
|
|
@@ -3317,6 +3582,13 @@
|
|
|
3317
3582
|
message.logs.push(reader.string());
|
|
3318
3583
|
break;
|
|
3319
3584
|
}
|
|
3585
|
+
case 12: {
|
|
3586
|
+
if (!(message.state_delta_entries &&
|
|
3587
|
+
message.state_delta_entries.length))
|
|
3588
|
+
message.state_delta_entries = [];
|
|
3589
|
+
message.state_delta_entries.push($root.koinos.protocol.state_delta_entry.decode(reader, reader.uint32()));
|
|
3590
|
+
break;
|
|
3591
|
+
}
|
|
3320
3592
|
default:
|
|
3321
3593
|
reader.skipType(tag & 7);
|
|
3322
3594
|
break;
|
|
@@ -3417,6 +3689,16 @@
|
|
|
3417
3689
|
if (!$util.isString(message.logs[i]))
|
|
3418
3690
|
return "logs: string[] expected";
|
|
3419
3691
|
}
|
|
3692
|
+
if (message.state_delta_entries != null &&
|
|
3693
|
+
message.hasOwnProperty("state_delta_entries")) {
|
|
3694
|
+
if (!Array.isArray(message.state_delta_entries))
|
|
3695
|
+
return "state_delta_entries: array expected";
|
|
3696
|
+
for (var i = 0; i < message.state_delta_entries.length; ++i) {
|
|
3697
|
+
var error = $root.koinos.protocol.state_delta_entry.verify(message.state_delta_entries[i]);
|
|
3698
|
+
if (error)
|
|
3699
|
+
return "state_delta_entries." + error;
|
|
3700
|
+
}
|
|
3701
|
+
}
|
|
3420
3702
|
return null;
|
|
3421
3703
|
};
|
|
3422
3704
|
/**
|
|
@@ -3514,6 +3796,17 @@
|
|
|
3514
3796
|
for (var i = 0; i < object.logs.length; ++i)
|
|
3515
3797
|
message.logs[i] = String(object.logs[i]);
|
|
3516
3798
|
}
|
|
3799
|
+
if (object.state_delta_entries) {
|
|
3800
|
+
if (!Array.isArray(object.state_delta_entries))
|
|
3801
|
+
throw TypeError(".koinos.protocol.transaction_receipt.state_delta_entries: array expected");
|
|
3802
|
+
message.state_delta_entries = [];
|
|
3803
|
+
for (var i = 0; i < object.state_delta_entries.length; ++i) {
|
|
3804
|
+
if (typeof object.state_delta_entries[i] !== "object")
|
|
3805
|
+
throw TypeError(".koinos.protocol.transaction_receipt.state_delta_entries: object expected");
|
|
3806
|
+
message.state_delta_entries[i] =
|
|
3807
|
+
$root.koinos.protocol.state_delta_entry.fromObject(object.state_delta_entries[i]);
|
|
3808
|
+
}
|
|
3809
|
+
}
|
|
3517
3810
|
return message;
|
|
3518
3811
|
};
|
|
3519
3812
|
/**
|
|
@@ -3532,6 +3825,7 @@
|
|
|
3532
3825
|
if (options.arrays || options.defaults) {
|
|
3533
3826
|
object.events = [];
|
|
3534
3827
|
object.logs = [];
|
|
3828
|
+
object.state_delta_entries = [];
|
|
3535
3829
|
}
|
|
3536
3830
|
if (options.defaults) {
|
|
3537
3831
|
if (options.bytes === String)
|
|
@@ -3726,6 +4020,13 @@
|
|
|
3726
4020
|
for (var j = 0; j < message.logs.length; ++j)
|
|
3727
4021
|
object.logs[j] = message.logs[j];
|
|
3728
4022
|
}
|
|
4023
|
+
if (message.state_delta_entries &&
|
|
4024
|
+
message.state_delta_entries.length) {
|
|
4025
|
+
object.state_delta_entries = [];
|
|
4026
|
+
for (var j = 0; j < message.state_delta_entries.length; ++j)
|
|
4027
|
+
object.state_delta_entries[j] =
|
|
4028
|
+
$root.koinos.protocol.state_delta_entry.toObject(message.state_delta_entries[j], options);
|
|
4029
|
+
}
|
|
3729
4030
|
return object;
|
|
3730
4031
|
};
|
|
3731
4032
|
/**
|
|
@@ -4588,6 +4889,10 @@
|
|
|
4588
4889
|
* @property {Array.<koinos.protocol.Ievent_data>|null} [events] block_receipt events
|
|
4589
4890
|
* @property {Array.<koinos.protocol.Itransaction_receipt>|null} [transaction_receipts] block_receipt transaction_receipts
|
|
4590
4891
|
* @property {Array.<string>|null} [logs] block_receipt logs
|
|
4892
|
+
* @property {number|Long|null} [disk_storage_charged] block_receipt disk_storage_charged
|
|
4893
|
+
* @property {number|Long|null} [network_bandwidth_charged] block_receipt network_bandwidth_charged
|
|
4894
|
+
* @property {number|Long|null} [compute_bandwidth_charged] block_receipt compute_bandwidth_charged
|
|
4895
|
+
* @property {Array.<koinos.protocol.Istate_delta_entry>|null} [state_delta_entries] block_receipt state_delta_entries
|
|
4591
4896
|
*/
|
|
4592
4897
|
/**
|
|
4593
4898
|
* Constructs a new block_receipt.
|
|
@@ -4601,6 +4906,7 @@
|
|
|
4601
4906
|
this.events = [];
|
|
4602
4907
|
this.transaction_receipts = [];
|
|
4603
4908
|
this.logs = [];
|
|
4909
|
+
this.state_delta_entries = [];
|
|
4604
4910
|
if (properties)
|
|
4605
4911
|
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
4606
4912
|
if (properties[keys[i]] != null)
|
|
@@ -4677,6 +4983,40 @@
|
|
|
4677
4983
|
* @instance
|
|
4678
4984
|
*/
|
|
4679
4985
|
block_receipt.prototype.logs = $util.emptyArray;
|
|
4986
|
+
/**
|
|
4987
|
+
* block_receipt disk_storage_charged.
|
|
4988
|
+
* @member {number|Long} disk_storage_charged
|
|
4989
|
+
* @memberof koinos.protocol.block_receipt
|
|
4990
|
+
* @instance
|
|
4991
|
+
*/
|
|
4992
|
+
block_receipt.prototype.disk_storage_charged = $util.Long
|
|
4993
|
+
? $util.Long.fromBits(0, 0, true)
|
|
4994
|
+
: 0;
|
|
4995
|
+
/**
|
|
4996
|
+
* block_receipt network_bandwidth_charged.
|
|
4997
|
+
* @member {number|Long} network_bandwidth_charged
|
|
4998
|
+
* @memberof koinos.protocol.block_receipt
|
|
4999
|
+
* @instance
|
|
5000
|
+
*/
|
|
5001
|
+
block_receipt.prototype.network_bandwidth_charged = $util.Long
|
|
5002
|
+
? $util.Long.fromBits(0, 0, true)
|
|
5003
|
+
: 0;
|
|
5004
|
+
/**
|
|
5005
|
+
* block_receipt compute_bandwidth_charged.
|
|
5006
|
+
* @member {number|Long} compute_bandwidth_charged
|
|
5007
|
+
* @memberof koinos.protocol.block_receipt
|
|
5008
|
+
* @instance
|
|
5009
|
+
*/
|
|
5010
|
+
block_receipt.prototype.compute_bandwidth_charged = $util.Long
|
|
5011
|
+
? $util.Long.fromBits(0, 0, true)
|
|
5012
|
+
: 0;
|
|
5013
|
+
/**
|
|
5014
|
+
* block_receipt state_delta_entries.
|
|
5015
|
+
* @member {Array.<koinos.protocol.Istate_delta_entry>} state_delta_entries
|
|
5016
|
+
* @memberof koinos.protocol.block_receipt
|
|
5017
|
+
* @instance
|
|
5018
|
+
*/
|
|
5019
|
+
block_receipt.prototype.state_delta_entries = $util.emptyArray;
|
|
4680
5020
|
/**
|
|
4681
5021
|
* Creates a new block_receipt instance using the specified properties.
|
|
4682
5022
|
* @function create
|
|
@@ -4739,6 +5079,27 @@
|
|
|
4739
5079
|
if (message.logs != null && message.logs.length)
|
|
4740
5080
|
for (var i = 0; i < message.logs.length; ++i)
|
|
4741
5081
|
writer.uint32(/* id 9, wireType 2 =*/ 74).string(message.logs[i]);
|
|
5082
|
+
if (message.disk_storage_charged != null &&
|
|
5083
|
+
Object.hasOwnProperty.call(message, "disk_storage_charged"))
|
|
5084
|
+
writer
|
|
5085
|
+
.uint32(/* id 10, wireType 0 =*/ 80)
|
|
5086
|
+
.uint64(message.disk_storage_charged);
|
|
5087
|
+
if (message.network_bandwidth_charged != null &&
|
|
5088
|
+
Object.hasOwnProperty.call(message, "network_bandwidth_charged"))
|
|
5089
|
+
writer
|
|
5090
|
+
.uint32(/* id 11, wireType 0 =*/ 88)
|
|
5091
|
+
.uint64(message.network_bandwidth_charged);
|
|
5092
|
+
if (message.compute_bandwidth_charged != null &&
|
|
5093
|
+
Object.hasOwnProperty.call(message, "compute_bandwidth_charged"))
|
|
5094
|
+
writer
|
|
5095
|
+
.uint32(/* id 12, wireType 0 =*/ 96)
|
|
5096
|
+
.uint64(message.compute_bandwidth_charged);
|
|
5097
|
+
if (message.state_delta_entries != null &&
|
|
5098
|
+
message.state_delta_entries.length)
|
|
5099
|
+
for (var i = 0; i < message.state_delta_entries.length; ++i)
|
|
5100
|
+
$root.koinos.protocol.state_delta_entry
|
|
5101
|
+
.encode(message.state_delta_entries[i], writer.uint32(/* id 13, wireType 2 =*/ 106).fork())
|
|
5102
|
+
.ldelim();
|
|
4742
5103
|
return writer;
|
|
4743
5104
|
};
|
|
4744
5105
|
/**
|
|
@@ -4814,6 +5175,25 @@
|
|
|
4814
5175
|
message.logs.push(reader.string());
|
|
4815
5176
|
break;
|
|
4816
5177
|
}
|
|
5178
|
+
case 10: {
|
|
5179
|
+
message.disk_storage_charged = reader.uint64();
|
|
5180
|
+
break;
|
|
5181
|
+
}
|
|
5182
|
+
case 11: {
|
|
5183
|
+
message.network_bandwidth_charged = reader.uint64();
|
|
5184
|
+
break;
|
|
5185
|
+
}
|
|
5186
|
+
case 12: {
|
|
5187
|
+
message.compute_bandwidth_charged = reader.uint64();
|
|
5188
|
+
break;
|
|
5189
|
+
}
|
|
5190
|
+
case 13: {
|
|
5191
|
+
if (!(message.state_delta_entries &&
|
|
5192
|
+
message.state_delta_entries.length))
|
|
5193
|
+
message.state_delta_entries = [];
|
|
5194
|
+
message.state_delta_entries.push($root.koinos.protocol.state_delta_entry.decode(reader, reader.uint32()));
|
|
5195
|
+
break;
|
|
5196
|
+
}
|
|
4817
5197
|
default:
|
|
4818
5198
|
reader.skipType(tag & 7);
|
|
4819
5199
|
break;
|
|
@@ -4910,6 +5290,37 @@
|
|
|
4910
5290
|
if (!$util.isString(message.logs[i]))
|
|
4911
5291
|
return "logs: string[] expected";
|
|
4912
5292
|
}
|
|
5293
|
+
if (message.disk_storage_charged != null &&
|
|
5294
|
+
message.hasOwnProperty("disk_storage_charged"))
|
|
5295
|
+
if (!$util.isInteger(message.disk_storage_charged) &&
|
|
5296
|
+
!(message.disk_storage_charged &&
|
|
5297
|
+
$util.isInteger(message.disk_storage_charged.low) &&
|
|
5298
|
+
$util.isInteger(message.disk_storage_charged.high)))
|
|
5299
|
+
return "disk_storage_charged: integer|Long expected";
|
|
5300
|
+
if (message.network_bandwidth_charged != null &&
|
|
5301
|
+
message.hasOwnProperty("network_bandwidth_charged"))
|
|
5302
|
+
if (!$util.isInteger(message.network_bandwidth_charged) &&
|
|
5303
|
+
!(message.network_bandwidth_charged &&
|
|
5304
|
+
$util.isInteger(message.network_bandwidth_charged.low) &&
|
|
5305
|
+
$util.isInteger(message.network_bandwidth_charged.high)))
|
|
5306
|
+
return "network_bandwidth_charged: integer|Long expected";
|
|
5307
|
+
if (message.compute_bandwidth_charged != null &&
|
|
5308
|
+
message.hasOwnProperty("compute_bandwidth_charged"))
|
|
5309
|
+
if (!$util.isInteger(message.compute_bandwidth_charged) &&
|
|
5310
|
+
!(message.compute_bandwidth_charged &&
|
|
5311
|
+
$util.isInteger(message.compute_bandwidth_charged.low) &&
|
|
5312
|
+
$util.isInteger(message.compute_bandwidth_charged.high)))
|
|
5313
|
+
return "compute_bandwidth_charged: integer|Long expected";
|
|
5314
|
+
if (message.state_delta_entries != null &&
|
|
5315
|
+
message.hasOwnProperty("state_delta_entries")) {
|
|
5316
|
+
if (!Array.isArray(message.state_delta_entries))
|
|
5317
|
+
return "state_delta_entries: array expected";
|
|
5318
|
+
for (var i = 0; i < message.state_delta_entries.length; ++i) {
|
|
5319
|
+
var error = $root.koinos.protocol.state_delta_entry.verify(message.state_delta_entries[i]);
|
|
5320
|
+
if (error)
|
|
5321
|
+
return "state_delta_entries." + error;
|
|
5322
|
+
}
|
|
5323
|
+
}
|
|
4913
5324
|
return null;
|
|
4914
5325
|
};
|
|
4915
5326
|
/**
|
|
@@ -4998,6 +5409,46 @@
|
|
|
4998
5409
|
for (var i = 0; i < object.logs.length; ++i)
|
|
4999
5410
|
message.logs[i] = String(object.logs[i]);
|
|
5000
5411
|
}
|
|
5412
|
+
if (object.disk_storage_charged != null)
|
|
5413
|
+
if ($util.Long)
|
|
5414
|
+
(message.disk_storage_charged = $util.Long.fromValue(object.disk_storage_charged)).unsigned = true;
|
|
5415
|
+
else if (typeof object.disk_storage_charged === "string")
|
|
5416
|
+
message.disk_storage_charged = parseInt(object.disk_storage_charged, 10);
|
|
5417
|
+
else if (typeof object.disk_storage_charged === "number")
|
|
5418
|
+
message.disk_storage_charged = object.disk_storage_charged;
|
|
5419
|
+
else if (typeof object.disk_storage_charged === "object")
|
|
5420
|
+
message.disk_storage_charged = new $util.LongBits(object.disk_storage_charged.low >>> 0, object.disk_storage_charged.high >>> 0).toNumber(true);
|
|
5421
|
+
if (object.network_bandwidth_charged != null)
|
|
5422
|
+
if ($util.Long)
|
|
5423
|
+
(message.network_bandwidth_charged = $util.Long.fromValue(object.network_bandwidth_charged)).unsigned = true;
|
|
5424
|
+
else if (typeof object.network_bandwidth_charged === "string")
|
|
5425
|
+
message.network_bandwidth_charged = parseInt(object.network_bandwidth_charged, 10);
|
|
5426
|
+
else if (typeof object.network_bandwidth_charged === "number")
|
|
5427
|
+
message.network_bandwidth_charged =
|
|
5428
|
+
object.network_bandwidth_charged;
|
|
5429
|
+
else if (typeof object.network_bandwidth_charged === "object")
|
|
5430
|
+
message.network_bandwidth_charged = new $util.LongBits(object.network_bandwidth_charged.low >>> 0, object.network_bandwidth_charged.high >>> 0).toNumber(true);
|
|
5431
|
+
if (object.compute_bandwidth_charged != null)
|
|
5432
|
+
if ($util.Long)
|
|
5433
|
+
(message.compute_bandwidth_charged = $util.Long.fromValue(object.compute_bandwidth_charged)).unsigned = true;
|
|
5434
|
+
else if (typeof object.compute_bandwidth_charged === "string")
|
|
5435
|
+
message.compute_bandwidth_charged = parseInt(object.compute_bandwidth_charged, 10);
|
|
5436
|
+
else if (typeof object.compute_bandwidth_charged === "number")
|
|
5437
|
+
message.compute_bandwidth_charged =
|
|
5438
|
+
object.compute_bandwidth_charged;
|
|
5439
|
+
else if (typeof object.compute_bandwidth_charged === "object")
|
|
5440
|
+
message.compute_bandwidth_charged = new $util.LongBits(object.compute_bandwidth_charged.low >>> 0, object.compute_bandwidth_charged.high >>> 0).toNumber(true);
|
|
5441
|
+
if (object.state_delta_entries) {
|
|
5442
|
+
if (!Array.isArray(object.state_delta_entries))
|
|
5443
|
+
throw TypeError(".koinos.protocol.block_receipt.state_delta_entries: array expected");
|
|
5444
|
+
message.state_delta_entries = [];
|
|
5445
|
+
for (var i = 0; i < object.state_delta_entries.length; ++i) {
|
|
5446
|
+
if (typeof object.state_delta_entries[i] !== "object")
|
|
5447
|
+
throw TypeError(".koinos.protocol.block_receipt.state_delta_entries: object expected");
|
|
5448
|
+
message.state_delta_entries[i] =
|
|
5449
|
+
$root.koinos.protocol.state_delta_entry.fromObject(object.state_delta_entries[i]);
|
|
5450
|
+
}
|
|
5451
|
+
}
|
|
5001
5452
|
return message;
|
|
5002
5453
|
};
|
|
5003
5454
|
/**
|
|
@@ -5017,6 +5468,7 @@
|
|
|
5017
5468
|
object.events = [];
|
|
5018
5469
|
object.transaction_receipts = [];
|
|
5019
5470
|
object.logs = [];
|
|
5471
|
+
object.state_delta_entries = [];
|
|
5020
5472
|
}
|
|
5021
5473
|
if (options.defaults) {
|
|
5022
5474
|
if (options.bytes === String)
|
|
@@ -5079,6 +5531,41 @@
|
|
|
5079
5531
|
if (options.bytes !== Array)
|
|
5080
5532
|
object.state_merkle_root = $util.newBuffer(object.state_merkle_root);
|
|
5081
5533
|
}
|
|
5534
|
+
if ($util.Long) {
|
|
5535
|
+
var long = new $util.Long(0, 0, true);
|
|
5536
|
+
object.disk_storage_charged =
|
|
5537
|
+
options.longs === String
|
|
5538
|
+
? long.toString()
|
|
5539
|
+
: options.longs === Number
|
|
5540
|
+
? long.toNumber()
|
|
5541
|
+
: long;
|
|
5542
|
+
}
|
|
5543
|
+
else
|
|
5544
|
+
object.disk_storage_charged = options.longs === String ? "0" : 0;
|
|
5545
|
+
if ($util.Long) {
|
|
5546
|
+
var long = new $util.Long(0, 0, true);
|
|
5547
|
+
object.network_bandwidth_charged =
|
|
5548
|
+
options.longs === String
|
|
5549
|
+
? long.toString()
|
|
5550
|
+
: options.longs === Number
|
|
5551
|
+
? long.toNumber()
|
|
5552
|
+
: long;
|
|
5553
|
+
}
|
|
5554
|
+
else
|
|
5555
|
+
object.network_bandwidth_charged =
|
|
5556
|
+
options.longs === String ? "0" : 0;
|
|
5557
|
+
if ($util.Long) {
|
|
5558
|
+
var long = new $util.Long(0, 0, true);
|
|
5559
|
+
object.compute_bandwidth_charged =
|
|
5560
|
+
options.longs === String
|
|
5561
|
+
? long.toString()
|
|
5562
|
+
: options.longs === Number
|
|
5563
|
+
? long.toNumber()
|
|
5564
|
+
: long;
|
|
5565
|
+
}
|
|
5566
|
+
else
|
|
5567
|
+
object.compute_bandwidth_charged =
|
|
5568
|
+
options.longs === String ? "0" : 0;
|
|
5082
5569
|
}
|
|
5083
5570
|
if (message.id != null && message.hasOwnProperty("id"))
|
|
5084
5571
|
object.id =
|
|
@@ -5167,6 +5654,55 @@
|
|
|
5167
5654
|
for (var j = 0; j < message.logs.length; ++j)
|
|
5168
5655
|
object.logs[j] = message.logs[j];
|
|
5169
5656
|
}
|
|
5657
|
+
if (message.disk_storage_charged != null &&
|
|
5658
|
+
message.hasOwnProperty("disk_storage_charged"))
|
|
5659
|
+
if (typeof message.disk_storage_charged === "number")
|
|
5660
|
+
object.disk_storage_charged =
|
|
5661
|
+
options.longs === String
|
|
5662
|
+
? String(message.disk_storage_charged)
|
|
5663
|
+
: message.disk_storage_charged;
|
|
5664
|
+
else
|
|
5665
|
+
object.disk_storage_charged =
|
|
5666
|
+
options.longs === String
|
|
5667
|
+
? $util.Long.prototype.toString.call(message.disk_storage_charged)
|
|
5668
|
+
: options.longs === Number
|
|
5669
|
+
? new $util.LongBits(message.disk_storage_charged.low >>> 0, message.disk_storage_charged.high >>> 0).toNumber(true)
|
|
5670
|
+
: message.disk_storage_charged;
|
|
5671
|
+
if (message.network_bandwidth_charged != null &&
|
|
5672
|
+
message.hasOwnProperty("network_bandwidth_charged"))
|
|
5673
|
+
if (typeof message.network_bandwidth_charged === "number")
|
|
5674
|
+
object.network_bandwidth_charged =
|
|
5675
|
+
options.longs === String
|
|
5676
|
+
? String(message.network_bandwidth_charged)
|
|
5677
|
+
: message.network_bandwidth_charged;
|
|
5678
|
+
else
|
|
5679
|
+
object.network_bandwidth_charged =
|
|
5680
|
+
options.longs === String
|
|
5681
|
+
? $util.Long.prototype.toString.call(message.network_bandwidth_charged)
|
|
5682
|
+
: options.longs === Number
|
|
5683
|
+
? new $util.LongBits(message.network_bandwidth_charged.low >>> 0, message.network_bandwidth_charged.high >>> 0).toNumber(true)
|
|
5684
|
+
: message.network_bandwidth_charged;
|
|
5685
|
+
if (message.compute_bandwidth_charged != null &&
|
|
5686
|
+
message.hasOwnProperty("compute_bandwidth_charged"))
|
|
5687
|
+
if (typeof message.compute_bandwidth_charged === "number")
|
|
5688
|
+
object.compute_bandwidth_charged =
|
|
5689
|
+
options.longs === String
|
|
5690
|
+
? String(message.compute_bandwidth_charged)
|
|
5691
|
+
: message.compute_bandwidth_charged;
|
|
5692
|
+
else
|
|
5693
|
+
object.compute_bandwidth_charged =
|
|
5694
|
+
options.longs === String
|
|
5695
|
+
? $util.Long.prototype.toString.call(message.compute_bandwidth_charged)
|
|
5696
|
+
: options.longs === Number
|
|
5697
|
+
? new $util.LongBits(message.compute_bandwidth_charged.low >>> 0, message.compute_bandwidth_charged.high >>> 0).toNumber(true)
|
|
5698
|
+
: message.compute_bandwidth_charged;
|
|
5699
|
+
if (message.state_delta_entries &&
|
|
5700
|
+
message.state_delta_entries.length) {
|
|
5701
|
+
object.state_delta_entries = [];
|
|
5702
|
+
for (var j = 0; j < message.state_delta_entries.length; ++j)
|
|
5703
|
+
object.state_delta_entries[j] =
|
|
5704
|
+
$root.koinos.protocol.state_delta_entry.toObject(message.state_delta_entries[j], options);
|
|
5705
|
+
}
|
|
5170
5706
|
return object;
|
|
5171
5707
|
};
|
|
5172
5708
|
/**
|
|
@@ -5195,6 +5731,293 @@
|
|
|
5195
5731
|
};
|
|
5196
5732
|
return block_receipt;
|
|
5197
5733
|
})();
|
|
5734
|
+
protocol.state_delta_entry = (function () {
|
|
5735
|
+
/**
|
|
5736
|
+
* Properties of a state_delta_entry.
|
|
5737
|
+
* @memberof koinos.protocol
|
|
5738
|
+
* @interface Istate_delta_entry
|
|
5739
|
+
* @property {koinos.protocol.Iobject_space|null} [object_space] state_delta_entry object_space
|
|
5740
|
+
* @property {Uint8Array|null} [key] state_delta_entry key
|
|
5741
|
+
* @property {Uint8Array|null} [value] state_delta_entry value
|
|
5742
|
+
*/
|
|
5743
|
+
/**
|
|
5744
|
+
* Constructs a new state_delta_entry.
|
|
5745
|
+
* @memberof koinos.protocol
|
|
5746
|
+
* @classdesc Represents a state_delta_entry.
|
|
5747
|
+
* @implements Istate_delta_entry
|
|
5748
|
+
* @constructor
|
|
5749
|
+
* @param {koinos.protocol.Istate_delta_entry=} [properties] Properties to set
|
|
5750
|
+
*/
|
|
5751
|
+
function state_delta_entry(properties) {
|
|
5752
|
+
if (properties)
|
|
5753
|
+
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
|
|
5754
|
+
if (properties[keys[i]] != null)
|
|
5755
|
+
this[keys[i]] = properties[keys[i]];
|
|
5756
|
+
}
|
|
5757
|
+
/**
|
|
5758
|
+
* state_delta_entry object_space.
|
|
5759
|
+
* @member {koinos.protocol.Iobject_space|null|undefined} object_space
|
|
5760
|
+
* @memberof koinos.protocol.state_delta_entry
|
|
5761
|
+
* @instance
|
|
5762
|
+
*/
|
|
5763
|
+
state_delta_entry.prototype.object_space = null;
|
|
5764
|
+
/**
|
|
5765
|
+
* state_delta_entry key.
|
|
5766
|
+
* @member {Uint8Array} key
|
|
5767
|
+
* @memberof koinos.protocol.state_delta_entry
|
|
5768
|
+
* @instance
|
|
5769
|
+
*/
|
|
5770
|
+
state_delta_entry.prototype.key = $util.newBuffer([]);
|
|
5771
|
+
/**
|
|
5772
|
+
* state_delta_entry value.
|
|
5773
|
+
* @member {Uint8Array|null|undefined} value
|
|
5774
|
+
* @memberof koinos.protocol.state_delta_entry
|
|
5775
|
+
* @instance
|
|
5776
|
+
*/
|
|
5777
|
+
state_delta_entry.prototype.value = null;
|
|
5778
|
+
// OneOf field names bound to virtual getters and setters
|
|
5779
|
+
var $oneOfFields;
|
|
5780
|
+
/**
|
|
5781
|
+
* state_delta_entry _value.
|
|
5782
|
+
* @member {"value"|undefined} _value
|
|
5783
|
+
* @memberof koinos.protocol.state_delta_entry
|
|
5784
|
+
* @instance
|
|
5785
|
+
*/
|
|
5786
|
+
Object.defineProperty(state_delta_entry.prototype, "_value", {
|
|
5787
|
+
get: $util.oneOfGetter(($oneOfFields = ["value"])),
|
|
5788
|
+
set: $util.oneOfSetter($oneOfFields),
|
|
5789
|
+
});
|
|
5790
|
+
/**
|
|
5791
|
+
* Creates a new state_delta_entry instance using the specified properties.
|
|
5792
|
+
* @function create
|
|
5793
|
+
* @memberof koinos.protocol.state_delta_entry
|
|
5794
|
+
* @static
|
|
5795
|
+
* @param {koinos.protocol.Istate_delta_entry=} [properties] Properties to set
|
|
5796
|
+
* @returns {koinos.protocol.state_delta_entry} state_delta_entry instance
|
|
5797
|
+
*/
|
|
5798
|
+
state_delta_entry.create = function create(properties) {
|
|
5799
|
+
return new state_delta_entry(properties);
|
|
5800
|
+
};
|
|
5801
|
+
/**
|
|
5802
|
+
* Encodes the specified state_delta_entry message. Does not implicitly {@link koinos.protocol.state_delta_entry.verify|verify} messages.
|
|
5803
|
+
* @function encode
|
|
5804
|
+
* @memberof koinos.protocol.state_delta_entry
|
|
5805
|
+
* @static
|
|
5806
|
+
* @param {koinos.protocol.Istate_delta_entry} message state_delta_entry message or plain object to encode
|
|
5807
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
5808
|
+
* @returns {$protobuf.Writer} Writer
|
|
5809
|
+
*/
|
|
5810
|
+
state_delta_entry.encode = function encode(message, writer) {
|
|
5811
|
+
if (!writer)
|
|
5812
|
+
writer = $Writer.create();
|
|
5813
|
+
if (message.object_space != null &&
|
|
5814
|
+
Object.hasOwnProperty.call(message, "object_space"))
|
|
5815
|
+
$root.koinos.protocol.object_space
|
|
5816
|
+
.encode(message.object_space, writer.uint32(/* id 1, wireType 2 =*/ 10).fork())
|
|
5817
|
+
.ldelim();
|
|
5818
|
+
if (message.key != null && Object.hasOwnProperty.call(message, "key"))
|
|
5819
|
+
writer.uint32(/* id 2, wireType 2 =*/ 18).bytes(message.key);
|
|
5820
|
+
if (message.value != null &&
|
|
5821
|
+
Object.hasOwnProperty.call(message, "value"))
|
|
5822
|
+
writer.uint32(/* id 3, wireType 2 =*/ 26).bytes(message.value);
|
|
5823
|
+
return writer;
|
|
5824
|
+
};
|
|
5825
|
+
/**
|
|
5826
|
+
* Encodes the specified state_delta_entry message, length delimited. Does not implicitly {@link koinos.protocol.state_delta_entry.verify|verify} messages.
|
|
5827
|
+
* @function encodeDelimited
|
|
5828
|
+
* @memberof koinos.protocol.state_delta_entry
|
|
5829
|
+
* @static
|
|
5830
|
+
* @param {koinos.protocol.Istate_delta_entry} message state_delta_entry message or plain object to encode
|
|
5831
|
+
* @param {$protobuf.Writer} [writer] Writer to encode to
|
|
5832
|
+
* @returns {$protobuf.Writer} Writer
|
|
5833
|
+
*/
|
|
5834
|
+
state_delta_entry.encodeDelimited = function encodeDelimited(message, writer) {
|
|
5835
|
+
return this.encode(message, writer).ldelim();
|
|
5836
|
+
};
|
|
5837
|
+
/**
|
|
5838
|
+
* Decodes a state_delta_entry message from the specified reader or buffer.
|
|
5839
|
+
* @function decode
|
|
5840
|
+
* @memberof koinos.protocol.state_delta_entry
|
|
5841
|
+
* @static
|
|
5842
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
5843
|
+
* @param {number} [length] Message length if known beforehand
|
|
5844
|
+
* @returns {koinos.protocol.state_delta_entry} state_delta_entry
|
|
5845
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
5846
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
5847
|
+
*/
|
|
5848
|
+
state_delta_entry.decode = function decode(reader, length) {
|
|
5849
|
+
if (!(reader instanceof $Reader))
|
|
5850
|
+
reader = $Reader.create(reader);
|
|
5851
|
+
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.koinos.protocol.state_delta_entry();
|
|
5852
|
+
while (reader.pos < end) {
|
|
5853
|
+
var tag = reader.uint32();
|
|
5854
|
+
switch (tag >>> 3) {
|
|
5855
|
+
case 1: {
|
|
5856
|
+
message.object_space =
|
|
5857
|
+
$root.koinos.protocol.object_space.decode(reader, reader.uint32());
|
|
5858
|
+
break;
|
|
5859
|
+
}
|
|
5860
|
+
case 2: {
|
|
5861
|
+
message.key = reader.bytes();
|
|
5862
|
+
break;
|
|
5863
|
+
}
|
|
5864
|
+
case 3: {
|
|
5865
|
+
message.value = reader.bytes();
|
|
5866
|
+
break;
|
|
5867
|
+
}
|
|
5868
|
+
default:
|
|
5869
|
+
reader.skipType(tag & 7);
|
|
5870
|
+
break;
|
|
5871
|
+
}
|
|
5872
|
+
}
|
|
5873
|
+
return message;
|
|
5874
|
+
};
|
|
5875
|
+
/**
|
|
5876
|
+
* Decodes a state_delta_entry message from the specified reader or buffer, length delimited.
|
|
5877
|
+
* @function decodeDelimited
|
|
5878
|
+
* @memberof koinos.protocol.state_delta_entry
|
|
5879
|
+
* @static
|
|
5880
|
+
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
|
|
5881
|
+
* @returns {koinos.protocol.state_delta_entry} state_delta_entry
|
|
5882
|
+
* @throws {Error} If the payload is not a reader or valid buffer
|
|
5883
|
+
* @throws {$protobuf.util.ProtocolError} If required fields are missing
|
|
5884
|
+
*/
|
|
5885
|
+
state_delta_entry.decodeDelimited = function decodeDelimited(reader) {
|
|
5886
|
+
if (!(reader instanceof $Reader))
|
|
5887
|
+
reader = new $Reader(reader);
|
|
5888
|
+
return this.decode(reader, reader.uint32());
|
|
5889
|
+
};
|
|
5890
|
+
/**
|
|
5891
|
+
* Verifies a state_delta_entry message.
|
|
5892
|
+
* @function verify
|
|
5893
|
+
* @memberof koinos.protocol.state_delta_entry
|
|
5894
|
+
* @static
|
|
5895
|
+
* @param {Object.<string,*>} message Plain object to verify
|
|
5896
|
+
* @returns {string|null} `null` if valid, otherwise the reason why it is not
|
|
5897
|
+
*/
|
|
5898
|
+
state_delta_entry.verify = function verify(message) {
|
|
5899
|
+
if (typeof message !== "object" || message === null)
|
|
5900
|
+
return "object expected";
|
|
5901
|
+
var properties = {};
|
|
5902
|
+
if (message.object_space != null &&
|
|
5903
|
+
message.hasOwnProperty("object_space")) {
|
|
5904
|
+
var error = $root.koinos.protocol.object_space.verify(message.object_space);
|
|
5905
|
+
if (error)
|
|
5906
|
+
return "object_space." + error;
|
|
5907
|
+
}
|
|
5908
|
+
if (message.key != null && message.hasOwnProperty("key"))
|
|
5909
|
+
if (!((message.key && typeof message.key.length === "number") ||
|
|
5910
|
+
$util.isString(message.key)))
|
|
5911
|
+
return "key: buffer expected";
|
|
5912
|
+
if (message.value != null && message.hasOwnProperty("value")) {
|
|
5913
|
+
properties._value = 1;
|
|
5914
|
+
if (!((message.value && typeof message.value.length === "number") ||
|
|
5915
|
+
$util.isString(message.value)))
|
|
5916
|
+
return "value: buffer expected";
|
|
5917
|
+
}
|
|
5918
|
+
return null;
|
|
5919
|
+
};
|
|
5920
|
+
/**
|
|
5921
|
+
* Creates a state_delta_entry message from a plain object. Also converts values to their respective internal types.
|
|
5922
|
+
* @function fromObject
|
|
5923
|
+
* @memberof koinos.protocol.state_delta_entry
|
|
5924
|
+
* @static
|
|
5925
|
+
* @param {Object.<string,*>} object Plain object
|
|
5926
|
+
* @returns {koinos.protocol.state_delta_entry} state_delta_entry
|
|
5927
|
+
*/
|
|
5928
|
+
state_delta_entry.fromObject = function fromObject(object) {
|
|
5929
|
+
if (object instanceof $root.koinos.protocol.state_delta_entry)
|
|
5930
|
+
return object;
|
|
5931
|
+
var message = new $root.koinos.protocol.state_delta_entry();
|
|
5932
|
+
if (object.object_space != null) {
|
|
5933
|
+
if (typeof object.object_space !== "object")
|
|
5934
|
+
throw TypeError(".koinos.protocol.state_delta_entry.object_space: object expected");
|
|
5935
|
+
message.object_space =
|
|
5936
|
+
$root.koinos.protocol.object_space.fromObject(object.object_space);
|
|
5937
|
+
}
|
|
5938
|
+
if (object.key != null)
|
|
5939
|
+
if (typeof object.key === "string")
|
|
5940
|
+
$util.base64.decode(object.key, (message.key = $util.newBuffer($util.base64.length(object.key))), 0);
|
|
5941
|
+
else if (object.key.length >= 0)
|
|
5942
|
+
message.key = object.key;
|
|
5943
|
+
if (object.value != null)
|
|
5944
|
+
if (typeof object.value === "string")
|
|
5945
|
+
$util.base64.decode(object.value, (message.value = $util.newBuffer($util.base64.length(object.value))), 0);
|
|
5946
|
+
else if (object.value.length >= 0)
|
|
5947
|
+
message.value = object.value;
|
|
5948
|
+
return message;
|
|
5949
|
+
};
|
|
5950
|
+
/**
|
|
5951
|
+
* Creates a plain object from a state_delta_entry message. Also converts values to other types if specified.
|
|
5952
|
+
* @function toObject
|
|
5953
|
+
* @memberof koinos.protocol.state_delta_entry
|
|
5954
|
+
* @static
|
|
5955
|
+
* @param {koinos.protocol.state_delta_entry} message state_delta_entry
|
|
5956
|
+
* @param {$protobuf.IConversionOptions} [options] Conversion options
|
|
5957
|
+
* @returns {Object.<string,*>} Plain object
|
|
5958
|
+
*/
|
|
5959
|
+
state_delta_entry.toObject = function toObject(message, options) {
|
|
5960
|
+
if (!options)
|
|
5961
|
+
options = {};
|
|
5962
|
+
var object = {};
|
|
5963
|
+
if (options.defaults) {
|
|
5964
|
+
object.object_space = null;
|
|
5965
|
+
if (options.bytes === String)
|
|
5966
|
+
object.key = "";
|
|
5967
|
+
else {
|
|
5968
|
+
object.key = [];
|
|
5969
|
+
if (options.bytes !== Array)
|
|
5970
|
+
object.key = $util.newBuffer(object.key);
|
|
5971
|
+
}
|
|
5972
|
+
}
|
|
5973
|
+
if (message.object_space != null &&
|
|
5974
|
+
message.hasOwnProperty("object_space"))
|
|
5975
|
+
object.object_space = $root.koinos.protocol.object_space.toObject(message.object_space, options);
|
|
5976
|
+
if (message.key != null && message.hasOwnProperty("key"))
|
|
5977
|
+
object.key =
|
|
5978
|
+
options.bytes === String
|
|
5979
|
+
? $util.base64.encode(message.key, 0, message.key.length)
|
|
5980
|
+
: options.bytes === Array
|
|
5981
|
+
? Array.prototype.slice.call(message.key)
|
|
5982
|
+
: message.key;
|
|
5983
|
+
if (message.value != null && message.hasOwnProperty("value")) {
|
|
5984
|
+
object.value =
|
|
5985
|
+
options.bytes === String
|
|
5986
|
+
? $util.base64.encode(message.value, 0, message.value.length)
|
|
5987
|
+
: options.bytes === Array
|
|
5988
|
+
? Array.prototype.slice.call(message.value)
|
|
5989
|
+
: message.value;
|
|
5990
|
+
if (options.oneofs)
|
|
5991
|
+
object._value = "value";
|
|
5992
|
+
}
|
|
5993
|
+
return object;
|
|
5994
|
+
};
|
|
5995
|
+
/**
|
|
5996
|
+
* Converts this state_delta_entry to JSON.
|
|
5997
|
+
* @function toJSON
|
|
5998
|
+
* @memberof koinos.protocol.state_delta_entry
|
|
5999
|
+
* @instance
|
|
6000
|
+
* @returns {Object.<string,*>} JSON object
|
|
6001
|
+
*/
|
|
6002
|
+
state_delta_entry.prototype.toJSON = function toJSON() {
|
|
6003
|
+
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
|
|
6004
|
+
};
|
|
6005
|
+
/**
|
|
6006
|
+
* Gets the default type url for state_delta_entry
|
|
6007
|
+
* @function getTypeUrl
|
|
6008
|
+
* @memberof koinos.protocol.state_delta_entry
|
|
6009
|
+
* @static
|
|
6010
|
+
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
|
|
6011
|
+
* @returns {string} The default type url
|
|
6012
|
+
*/
|
|
6013
|
+
state_delta_entry.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
|
|
6014
|
+
if (typeUrlPrefix === undefined) {
|
|
6015
|
+
typeUrlPrefix = "type.googleapis.com";
|
|
6016
|
+
}
|
|
6017
|
+
return typeUrlPrefix + "/koinos.protocol.state_delta_entry";
|
|
6018
|
+
};
|
|
6019
|
+
return state_delta_entry;
|
|
6020
|
+
})();
|
|
5198
6021
|
return protocol;
|
|
5199
6022
|
})();
|
|
5200
6023
|
koinos.chain = (function () {
|