@trustwallet/wallet-core 4.2.0-dev-rc1 → 4.2.0-dev-rc3

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.
@@ -90644,6 +90644,22 @@
90644
90644
  */
90645
90645
  var Proto = {};
90646
90646
 
90647
+ /**
90648
+ * NetworkId enum.
90649
+ * @name TW.Nimiq.Proto.NetworkId
90650
+ * @enum {number}
90651
+ * @property {number} UseDefault=0 UseDefault value
90652
+ * @property {number} Mainnet=42 Mainnet value
90653
+ * @property {number} MainnetAlbatross=24 MainnetAlbatross value
90654
+ */
90655
+ Proto.NetworkId = (function() {
90656
+ var valuesById = {}, values = Object.create(valuesById);
90657
+ values[valuesById[0] = "UseDefault"] = 0;
90658
+ values[valuesById[42] = "Mainnet"] = 42;
90659
+ values[valuesById[24] = "MainnetAlbatross"] = 24;
90660
+ return values;
90661
+ })();
90662
+
90647
90663
  Proto.SigningInput = (function() {
90648
90664
 
90649
90665
  /**
@@ -90655,6 +90671,7 @@
90655
90671
  * @property {Long|null} [value] SigningInput value
90656
90672
  * @property {Long|null} [fee] SigningInput fee
90657
90673
  * @property {number|null} [validityStartHeight] SigningInput validityStartHeight
90674
+ * @property {TW.Nimiq.Proto.NetworkId|null} [networkId] SigningInput networkId
90658
90675
  */
90659
90676
 
90660
90677
  /**
@@ -90712,6 +90729,14 @@
90712
90729
  */
90713
90730
  SigningInput.prototype.validityStartHeight = 0;
90714
90731
 
90732
+ /**
90733
+ * SigningInput networkId.
90734
+ * @member {TW.Nimiq.Proto.NetworkId} networkId
90735
+ * @memberof TW.Nimiq.Proto.SigningInput
90736
+ * @instance
90737
+ */
90738
+ SigningInput.prototype.networkId = 0;
90739
+
90715
90740
  /**
90716
90741
  * Creates a new SigningInput instance using the specified properties.
90717
90742
  * @function create
@@ -90746,6 +90771,8 @@
90746
90771
  writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.fee);
90747
90772
  if (message.validityStartHeight != null && Object.hasOwnProperty.call(message, "validityStartHeight"))
90748
90773
  writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.validityStartHeight);
90774
+ if (message.networkId != null && Object.hasOwnProperty.call(message, "networkId"))
90775
+ writer.uint32(/* id 6, wireType 0 =*/48).int32(message.networkId);
90749
90776
  return writer;
90750
90777
  };
90751
90778
 
@@ -90782,6 +90809,9 @@
90782
90809
  case 5:
90783
90810
  message.validityStartHeight = reader.uint32();
90784
90811
  break;
90812
+ case 6:
90813
+ message.networkId = reader.int32();
90814
+ break;
90785
90815
  default:
90786
90816
  reader.skipType(tag & 7);
90787
90817
  break;
@@ -90816,6 +90846,15 @@
90816
90846
  if (message.validityStartHeight != null && message.hasOwnProperty("validityStartHeight"))
90817
90847
  if (!$util.isInteger(message.validityStartHeight))
90818
90848
  return "validityStartHeight: integer expected";
90849
+ if (message.networkId != null && message.hasOwnProperty("networkId"))
90850
+ switch (message.networkId) {
90851
+ default:
90852
+ return "networkId: enum value expected";
90853
+ case 0:
90854
+ case 42:
90855
+ case 24:
90856
+ break;
90857
+ }
90819
90858
  return null;
90820
90859
  };
90821
90860
 
@@ -90858,6 +90897,20 @@
90858
90897
  message.fee = new $util.LongBits(object.fee.low >>> 0, object.fee.high >>> 0).toNumber(true);
90859
90898
  if (object.validityStartHeight != null)
90860
90899
  message.validityStartHeight = object.validityStartHeight >>> 0;
90900
+ switch (object.networkId) {
90901
+ case "UseDefault":
90902
+ case 0:
90903
+ message.networkId = 0;
90904
+ break;
90905
+ case "Mainnet":
90906
+ case 42:
90907
+ message.networkId = 42;
90908
+ break;
90909
+ case "MainnetAlbatross":
90910
+ case 24:
90911
+ message.networkId = 24;
90912
+ break;
90913
+ }
90861
90914
  return message;
90862
90915
  };
90863
90916
 
@@ -90894,6 +90947,7 @@
90894
90947
  } else
90895
90948
  object.fee = options.longs === String ? "0" : 0;
90896
90949
  object.validityStartHeight = 0;
90950
+ object.networkId = options.enums === String ? "UseDefault" : 0;
90897
90951
  }
90898
90952
  if (message.privateKey != null && message.hasOwnProperty("privateKey"))
90899
90953
  object.privateKey = options.bytes === String ? $util.base64.encode(message.privateKey, 0, message.privateKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.privateKey) : message.privateKey;
@@ -90911,6 +90965,8 @@
90911
90965
  object.fee = options.longs === String ? $util.Long.prototype.toString.call(message.fee) : options.longs === Number ? new $util.LongBits(message.fee.low >>> 0, message.fee.high >>> 0).toNumber(true) : message.fee;
90912
90966
  if (message.validityStartHeight != null && message.hasOwnProperty("validityStartHeight"))
90913
90967
  object.validityStartHeight = message.validityStartHeight;
90968
+ if (message.networkId != null && message.hasOwnProperty("networkId"))
90969
+ object.networkId = options.enums === String ? $root.TW.Nimiq.Proto.NetworkId[message.networkId] : message.networkId;
90914
90970
  return object;
90915
90971
  };
90916
90972
 
@@ -94880,56 +94936,1500 @@
94880
94936
  /**
94881
94937
  * Decodes a SigningInput message from the specified reader or buffer.
94882
94938
  * @function decode
94883
- * @memberof TW.Ontology.Proto.SigningInput
94939
+ * @memberof TW.Ontology.Proto.SigningInput
94940
+ * @static
94941
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
94942
+ * @param {number} [length] Message length if known beforehand
94943
+ * @returns {TW.Ontology.Proto.SigningInput} SigningInput
94944
+ * @throws {Error} If the payload is not a reader or valid buffer
94945
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
94946
+ */
94947
+ SigningInput.decode = function decode(reader, length) {
94948
+ if (!(reader instanceof $Reader))
94949
+ reader = $Reader.create(reader);
94950
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Ontology.Proto.SigningInput();
94951
+ while (reader.pos < end) {
94952
+ var tag = reader.uint32();
94953
+ switch (tag >>> 3) {
94954
+ case 1:
94955
+ message.contract = reader.string();
94956
+ break;
94957
+ case 2:
94958
+ message.method = reader.string();
94959
+ break;
94960
+ case 3:
94961
+ message.ownerPrivateKey = reader.bytes();
94962
+ break;
94963
+ case 4:
94964
+ message.toAddress = reader.string();
94965
+ break;
94966
+ case 5:
94967
+ message.amount = reader.uint64();
94968
+ break;
94969
+ case 6:
94970
+ message.payerPrivateKey = reader.bytes();
94971
+ break;
94972
+ case 7:
94973
+ message.gasPrice = reader.uint64();
94974
+ break;
94975
+ case 8:
94976
+ message.gasLimit = reader.uint64();
94977
+ break;
94978
+ case 9:
94979
+ message.queryAddress = reader.string();
94980
+ break;
94981
+ case 10:
94982
+ message.nonce = reader.uint32();
94983
+ break;
94984
+ case 11:
94985
+ message.ownerAddress = reader.string();
94986
+ break;
94987
+ case 12:
94988
+ message.payerAddress = reader.string();
94989
+ break;
94990
+ default:
94991
+ reader.skipType(tag & 7);
94992
+ break;
94993
+ }
94994
+ }
94995
+ return message;
94996
+ };
94997
+
94998
+ /**
94999
+ * Verifies a SigningInput message.
95000
+ * @function verify
95001
+ * @memberof TW.Ontology.Proto.SigningInput
95002
+ * @static
95003
+ * @param {Object.<string,*>} message Plain object to verify
95004
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
95005
+ */
95006
+ SigningInput.verify = function verify(message) {
95007
+ if (typeof message !== "object" || message === null)
95008
+ return "object expected";
95009
+ if (message.contract != null && message.hasOwnProperty("contract"))
95010
+ if (!$util.isString(message.contract))
95011
+ return "contract: string expected";
95012
+ if (message.method != null && message.hasOwnProperty("method"))
95013
+ if (!$util.isString(message.method))
95014
+ return "method: string expected";
95015
+ if (message.ownerPrivateKey != null && message.hasOwnProperty("ownerPrivateKey"))
95016
+ if (!(message.ownerPrivateKey && typeof message.ownerPrivateKey.length === "number" || $util.isString(message.ownerPrivateKey)))
95017
+ return "ownerPrivateKey: buffer expected";
95018
+ if (message.toAddress != null && message.hasOwnProperty("toAddress"))
95019
+ if (!$util.isString(message.toAddress))
95020
+ return "toAddress: string expected";
95021
+ if (message.amount != null && message.hasOwnProperty("amount"))
95022
+ if (!$util.isInteger(message.amount) && !(message.amount && $util.isInteger(message.amount.low) && $util.isInteger(message.amount.high)))
95023
+ return "amount: integer|Long expected";
95024
+ if (message.payerPrivateKey != null && message.hasOwnProperty("payerPrivateKey"))
95025
+ if (!(message.payerPrivateKey && typeof message.payerPrivateKey.length === "number" || $util.isString(message.payerPrivateKey)))
95026
+ return "payerPrivateKey: buffer expected";
95027
+ if (message.gasPrice != null && message.hasOwnProperty("gasPrice"))
95028
+ if (!$util.isInteger(message.gasPrice) && !(message.gasPrice && $util.isInteger(message.gasPrice.low) && $util.isInteger(message.gasPrice.high)))
95029
+ return "gasPrice: integer|Long expected";
95030
+ if (message.gasLimit != null && message.hasOwnProperty("gasLimit"))
95031
+ if (!$util.isInteger(message.gasLimit) && !(message.gasLimit && $util.isInteger(message.gasLimit.low) && $util.isInteger(message.gasLimit.high)))
95032
+ return "gasLimit: integer|Long expected";
95033
+ if (message.queryAddress != null && message.hasOwnProperty("queryAddress"))
95034
+ if (!$util.isString(message.queryAddress))
95035
+ return "queryAddress: string expected";
95036
+ if (message.nonce != null && message.hasOwnProperty("nonce"))
95037
+ if (!$util.isInteger(message.nonce))
95038
+ return "nonce: integer expected";
95039
+ if (message.ownerAddress != null && message.hasOwnProperty("ownerAddress"))
95040
+ if (!$util.isString(message.ownerAddress))
95041
+ return "ownerAddress: string expected";
95042
+ if (message.payerAddress != null && message.hasOwnProperty("payerAddress"))
95043
+ if (!$util.isString(message.payerAddress))
95044
+ return "payerAddress: string expected";
95045
+ return null;
95046
+ };
95047
+
95048
+ /**
95049
+ * Creates a SigningInput message from a plain object. Also converts values to their respective internal types.
95050
+ * @function fromObject
95051
+ * @memberof TW.Ontology.Proto.SigningInput
95052
+ * @static
95053
+ * @param {Object.<string,*>} object Plain object
95054
+ * @returns {TW.Ontology.Proto.SigningInput} SigningInput
95055
+ */
95056
+ SigningInput.fromObject = function fromObject(object) {
95057
+ if (object instanceof $root.TW.Ontology.Proto.SigningInput)
95058
+ return object;
95059
+ var message = new $root.TW.Ontology.Proto.SigningInput();
95060
+ if (object.contract != null)
95061
+ message.contract = String(object.contract);
95062
+ if (object.method != null)
95063
+ message.method = String(object.method);
95064
+ if (object.ownerPrivateKey != null)
95065
+ if (typeof object.ownerPrivateKey === "string")
95066
+ $util.base64.decode(object.ownerPrivateKey, message.ownerPrivateKey = $util.newBuffer($util.base64.length(object.ownerPrivateKey)), 0);
95067
+ else if (object.ownerPrivateKey.length)
95068
+ message.ownerPrivateKey = object.ownerPrivateKey;
95069
+ if (object.toAddress != null)
95070
+ message.toAddress = String(object.toAddress);
95071
+ if (object.amount != null)
95072
+ if ($util.Long)
95073
+ (message.amount = $util.Long.fromValue(object.amount)).unsigned = true;
95074
+ else if (typeof object.amount === "string")
95075
+ message.amount = parseInt(object.amount, 10);
95076
+ else if (typeof object.amount === "number")
95077
+ message.amount = object.amount;
95078
+ else if (typeof object.amount === "object")
95079
+ message.amount = new $util.LongBits(object.amount.low >>> 0, object.amount.high >>> 0).toNumber(true);
95080
+ if (object.payerPrivateKey != null)
95081
+ if (typeof object.payerPrivateKey === "string")
95082
+ $util.base64.decode(object.payerPrivateKey, message.payerPrivateKey = $util.newBuffer($util.base64.length(object.payerPrivateKey)), 0);
95083
+ else if (object.payerPrivateKey.length)
95084
+ message.payerPrivateKey = object.payerPrivateKey;
95085
+ if (object.gasPrice != null)
95086
+ if ($util.Long)
95087
+ (message.gasPrice = $util.Long.fromValue(object.gasPrice)).unsigned = true;
95088
+ else if (typeof object.gasPrice === "string")
95089
+ message.gasPrice = parseInt(object.gasPrice, 10);
95090
+ else if (typeof object.gasPrice === "number")
95091
+ message.gasPrice = object.gasPrice;
95092
+ else if (typeof object.gasPrice === "object")
95093
+ message.gasPrice = new $util.LongBits(object.gasPrice.low >>> 0, object.gasPrice.high >>> 0).toNumber(true);
95094
+ if (object.gasLimit != null)
95095
+ if ($util.Long)
95096
+ (message.gasLimit = $util.Long.fromValue(object.gasLimit)).unsigned = true;
95097
+ else if (typeof object.gasLimit === "string")
95098
+ message.gasLimit = parseInt(object.gasLimit, 10);
95099
+ else if (typeof object.gasLimit === "number")
95100
+ message.gasLimit = object.gasLimit;
95101
+ else if (typeof object.gasLimit === "object")
95102
+ message.gasLimit = new $util.LongBits(object.gasLimit.low >>> 0, object.gasLimit.high >>> 0).toNumber(true);
95103
+ if (object.queryAddress != null)
95104
+ message.queryAddress = String(object.queryAddress);
95105
+ if (object.nonce != null)
95106
+ message.nonce = object.nonce >>> 0;
95107
+ if (object.ownerAddress != null)
95108
+ message.ownerAddress = String(object.ownerAddress);
95109
+ if (object.payerAddress != null)
95110
+ message.payerAddress = String(object.payerAddress);
95111
+ return message;
95112
+ };
95113
+
95114
+ /**
95115
+ * Creates a plain object from a SigningInput message. Also converts values to other types if specified.
95116
+ * @function toObject
95117
+ * @memberof TW.Ontology.Proto.SigningInput
95118
+ * @static
95119
+ * @param {TW.Ontology.Proto.SigningInput} message SigningInput
95120
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
95121
+ * @returns {Object.<string,*>} Plain object
95122
+ */
95123
+ SigningInput.toObject = function toObject(message, options) {
95124
+ if (!options)
95125
+ options = {};
95126
+ var object = {};
95127
+ if (options.defaults) {
95128
+ object.contract = "";
95129
+ object.method = "";
95130
+ if (options.bytes === String)
95131
+ object.ownerPrivateKey = "";
95132
+ else {
95133
+ object.ownerPrivateKey = [];
95134
+ if (options.bytes !== Array)
95135
+ object.ownerPrivateKey = $util.newBuffer(object.ownerPrivateKey);
95136
+ }
95137
+ object.toAddress = "";
95138
+ if ($util.Long) {
95139
+ var long = new $util.Long(0, 0, true);
95140
+ object.amount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
95141
+ } else
95142
+ object.amount = options.longs === String ? "0" : 0;
95143
+ if (options.bytes === String)
95144
+ object.payerPrivateKey = "";
95145
+ else {
95146
+ object.payerPrivateKey = [];
95147
+ if (options.bytes !== Array)
95148
+ object.payerPrivateKey = $util.newBuffer(object.payerPrivateKey);
95149
+ }
95150
+ if ($util.Long) {
95151
+ var long = new $util.Long(0, 0, true);
95152
+ object.gasPrice = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
95153
+ } else
95154
+ object.gasPrice = options.longs === String ? "0" : 0;
95155
+ if ($util.Long) {
95156
+ var long = new $util.Long(0, 0, true);
95157
+ object.gasLimit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
95158
+ } else
95159
+ object.gasLimit = options.longs === String ? "0" : 0;
95160
+ object.queryAddress = "";
95161
+ object.nonce = 0;
95162
+ object.ownerAddress = "";
95163
+ object.payerAddress = "";
95164
+ }
95165
+ if (message.contract != null && message.hasOwnProperty("contract"))
95166
+ object.contract = message.contract;
95167
+ if (message.method != null && message.hasOwnProperty("method"))
95168
+ object.method = message.method;
95169
+ if (message.ownerPrivateKey != null && message.hasOwnProperty("ownerPrivateKey"))
95170
+ object.ownerPrivateKey = options.bytes === String ? $util.base64.encode(message.ownerPrivateKey, 0, message.ownerPrivateKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.ownerPrivateKey) : message.ownerPrivateKey;
95171
+ if (message.toAddress != null && message.hasOwnProperty("toAddress"))
95172
+ object.toAddress = message.toAddress;
95173
+ if (message.amount != null && message.hasOwnProperty("amount"))
95174
+ if (typeof message.amount === "number")
95175
+ object.amount = options.longs === String ? String(message.amount) : message.amount;
95176
+ else
95177
+ object.amount = options.longs === String ? $util.Long.prototype.toString.call(message.amount) : options.longs === Number ? new $util.LongBits(message.amount.low >>> 0, message.amount.high >>> 0).toNumber(true) : message.amount;
95178
+ if (message.payerPrivateKey != null && message.hasOwnProperty("payerPrivateKey"))
95179
+ object.payerPrivateKey = options.bytes === String ? $util.base64.encode(message.payerPrivateKey, 0, message.payerPrivateKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.payerPrivateKey) : message.payerPrivateKey;
95180
+ if (message.gasPrice != null && message.hasOwnProperty("gasPrice"))
95181
+ if (typeof message.gasPrice === "number")
95182
+ object.gasPrice = options.longs === String ? String(message.gasPrice) : message.gasPrice;
95183
+ else
95184
+ object.gasPrice = options.longs === String ? $util.Long.prototype.toString.call(message.gasPrice) : options.longs === Number ? new $util.LongBits(message.gasPrice.low >>> 0, message.gasPrice.high >>> 0).toNumber(true) : message.gasPrice;
95185
+ if (message.gasLimit != null && message.hasOwnProperty("gasLimit"))
95186
+ if (typeof message.gasLimit === "number")
95187
+ object.gasLimit = options.longs === String ? String(message.gasLimit) : message.gasLimit;
95188
+ else
95189
+ object.gasLimit = options.longs === String ? $util.Long.prototype.toString.call(message.gasLimit) : options.longs === Number ? new $util.LongBits(message.gasLimit.low >>> 0, message.gasLimit.high >>> 0).toNumber(true) : message.gasLimit;
95190
+ if (message.queryAddress != null && message.hasOwnProperty("queryAddress"))
95191
+ object.queryAddress = message.queryAddress;
95192
+ if (message.nonce != null && message.hasOwnProperty("nonce"))
95193
+ object.nonce = message.nonce;
95194
+ if (message.ownerAddress != null && message.hasOwnProperty("ownerAddress"))
95195
+ object.ownerAddress = message.ownerAddress;
95196
+ if (message.payerAddress != null && message.hasOwnProperty("payerAddress"))
95197
+ object.payerAddress = message.payerAddress;
95198
+ return object;
95199
+ };
95200
+
95201
+ /**
95202
+ * Converts this SigningInput to JSON.
95203
+ * @function toJSON
95204
+ * @memberof TW.Ontology.Proto.SigningInput
95205
+ * @instance
95206
+ * @returns {Object.<string,*>} JSON object
95207
+ */
95208
+ SigningInput.prototype.toJSON = function toJSON() {
95209
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
95210
+ };
95211
+
95212
+ return SigningInput;
95213
+ })();
95214
+
95215
+ Proto.SigningOutput = (function() {
95216
+
95217
+ /**
95218
+ * Properties of a SigningOutput.
95219
+ * @memberof TW.Ontology.Proto
95220
+ * @interface ISigningOutput
95221
+ * @property {Uint8Array|null} [encoded] SigningOutput encoded
95222
+ * @property {TW.Common.Proto.SigningError|null} [error] SigningOutput error
95223
+ * @property {string|null} [errorMessage] SigningOutput errorMessage
95224
+ */
95225
+
95226
+ /**
95227
+ * Constructs a new SigningOutput.
95228
+ * @memberof TW.Ontology.Proto
95229
+ * @classdesc Represents a SigningOutput.
95230
+ * @implements ISigningOutput
95231
+ * @constructor
95232
+ * @param {TW.Ontology.Proto.ISigningOutput=} [properties] Properties to set
95233
+ */
95234
+ function SigningOutput(properties) {
95235
+ if (properties)
95236
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
95237
+ if (properties[keys[i]] != null)
95238
+ this[keys[i]] = properties[keys[i]];
95239
+ }
95240
+
95241
+ /**
95242
+ * SigningOutput encoded.
95243
+ * @member {Uint8Array} encoded
95244
+ * @memberof TW.Ontology.Proto.SigningOutput
95245
+ * @instance
95246
+ */
95247
+ SigningOutput.prototype.encoded = $util.newBuffer([]);
95248
+
95249
+ /**
95250
+ * SigningOutput error.
95251
+ * @member {TW.Common.Proto.SigningError} error
95252
+ * @memberof TW.Ontology.Proto.SigningOutput
95253
+ * @instance
95254
+ */
95255
+ SigningOutput.prototype.error = 0;
95256
+
95257
+ /**
95258
+ * SigningOutput errorMessage.
95259
+ * @member {string} errorMessage
95260
+ * @memberof TW.Ontology.Proto.SigningOutput
95261
+ * @instance
95262
+ */
95263
+ SigningOutput.prototype.errorMessage = "";
95264
+
95265
+ /**
95266
+ * Creates a new SigningOutput instance using the specified properties.
95267
+ * @function create
95268
+ * @memberof TW.Ontology.Proto.SigningOutput
95269
+ * @static
95270
+ * @param {TW.Ontology.Proto.ISigningOutput=} [properties] Properties to set
95271
+ * @returns {TW.Ontology.Proto.SigningOutput} SigningOutput instance
95272
+ */
95273
+ SigningOutput.create = function create(properties) {
95274
+ return new SigningOutput(properties);
95275
+ };
95276
+
95277
+ /**
95278
+ * Encodes the specified SigningOutput message. Does not implicitly {@link TW.Ontology.Proto.SigningOutput.verify|verify} messages.
95279
+ * @function encode
95280
+ * @memberof TW.Ontology.Proto.SigningOutput
95281
+ * @static
95282
+ * @param {TW.Ontology.Proto.ISigningOutput} message SigningOutput message or plain object to encode
95283
+ * @param {$protobuf.Writer} [writer] Writer to encode to
95284
+ * @returns {$protobuf.Writer} Writer
95285
+ */
95286
+ SigningOutput.encode = function encode(message, writer) {
95287
+ if (!writer)
95288
+ writer = $Writer.create();
95289
+ if (message.encoded != null && Object.hasOwnProperty.call(message, "encoded"))
95290
+ writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.encoded);
95291
+ if (message.error != null && Object.hasOwnProperty.call(message, "error"))
95292
+ writer.uint32(/* id 2, wireType 0 =*/16).int32(message.error);
95293
+ if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage"))
95294
+ writer.uint32(/* id 3, wireType 2 =*/26).string(message.errorMessage);
95295
+ return writer;
95296
+ };
95297
+
95298
+ /**
95299
+ * Decodes a SigningOutput message from the specified reader or buffer.
95300
+ * @function decode
95301
+ * @memberof TW.Ontology.Proto.SigningOutput
95302
+ * @static
95303
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
95304
+ * @param {number} [length] Message length if known beforehand
95305
+ * @returns {TW.Ontology.Proto.SigningOutput} SigningOutput
95306
+ * @throws {Error} If the payload is not a reader or valid buffer
95307
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
95308
+ */
95309
+ SigningOutput.decode = function decode(reader, length) {
95310
+ if (!(reader instanceof $Reader))
95311
+ reader = $Reader.create(reader);
95312
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Ontology.Proto.SigningOutput();
95313
+ while (reader.pos < end) {
95314
+ var tag = reader.uint32();
95315
+ switch (tag >>> 3) {
95316
+ case 1:
95317
+ message.encoded = reader.bytes();
95318
+ break;
95319
+ case 2:
95320
+ message.error = reader.int32();
95321
+ break;
95322
+ case 3:
95323
+ message.errorMessage = reader.string();
95324
+ break;
95325
+ default:
95326
+ reader.skipType(tag & 7);
95327
+ break;
95328
+ }
95329
+ }
95330
+ return message;
95331
+ };
95332
+
95333
+ /**
95334
+ * Verifies a SigningOutput message.
95335
+ * @function verify
95336
+ * @memberof TW.Ontology.Proto.SigningOutput
95337
+ * @static
95338
+ * @param {Object.<string,*>} message Plain object to verify
95339
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
95340
+ */
95341
+ SigningOutput.verify = function verify(message) {
95342
+ if (typeof message !== "object" || message === null)
95343
+ return "object expected";
95344
+ if (message.encoded != null && message.hasOwnProperty("encoded"))
95345
+ if (!(message.encoded && typeof message.encoded.length === "number" || $util.isString(message.encoded)))
95346
+ return "encoded: buffer expected";
95347
+ if (message.error != null && message.hasOwnProperty("error"))
95348
+ switch (message.error) {
95349
+ default:
95350
+ return "error: enum value expected";
95351
+ case 0:
95352
+ case 1:
95353
+ case 2:
95354
+ case 3:
95355
+ case 4:
95356
+ case 5:
95357
+ case 15:
95358
+ case 16:
95359
+ case 17:
95360
+ case 18:
95361
+ case 6:
95362
+ case 7:
95363
+ case 8:
95364
+ case 9:
95365
+ case 10:
95366
+ case 11:
95367
+ case 12:
95368
+ case 13:
95369
+ case 14:
95370
+ case 19:
95371
+ case 20:
95372
+ case 21:
95373
+ case 22:
95374
+ case 23:
95375
+ case 24:
95376
+ case 25:
95377
+ break;
95378
+ }
95379
+ if (message.errorMessage != null && message.hasOwnProperty("errorMessage"))
95380
+ if (!$util.isString(message.errorMessage))
95381
+ return "errorMessage: string expected";
95382
+ return null;
95383
+ };
95384
+
95385
+ /**
95386
+ * Creates a SigningOutput message from a plain object. Also converts values to their respective internal types.
95387
+ * @function fromObject
95388
+ * @memberof TW.Ontology.Proto.SigningOutput
95389
+ * @static
95390
+ * @param {Object.<string,*>} object Plain object
95391
+ * @returns {TW.Ontology.Proto.SigningOutput} SigningOutput
95392
+ */
95393
+ SigningOutput.fromObject = function fromObject(object) {
95394
+ if (object instanceof $root.TW.Ontology.Proto.SigningOutput)
95395
+ return object;
95396
+ var message = new $root.TW.Ontology.Proto.SigningOutput();
95397
+ if (object.encoded != null)
95398
+ if (typeof object.encoded === "string")
95399
+ $util.base64.decode(object.encoded, message.encoded = $util.newBuffer($util.base64.length(object.encoded)), 0);
95400
+ else if (object.encoded.length)
95401
+ message.encoded = object.encoded;
95402
+ switch (object.error) {
95403
+ case "OK":
95404
+ case 0:
95405
+ message.error = 0;
95406
+ break;
95407
+ case "Error_general":
95408
+ case 1:
95409
+ message.error = 1;
95410
+ break;
95411
+ case "Error_internal":
95412
+ case 2:
95413
+ message.error = 2;
95414
+ break;
95415
+ case "Error_low_balance":
95416
+ case 3:
95417
+ message.error = 3;
95418
+ break;
95419
+ case "Error_zero_amount_requested":
95420
+ case 4:
95421
+ message.error = 4;
95422
+ break;
95423
+ case "Error_missing_private_key":
95424
+ case 5:
95425
+ message.error = 5;
95426
+ break;
95427
+ case "Error_invalid_private_key":
95428
+ case 15:
95429
+ message.error = 15;
95430
+ break;
95431
+ case "Error_invalid_address":
95432
+ case 16:
95433
+ message.error = 16;
95434
+ break;
95435
+ case "Error_invalid_utxo":
95436
+ case 17:
95437
+ message.error = 17;
95438
+ break;
95439
+ case "Error_invalid_utxo_amount":
95440
+ case 18:
95441
+ message.error = 18;
95442
+ break;
95443
+ case "Error_wrong_fee":
95444
+ case 6:
95445
+ message.error = 6;
95446
+ break;
95447
+ case "Error_signing":
95448
+ case 7:
95449
+ message.error = 7;
95450
+ break;
95451
+ case "Error_tx_too_big":
95452
+ case 8:
95453
+ message.error = 8;
95454
+ break;
95455
+ case "Error_missing_input_utxos":
95456
+ case 9:
95457
+ message.error = 9;
95458
+ break;
95459
+ case "Error_not_enough_utxos":
95460
+ case 10:
95461
+ message.error = 10;
95462
+ break;
95463
+ case "Error_script_redeem":
95464
+ case 11:
95465
+ message.error = 11;
95466
+ break;
95467
+ case "Error_script_output":
95468
+ case 12:
95469
+ message.error = 12;
95470
+ break;
95471
+ case "Error_script_witness_program":
95472
+ case 13:
95473
+ message.error = 13;
95474
+ break;
95475
+ case "Error_invalid_memo":
95476
+ case 14:
95477
+ message.error = 14;
95478
+ break;
95479
+ case "Error_input_parse":
95480
+ case 19:
95481
+ message.error = 19;
95482
+ break;
95483
+ case "Error_no_support_n2n":
95484
+ case 20:
95485
+ message.error = 20;
95486
+ break;
95487
+ case "Error_signatures_count":
95488
+ case 21:
95489
+ message.error = 21;
95490
+ break;
95491
+ case "Error_invalid_params":
95492
+ case 22:
95493
+ message.error = 22;
95494
+ break;
95495
+ case "Error_invalid_requested_token_amount":
95496
+ case 23:
95497
+ message.error = 23;
95498
+ break;
95499
+ case "Error_not_supported":
95500
+ case 24:
95501
+ message.error = 24;
95502
+ break;
95503
+ case "Error_dust_amount_requested":
95504
+ case 25:
95505
+ message.error = 25;
95506
+ break;
95507
+ }
95508
+ if (object.errorMessage != null)
95509
+ message.errorMessage = String(object.errorMessage);
95510
+ return message;
95511
+ };
95512
+
95513
+ /**
95514
+ * Creates a plain object from a SigningOutput message. Also converts values to other types if specified.
95515
+ * @function toObject
95516
+ * @memberof TW.Ontology.Proto.SigningOutput
95517
+ * @static
95518
+ * @param {TW.Ontology.Proto.SigningOutput} message SigningOutput
95519
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
95520
+ * @returns {Object.<string,*>} Plain object
95521
+ */
95522
+ SigningOutput.toObject = function toObject(message, options) {
95523
+ if (!options)
95524
+ options = {};
95525
+ var object = {};
95526
+ if (options.defaults) {
95527
+ if (options.bytes === String)
95528
+ object.encoded = "";
95529
+ else {
95530
+ object.encoded = [];
95531
+ if (options.bytes !== Array)
95532
+ object.encoded = $util.newBuffer(object.encoded);
95533
+ }
95534
+ object.error = options.enums === String ? "OK" : 0;
95535
+ object.errorMessage = "";
95536
+ }
95537
+ if (message.encoded != null && message.hasOwnProperty("encoded"))
95538
+ object.encoded = options.bytes === String ? $util.base64.encode(message.encoded, 0, message.encoded.length) : options.bytes === Array ? Array.prototype.slice.call(message.encoded) : message.encoded;
95539
+ if (message.error != null && message.hasOwnProperty("error"))
95540
+ object.error = options.enums === String ? $root.TW.Common.Proto.SigningError[message.error] : message.error;
95541
+ if (message.errorMessage != null && message.hasOwnProperty("errorMessage"))
95542
+ object.errorMessage = message.errorMessage;
95543
+ return object;
95544
+ };
95545
+
95546
+ /**
95547
+ * Converts this SigningOutput to JSON.
95548
+ * @function toJSON
95549
+ * @memberof TW.Ontology.Proto.SigningOutput
95550
+ * @instance
95551
+ * @returns {Object.<string,*>} JSON object
95552
+ */
95553
+ SigningOutput.prototype.toJSON = function toJSON() {
95554
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
95555
+ };
95556
+
95557
+ return SigningOutput;
95558
+ })();
95559
+
95560
+ return Proto;
95561
+ })();
95562
+
95563
+ return Ontology;
95564
+ })();
95565
+
95566
+ TW.Pactus = (function() {
95567
+
95568
+ /**
95569
+ * Namespace Pactus.
95570
+ * @memberof TW
95571
+ * @namespace
95572
+ */
95573
+ var Pactus = {};
95574
+
95575
+ Pactus.Proto = (function() {
95576
+
95577
+ /**
95578
+ * Namespace Proto.
95579
+ * @memberof TW.Pactus
95580
+ * @namespace
95581
+ */
95582
+ var Proto = {};
95583
+
95584
+ Proto.TransactionMessage = (function() {
95585
+
95586
+ /**
95587
+ * Properties of a TransactionMessage.
95588
+ * @memberof TW.Pactus.Proto
95589
+ * @interface ITransactionMessage
95590
+ * @property {number|null} [lockTime] TransactionMessage lockTime
95591
+ * @property {Long|null} [fee] TransactionMessage fee
95592
+ * @property {string|null} [memo] TransactionMessage memo
95593
+ * @property {TW.Pactus.Proto.ITransferPayload|null} [transfer] TransactionMessage transfer
95594
+ * @property {TW.Pactus.Proto.IBondPayload|null} [bond] TransactionMessage bond
95595
+ */
95596
+
95597
+ /**
95598
+ * Constructs a new TransactionMessage.
95599
+ * @memberof TW.Pactus.Proto
95600
+ * @classdesc Represents a TransactionMessage.
95601
+ * @implements ITransactionMessage
95602
+ * @constructor
95603
+ * @param {TW.Pactus.Proto.ITransactionMessage=} [properties] Properties to set
95604
+ */
95605
+ function TransactionMessage(properties) {
95606
+ if (properties)
95607
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
95608
+ if (properties[keys[i]] != null)
95609
+ this[keys[i]] = properties[keys[i]];
95610
+ }
95611
+
95612
+ /**
95613
+ * TransactionMessage lockTime.
95614
+ * @member {number} lockTime
95615
+ * @memberof TW.Pactus.Proto.TransactionMessage
95616
+ * @instance
95617
+ */
95618
+ TransactionMessage.prototype.lockTime = 0;
95619
+
95620
+ /**
95621
+ * TransactionMessage fee.
95622
+ * @member {Long} fee
95623
+ * @memberof TW.Pactus.Proto.TransactionMessage
95624
+ * @instance
95625
+ */
95626
+ TransactionMessage.prototype.fee = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
95627
+
95628
+ /**
95629
+ * TransactionMessage memo.
95630
+ * @member {string} memo
95631
+ * @memberof TW.Pactus.Proto.TransactionMessage
95632
+ * @instance
95633
+ */
95634
+ TransactionMessage.prototype.memo = "";
95635
+
95636
+ /**
95637
+ * TransactionMessage transfer.
95638
+ * @member {TW.Pactus.Proto.ITransferPayload|null|undefined} transfer
95639
+ * @memberof TW.Pactus.Proto.TransactionMessage
95640
+ * @instance
95641
+ */
95642
+ TransactionMessage.prototype.transfer = null;
95643
+
95644
+ /**
95645
+ * TransactionMessage bond.
95646
+ * @member {TW.Pactus.Proto.IBondPayload|null|undefined} bond
95647
+ * @memberof TW.Pactus.Proto.TransactionMessage
95648
+ * @instance
95649
+ */
95650
+ TransactionMessage.prototype.bond = null;
95651
+
95652
+ // OneOf field names bound to virtual getters and setters
95653
+ var $oneOfFields;
95654
+
95655
+ /**
95656
+ * TransactionMessage payload.
95657
+ * @member {"transfer"|"bond"|undefined} payload
95658
+ * @memberof TW.Pactus.Proto.TransactionMessage
95659
+ * @instance
95660
+ */
95661
+ Object.defineProperty(TransactionMessage.prototype, "payload", {
95662
+ get: $util.oneOfGetter($oneOfFields = ["transfer", "bond"]),
95663
+ set: $util.oneOfSetter($oneOfFields)
95664
+ });
95665
+
95666
+ /**
95667
+ * Creates a new TransactionMessage instance using the specified properties.
95668
+ * @function create
95669
+ * @memberof TW.Pactus.Proto.TransactionMessage
95670
+ * @static
95671
+ * @param {TW.Pactus.Proto.ITransactionMessage=} [properties] Properties to set
95672
+ * @returns {TW.Pactus.Proto.TransactionMessage} TransactionMessage instance
95673
+ */
95674
+ TransactionMessage.create = function create(properties) {
95675
+ return new TransactionMessage(properties);
95676
+ };
95677
+
95678
+ /**
95679
+ * Encodes the specified TransactionMessage message. Does not implicitly {@link TW.Pactus.Proto.TransactionMessage.verify|verify} messages.
95680
+ * @function encode
95681
+ * @memberof TW.Pactus.Proto.TransactionMessage
95682
+ * @static
95683
+ * @param {TW.Pactus.Proto.ITransactionMessage} message TransactionMessage message or plain object to encode
95684
+ * @param {$protobuf.Writer} [writer] Writer to encode to
95685
+ * @returns {$protobuf.Writer} Writer
95686
+ */
95687
+ TransactionMessage.encode = function encode(message, writer) {
95688
+ if (!writer)
95689
+ writer = $Writer.create();
95690
+ if (message.lockTime != null && Object.hasOwnProperty.call(message, "lockTime"))
95691
+ writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.lockTime);
95692
+ if (message.fee != null && Object.hasOwnProperty.call(message, "fee"))
95693
+ writer.uint32(/* id 2, wireType 0 =*/16).int64(message.fee);
95694
+ if (message.memo != null && Object.hasOwnProperty.call(message, "memo"))
95695
+ writer.uint32(/* id 3, wireType 2 =*/26).string(message.memo);
95696
+ if (message.transfer != null && Object.hasOwnProperty.call(message, "transfer"))
95697
+ $root.TW.Pactus.Proto.TransferPayload.encode(message.transfer, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim();
95698
+ if (message.bond != null && Object.hasOwnProperty.call(message, "bond"))
95699
+ $root.TW.Pactus.Proto.BondPayload.encode(message.bond, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim();
95700
+ return writer;
95701
+ };
95702
+
95703
+ /**
95704
+ * Decodes a TransactionMessage message from the specified reader or buffer.
95705
+ * @function decode
95706
+ * @memberof TW.Pactus.Proto.TransactionMessage
95707
+ * @static
95708
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
95709
+ * @param {number} [length] Message length if known beforehand
95710
+ * @returns {TW.Pactus.Proto.TransactionMessage} TransactionMessage
95711
+ * @throws {Error} If the payload is not a reader or valid buffer
95712
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
95713
+ */
95714
+ TransactionMessage.decode = function decode(reader, length) {
95715
+ if (!(reader instanceof $Reader))
95716
+ reader = $Reader.create(reader);
95717
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Pactus.Proto.TransactionMessage();
95718
+ while (reader.pos < end) {
95719
+ var tag = reader.uint32();
95720
+ switch (tag >>> 3) {
95721
+ case 1:
95722
+ message.lockTime = reader.uint32();
95723
+ break;
95724
+ case 2:
95725
+ message.fee = reader.int64();
95726
+ break;
95727
+ case 3:
95728
+ message.memo = reader.string();
95729
+ break;
95730
+ case 10:
95731
+ message.transfer = $root.TW.Pactus.Proto.TransferPayload.decode(reader, reader.uint32());
95732
+ break;
95733
+ case 11:
95734
+ message.bond = $root.TW.Pactus.Proto.BondPayload.decode(reader, reader.uint32());
95735
+ break;
95736
+ default:
95737
+ reader.skipType(tag & 7);
95738
+ break;
95739
+ }
95740
+ }
95741
+ return message;
95742
+ };
95743
+
95744
+ /**
95745
+ * Verifies a TransactionMessage message.
95746
+ * @function verify
95747
+ * @memberof TW.Pactus.Proto.TransactionMessage
95748
+ * @static
95749
+ * @param {Object.<string,*>} message Plain object to verify
95750
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
95751
+ */
95752
+ TransactionMessage.verify = function verify(message) {
95753
+ if (typeof message !== "object" || message === null)
95754
+ return "object expected";
95755
+ var properties = {};
95756
+ if (message.lockTime != null && message.hasOwnProperty("lockTime"))
95757
+ if (!$util.isInteger(message.lockTime))
95758
+ return "lockTime: integer expected";
95759
+ if (message.fee != null && message.hasOwnProperty("fee"))
95760
+ if (!$util.isInteger(message.fee) && !(message.fee && $util.isInteger(message.fee.low) && $util.isInteger(message.fee.high)))
95761
+ return "fee: integer|Long expected";
95762
+ if (message.memo != null && message.hasOwnProperty("memo"))
95763
+ if (!$util.isString(message.memo))
95764
+ return "memo: string expected";
95765
+ if (message.transfer != null && message.hasOwnProperty("transfer")) {
95766
+ properties.payload = 1;
95767
+ {
95768
+ var error = $root.TW.Pactus.Proto.TransferPayload.verify(message.transfer);
95769
+ if (error)
95770
+ return "transfer." + error;
95771
+ }
95772
+ }
95773
+ if (message.bond != null && message.hasOwnProperty("bond")) {
95774
+ if (properties.payload === 1)
95775
+ return "payload: multiple values";
95776
+ properties.payload = 1;
95777
+ {
95778
+ var error = $root.TW.Pactus.Proto.BondPayload.verify(message.bond);
95779
+ if (error)
95780
+ return "bond." + error;
95781
+ }
95782
+ }
95783
+ return null;
95784
+ };
95785
+
95786
+ /**
95787
+ * Creates a TransactionMessage message from a plain object. Also converts values to their respective internal types.
95788
+ * @function fromObject
95789
+ * @memberof TW.Pactus.Proto.TransactionMessage
95790
+ * @static
95791
+ * @param {Object.<string,*>} object Plain object
95792
+ * @returns {TW.Pactus.Proto.TransactionMessage} TransactionMessage
95793
+ */
95794
+ TransactionMessage.fromObject = function fromObject(object) {
95795
+ if (object instanceof $root.TW.Pactus.Proto.TransactionMessage)
95796
+ return object;
95797
+ var message = new $root.TW.Pactus.Proto.TransactionMessage();
95798
+ if (object.lockTime != null)
95799
+ message.lockTime = object.lockTime >>> 0;
95800
+ if (object.fee != null)
95801
+ if ($util.Long)
95802
+ (message.fee = $util.Long.fromValue(object.fee)).unsigned = false;
95803
+ else if (typeof object.fee === "string")
95804
+ message.fee = parseInt(object.fee, 10);
95805
+ else if (typeof object.fee === "number")
95806
+ message.fee = object.fee;
95807
+ else if (typeof object.fee === "object")
95808
+ message.fee = new $util.LongBits(object.fee.low >>> 0, object.fee.high >>> 0).toNumber();
95809
+ if (object.memo != null)
95810
+ message.memo = String(object.memo);
95811
+ if (object.transfer != null) {
95812
+ if (typeof object.transfer !== "object")
95813
+ throw TypeError(".TW.Pactus.Proto.TransactionMessage.transfer: object expected");
95814
+ message.transfer = $root.TW.Pactus.Proto.TransferPayload.fromObject(object.transfer);
95815
+ }
95816
+ if (object.bond != null) {
95817
+ if (typeof object.bond !== "object")
95818
+ throw TypeError(".TW.Pactus.Proto.TransactionMessage.bond: object expected");
95819
+ message.bond = $root.TW.Pactus.Proto.BondPayload.fromObject(object.bond);
95820
+ }
95821
+ return message;
95822
+ };
95823
+
95824
+ /**
95825
+ * Creates a plain object from a TransactionMessage message. Also converts values to other types if specified.
95826
+ * @function toObject
95827
+ * @memberof TW.Pactus.Proto.TransactionMessage
95828
+ * @static
95829
+ * @param {TW.Pactus.Proto.TransactionMessage} message TransactionMessage
95830
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
95831
+ * @returns {Object.<string,*>} Plain object
95832
+ */
95833
+ TransactionMessage.toObject = function toObject(message, options) {
95834
+ if (!options)
95835
+ options = {};
95836
+ var object = {};
95837
+ if (options.defaults) {
95838
+ object.lockTime = 0;
95839
+ if ($util.Long) {
95840
+ var long = new $util.Long(0, 0, false);
95841
+ object.fee = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
95842
+ } else
95843
+ object.fee = options.longs === String ? "0" : 0;
95844
+ object.memo = "";
95845
+ }
95846
+ if (message.lockTime != null && message.hasOwnProperty("lockTime"))
95847
+ object.lockTime = message.lockTime;
95848
+ if (message.fee != null && message.hasOwnProperty("fee"))
95849
+ if (typeof message.fee === "number")
95850
+ object.fee = options.longs === String ? String(message.fee) : message.fee;
95851
+ else
95852
+ object.fee = options.longs === String ? $util.Long.prototype.toString.call(message.fee) : options.longs === Number ? new $util.LongBits(message.fee.low >>> 0, message.fee.high >>> 0).toNumber() : message.fee;
95853
+ if (message.memo != null && message.hasOwnProperty("memo"))
95854
+ object.memo = message.memo;
95855
+ if (message.transfer != null && message.hasOwnProperty("transfer")) {
95856
+ object.transfer = $root.TW.Pactus.Proto.TransferPayload.toObject(message.transfer, options);
95857
+ if (options.oneofs)
95858
+ object.payload = "transfer";
95859
+ }
95860
+ if (message.bond != null && message.hasOwnProperty("bond")) {
95861
+ object.bond = $root.TW.Pactus.Proto.BondPayload.toObject(message.bond, options);
95862
+ if (options.oneofs)
95863
+ object.payload = "bond";
95864
+ }
95865
+ return object;
95866
+ };
95867
+
95868
+ /**
95869
+ * Converts this TransactionMessage to JSON.
95870
+ * @function toJSON
95871
+ * @memberof TW.Pactus.Proto.TransactionMessage
95872
+ * @instance
95873
+ * @returns {Object.<string,*>} JSON object
95874
+ */
95875
+ TransactionMessage.prototype.toJSON = function toJSON() {
95876
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
95877
+ };
95878
+
95879
+ return TransactionMessage;
95880
+ })();
95881
+
95882
+ Proto.TransferPayload = (function() {
95883
+
95884
+ /**
95885
+ * Properties of a TransferPayload.
95886
+ * @memberof TW.Pactus.Proto
95887
+ * @interface ITransferPayload
95888
+ * @property {string|null} [sender] TransferPayload sender
95889
+ * @property {string|null} [receiver] TransferPayload receiver
95890
+ * @property {Long|null} [amount] TransferPayload amount
95891
+ */
95892
+
95893
+ /**
95894
+ * Constructs a new TransferPayload.
95895
+ * @memberof TW.Pactus.Proto
95896
+ * @classdesc Represents a TransferPayload.
95897
+ * @implements ITransferPayload
95898
+ * @constructor
95899
+ * @param {TW.Pactus.Proto.ITransferPayload=} [properties] Properties to set
95900
+ */
95901
+ function TransferPayload(properties) {
95902
+ if (properties)
95903
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
95904
+ if (properties[keys[i]] != null)
95905
+ this[keys[i]] = properties[keys[i]];
95906
+ }
95907
+
95908
+ /**
95909
+ * TransferPayload sender.
95910
+ * @member {string} sender
95911
+ * @memberof TW.Pactus.Proto.TransferPayload
95912
+ * @instance
95913
+ */
95914
+ TransferPayload.prototype.sender = "";
95915
+
95916
+ /**
95917
+ * TransferPayload receiver.
95918
+ * @member {string} receiver
95919
+ * @memberof TW.Pactus.Proto.TransferPayload
95920
+ * @instance
95921
+ */
95922
+ TransferPayload.prototype.receiver = "";
95923
+
95924
+ /**
95925
+ * TransferPayload amount.
95926
+ * @member {Long} amount
95927
+ * @memberof TW.Pactus.Proto.TransferPayload
95928
+ * @instance
95929
+ */
95930
+ TransferPayload.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
95931
+
95932
+ /**
95933
+ * Creates a new TransferPayload instance using the specified properties.
95934
+ * @function create
95935
+ * @memberof TW.Pactus.Proto.TransferPayload
95936
+ * @static
95937
+ * @param {TW.Pactus.Proto.ITransferPayload=} [properties] Properties to set
95938
+ * @returns {TW.Pactus.Proto.TransferPayload} TransferPayload instance
95939
+ */
95940
+ TransferPayload.create = function create(properties) {
95941
+ return new TransferPayload(properties);
95942
+ };
95943
+
95944
+ /**
95945
+ * Encodes the specified TransferPayload message. Does not implicitly {@link TW.Pactus.Proto.TransferPayload.verify|verify} messages.
95946
+ * @function encode
95947
+ * @memberof TW.Pactus.Proto.TransferPayload
95948
+ * @static
95949
+ * @param {TW.Pactus.Proto.ITransferPayload} message TransferPayload message or plain object to encode
95950
+ * @param {$protobuf.Writer} [writer] Writer to encode to
95951
+ * @returns {$protobuf.Writer} Writer
95952
+ */
95953
+ TransferPayload.encode = function encode(message, writer) {
95954
+ if (!writer)
95955
+ writer = $Writer.create();
95956
+ if (message.sender != null && Object.hasOwnProperty.call(message, "sender"))
95957
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.sender);
95958
+ if (message.receiver != null && Object.hasOwnProperty.call(message, "receiver"))
95959
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.receiver);
95960
+ if (message.amount != null && Object.hasOwnProperty.call(message, "amount"))
95961
+ writer.uint32(/* id 3, wireType 0 =*/24).int64(message.amount);
95962
+ return writer;
95963
+ };
95964
+
95965
+ /**
95966
+ * Decodes a TransferPayload message from the specified reader or buffer.
95967
+ * @function decode
95968
+ * @memberof TW.Pactus.Proto.TransferPayload
95969
+ * @static
95970
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
95971
+ * @param {number} [length] Message length if known beforehand
95972
+ * @returns {TW.Pactus.Proto.TransferPayload} TransferPayload
95973
+ * @throws {Error} If the payload is not a reader or valid buffer
95974
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
95975
+ */
95976
+ TransferPayload.decode = function decode(reader, length) {
95977
+ if (!(reader instanceof $Reader))
95978
+ reader = $Reader.create(reader);
95979
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Pactus.Proto.TransferPayload();
95980
+ while (reader.pos < end) {
95981
+ var tag = reader.uint32();
95982
+ switch (tag >>> 3) {
95983
+ case 1:
95984
+ message.sender = reader.string();
95985
+ break;
95986
+ case 2:
95987
+ message.receiver = reader.string();
95988
+ break;
95989
+ case 3:
95990
+ message.amount = reader.int64();
95991
+ break;
95992
+ default:
95993
+ reader.skipType(tag & 7);
95994
+ break;
95995
+ }
95996
+ }
95997
+ return message;
95998
+ };
95999
+
96000
+ /**
96001
+ * Verifies a TransferPayload message.
96002
+ * @function verify
96003
+ * @memberof TW.Pactus.Proto.TransferPayload
96004
+ * @static
96005
+ * @param {Object.<string,*>} message Plain object to verify
96006
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
96007
+ */
96008
+ TransferPayload.verify = function verify(message) {
96009
+ if (typeof message !== "object" || message === null)
96010
+ return "object expected";
96011
+ if (message.sender != null && message.hasOwnProperty("sender"))
96012
+ if (!$util.isString(message.sender))
96013
+ return "sender: string expected";
96014
+ if (message.receiver != null && message.hasOwnProperty("receiver"))
96015
+ if (!$util.isString(message.receiver))
96016
+ return "receiver: string expected";
96017
+ if (message.amount != null && message.hasOwnProperty("amount"))
96018
+ if (!$util.isInteger(message.amount) && !(message.amount && $util.isInteger(message.amount.low) && $util.isInteger(message.amount.high)))
96019
+ return "amount: integer|Long expected";
96020
+ return null;
96021
+ };
96022
+
96023
+ /**
96024
+ * Creates a TransferPayload message from a plain object. Also converts values to their respective internal types.
96025
+ * @function fromObject
96026
+ * @memberof TW.Pactus.Proto.TransferPayload
96027
+ * @static
96028
+ * @param {Object.<string,*>} object Plain object
96029
+ * @returns {TW.Pactus.Proto.TransferPayload} TransferPayload
96030
+ */
96031
+ TransferPayload.fromObject = function fromObject(object) {
96032
+ if (object instanceof $root.TW.Pactus.Proto.TransferPayload)
96033
+ return object;
96034
+ var message = new $root.TW.Pactus.Proto.TransferPayload();
96035
+ if (object.sender != null)
96036
+ message.sender = String(object.sender);
96037
+ if (object.receiver != null)
96038
+ message.receiver = String(object.receiver);
96039
+ if (object.amount != null)
96040
+ if ($util.Long)
96041
+ (message.amount = $util.Long.fromValue(object.amount)).unsigned = false;
96042
+ else if (typeof object.amount === "string")
96043
+ message.amount = parseInt(object.amount, 10);
96044
+ else if (typeof object.amount === "number")
96045
+ message.amount = object.amount;
96046
+ else if (typeof object.amount === "object")
96047
+ message.amount = new $util.LongBits(object.amount.low >>> 0, object.amount.high >>> 0).toNumber();
96048
+ return message;
96049
+ };
96050
+
96051
+ /**
96052
+ * Creates a plain object from a TransferPayload message. Also converts values to other types if specified.
96053
+ * @function toObject
96054
+ * @memberof TW.Pactus.Proto.TransferPayload
96055
+ * @static
96056
+ * @param {TW.Pactus.Proto.TransferPayload} message TransferPayload
96057
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
96058
+ * @returns {Object.<string,*>} Plain object
96059
+ */
96060
+ TransferPayload.toObject = function toObject(message, options) {
96061
+ if (!options)
96062
+ options = {};
96063
+ var object = {};
96064
+ if (options.defaults) {
96065
+ object.sender = "";
96066
+ object.receiver = "";
96067
+ if ($util.Long) {
96068
+ var long = new $util.Long(0, 0, false);
96069
+ object.amount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
96070
+ } else
96071
+ object.amount = options.longs === String ? "0" : 0;
96072
+ }
96073
+ if (message.sender != null && message.hasOwnProperty("sender"))
96074
+ object.sender = message.sender;
96075
+ if (message.receiver != null && message.hasOwnProperty("receiver"))
96076
+ object.receiver = message.receiver;
96077
+ if (message.amount != null && message.hasOwnProperty("amount"))
96078
+ if (typeof message.amount === "number")
96079
+ object.amount = options.longs === String ? String(message.amount) : message.amount;
96080
+ else
96081
+ object.amount = options.longs === String ? $util.Long.prototype.toString.call(message.amount) : options.longs === Number ? new $util.LongBits(message.amount.low >>> 0, message.amount.high >>> 0).toNumber() : message.amount;
96082
+ return object;
96083
+ };
96084
+
96085
+ /**
96086
+ * Converts this TransferPayload to JSON.
96087
+ * @function toJSON
96088
+ * @memberof TW.Pactus.Proto.TransferPayload
96089
+ * @instance
96090
+ * @returns {Object.<string,*>} JSON object
96091
+ */
96092
+ TransferPayload.prototype.toJSON = function toJSON() {
96093
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
96094
+ };
96095
+
96096
+ return TransferPayload;
96097
+ })();
96098
+
96099
+ Proto.BondPayload = (function() {
96100
+
96101
+ /**
96102
+ * Properties of a BondPayload.
96103
+ * @memberof TW.Pactus.Proto
96104
+ * @interface IBondPayload
96105
+ * @property {string|null} [sender] BondPayload sender
96106
+ * @property {string|null} [receiver] BondPayload receiver
96107
+ * @property {Long|null} [stake] BondPayload stake
96108
+ * @property {string|null} [publicKey] BondPayload publicKey
96109
+ */
96110
+
96111
+ /**
96112
+ * Constructs a new BondPayload.
96113
+ * @memberof TW.Pactus.Proto
96114
+ * @classdesc Represents a BondPayload.
96115
+ * @implements IBondPayload
96116
+ * @constructor
96117
+ * @param {TW.Pactus.Proto.IBondPayload=} [properties] Properties to set
96118
+ */
96119
+ function BondPayload(properties) {
96120
+ if (properties)
96121
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
96122
+ if (properties[keys[i]] != null)
96123
+ this[keys[i]] = properties[keys[i]];
96124
+ }
96125
+
96126
+ /**
96127
+ * BondPayload sender.
96128
+ * @member {string} sender
96129
+ * @memberof TW.Pactus.Proto.BondPayload
96130
+ * @instance
96131
+ */
96132
+ BondPayload.prototype.sender = "";
96133
+
96134
+ /**
96135
+ * BondPayload receiver.
96136
+ * @member {string} receiver
96137
+ * @memberof TW.Pactus.Proto.BondPayload
96138
+ * @instance
96139
+ */
96140
+ BondPayload.prototype.receiver = "";
96141
+
96142
+ /**
96143
+ * BondPayload stake.
96144
+ * @member {Long} stake
96145
+ * @memberof TW.Pactus.Proto.BondPayload
96146
+ * @instance
96147
+ */
96148
+ BondPayload.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
96149
+
96150
+ /**
96151
+ * BondPayload publicKey.
96152
+ * @member {string} publicKey
96153
+ * @memberof TW.Pactus.Proto.BondPayload
96154
+ * @instance
96155
+ */
96156
+ BondPayload.prototype.publicKey = "";
96157
+
96158
+ /**
96159
+ * Creates a new BondPayload instance using the specified properties.
96160
+ * @function create
96161
+ * @memberof TW.Pactus.Proto.BondPayload
96162
+ * @static
96163
+ * @param {TW.Pactus.Proto.IBondPayload=} [properties] Properties to set
96164
+ * @returns {TW.Pactus.Proto.BondPayload} BondPayload instance
96165
+ */
96166
+ BondPayload.create = function create(properties) {
96167
+ return new BondPayload(properties);
96168
+ };
96169
+
96170
+ /**
96171
+ * Encodes the specified BondPayload message. Does not implicitly {@link TW.Pactus.Proto.BondPayload.verify|verify} messages.
96172
+ * @function encode
96173
+ * @memberof TW.Pactus.Proto.BondPayload
96174
+ * @static
96175
+ * @param {TW.Pactus.Proto.IBondPayload} message BondPayload message or plain object to encode
96176
+ * @param {$protobuf.Writer} [writer] Writer to encode to
96177
+ * @returns {$protobuf.Writer} Writer
96178
+ */
96179
+ BondPayload.encode = function encode(message, writer) {
96180
+ if (!writer)
96181
+ writer = $Writer.create();
96182
+ if (message.sender != null && Object.hasOwnProperty.call(message, "sender"))
96183
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.sender);
96184
+ if (message.receiver != null && Object.hasOwnProperty.call(message, "receiver"))
96185
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.receiver);
96186
+ if (message.stake != null && Object.hasOwnProperty.call(message, "stake"))
96187
+ writer.uint32(/* id 3, wireType 0 =*/24).int64(message.stake);
96188
+ if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey"))
96189
+ writer.uint32(/* id 4, wireType 2 =*/34).string(message.publicKey);
96190
+ return writer;
96191
+ };
96192
+
96193
+ /**
96194
+ * Decodes a BondPayload message from the specified reader or buffer.
96195
+ * @function decode
96196
+ * @memberof TW.Pactus.Proto.BondPayload
96197
+ * @static
96198
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
96199
+ * @param {number} [length] Message length if known beforehand
96200
+ * @returns {TW.Pactus.Proto.BondPayload} BondPayload
96201
+ * @throws {Error} If the payload is not a reader or valid buffer
96202
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
96203
+ */
96204
+ BondPayload.decode = function decode(reader, length) {
96205
+ if (!(reader instanceof $Reader))
96206
+ reader = $Reader.create(reader);
96207
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Pactus.Proto.BondPayload();
96208
+ while (reader.pos < end) {
96209
+ var tag = reader.uint32();
96210
+ switch (tag >>> 3) {
96211
+ case 1:
96212
+ message.sender = reader.string();
96213
+ break;
96214
+ case 2:
96215
+ message.receiver = reader.string();
96216
+ break;
96217
+ case 3:
96218
+ message.stake = reader.int64();
96219
+ break;
96220
+ case 4:
96221
+ message.publicKey = reader.string();
96222
+ break;
96223
+ default:
96224
+ reader.skipType(tag & 7);
96225
+ break;
96226
+ }
96227
+ }
96228
+ return message;
96229
+ };
96230
+
96231
+ /**
96232
+ * Verifies a BondPayload message.
96233
+ * @function verify
96234
+ * @memberof TW.Pactus.Proto.BondPayload
96235
+ * @static
96236
+ * @param {Object.<string,*>} message Plain object to verify
96237
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
96238
+ */
96239
+ BondPayload.verify = function verify(message) {
96240
+ if (typeof message !== "object" || message === null)
96241
+ return "object expected";
96242
+ if (message.sender != null && message.hasOwnProperty("sender"))
96243
+ if (!$util.isString(message.sender))
96244
+ return "sender: string expected";
96245
+ if (message.receiver != null && message.hasOwnProperty("receiver"))
96246
+ if (!$util.isString(message.receiver))
96247
+ return "receiver: string expected";
96248
+ if (message.stake != null && message.hasOwnProperty("stake"))
96249
+ if (!$util.isInteger(message.stake) && !(message.stake && $util.isInteger(message.stake.low) && $util.isInteger(message.stake.high)))
96250
+ return "stake: integer|Long expected";
96251
+ if (message.publicKey != null && message.hasOwnProperty("publicKey"))
96252
+ if (!$util.isString(message.publicKey))
96253
+ return "publicKey: string expected";
96254
+ return null;
96255
+ };
96256
+
96257
+ /**
96258
+ * Creates a BondPayload message from a plain object. Also converts values to their respective internal types.
96259
+ * @function fromObject
96260
+ * @memberof TW.Pactus.Proto.BondPayload
96261
+ * @static
96262
+ * @param {Object.<string,*>} object Plain object
96263
+ * @returns {TW.Pactus.Proto.BondPayload} BondPayload
96264
+ */
96265
+ BondPayload.fromObject = function fromObject(object) {
96266
+ if (object instanceof $root.TW.Pactus.Proto.BondPayload)
96267
+ return object;
96268
+ var message = new $root.TW.Pactus.Proto.BondPayload();
96269
+ if (object.sender != null)
96270
+ message.sender = String(object.sender);
96271
+ if (object.receiver != null)
96272
+ message.receiver = String(object.receiver);
96273
+ if (object.stake != null)
96274
+ if ($util.Long)
96275
+ (message.stake = $util.Long.fromValue(object.stake)).unsigned = false;
96276
+ else if (typeof object.stake === "string")
96277
+ message.stake = parseInt(object.stake, 10);
96278
+ else if (typeof object.stake === "number")
96279
+ message.stake = object.stake;
96280
+ else if (typeof object.stake === "object")
96281
+ message.stake = new $util.LongBits(object.stake.low >>> 0, object.stake.high >>> 0).toNumber();
96282
+ if (object.publicKey != null)
96283
+ message.publicKey = String(object.publicKey);
96284
+ return message;
96285
+ };
96286
+
96287
+ /**
96288
+ * Creates a plain object from a BondPayload message. Also converts values to other types if specified.
96289
+ * @function toObject
96290
+ * @memberof TW.Pactus.Proto.BondPayload
96291
+ * @static
96292
+ * @param {TW.Pactus.Proto.BondPayload} message BondPayload
96293
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
96294
+ * @returns {Object.<string,*>} Plain object
96295
+ */
96296
+ BondPayload.toObject = function toObject(message, options) {
96297
+ if (!options)
96298
+ options = {};
96299
+ var object = {};
96300
+ if (options.defaults) {
96301
+ object.sender = "";
96302
+ object.receiver = "";
96303
+ if ($util.Long) {
96304
+ var long = new $util.Long(0, 0, false);
96305
+ object.stake = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
96306
+ } else
96307
+ object.stake = options.longs === String ? "0" : 0;
96308
+ object.publicKey = "";
96309
+ }
96310
+ if (message.sender != null && message.hasOwnProperty("sender"))
96311
+ object.sender = message.sender;
96312
+ if (message.receiver != null && message.hasOwnProperty("receiver"))
96313
+ object.receiver = message.receiver;
96314
+ if (message.stake != null && message.hasOwnProperty("stake"))
96315
+ if (typeof message.stake === "number")
96316
+ object.stake = options.longs === String ? String(message.stake) : message.stake;
96317
+ else
96318
+ object.stake = options.longs === String ? $util.Long.prototype.toString.call(message.stake) : options.longs === Number ? new $util.LongBits(message.stake.low >>> 0, message.stake.high >>> 0).toNumber() : message.stake;
96319
+ if (message.publicKey != null && message.hasOwnProperty("publicKey"))
96320
+ object.publicKey = message.publicKey;
96321
+ return object;
96322
+ };
96323
+
96324
+ /**
96325
+ * Converts this BondPayload to JSON.
96326
+ * @function toJSON
96327
+ * @memberof TW.Pactus.Proto.BondPayload
96328
+ * @instance
96329
+ * @returns {Object.<string,*>} JSON object
96330
+ */
96331
+ BondPayload.prototype.toJSON = function toJSON() {
96332
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
96333
+ };
96334
+
96335
+ return BondPayload;
96336
+ })();
96337
+
96338
+ Proto.SigningInput = (function() {
96339
+
96340
+ /**
96341
+ * Properties of a SigningInput.
96342
+ * @memberof TW.Pactus.Proto
96343
+ * @interface ISigningInput
96344
+ * @property {Uint8Array|null} [privateKey] SigningInput privateKey
96345
+ * @property {TW.Pactus.Proto.ITransactionMessage|null} [transaction] SigningInput transaction
96346
+ */
96347
+
96348
+ /**
96349
+ * Constructs a new SigningInput.
96350
+ * @memberof TW.Pactus.Proto
96351
+ * @classdesc Represents a SigningInput.
96352
+ * @implements ISigningInput
96353
+ * @constructor
96354
+ * @param {TW.Pactus.Proto.ISigningInput=} [properties] Properties to set
96355
+ */
96356
+ function SigningInput(properties) {
96357
+ if (properties)
96358
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
96359
+ if (properties[keys[i]] != null)
96360
+ this[keys[i]] = properties[keys[i]];
96361
+ }
96362
+
96363
+ /**
96364
+ * SigningInput privateKey.
96365
+ * @member {Uint8Array} privateKey
96366
+ * @memberof TW.Pactus.Proto.SigningInput
96367
+ * @instance
96368
+ */
96369
+ SigningInput.prototype.privateKey = $util.newBuffer([]);
96370
+
96371
+ /**
96372
+ * SigningInput transaction.
96373
+ * @member {TW.Pactus.Proto.ITransactionMessage|null|undefined} transaction
96374
+ * @memberof TW.Pactus.Proto.SigningInput
96375
+ * @instance
96376
+ */
96377
+ SigningInput.prototype.transaction = null;
96378
+
96379
+ /**
96380
+ * Creates a new SigningInput instance using the specified properties.
96381
+ * @function create
96382
+ * @memberof TW.Pactus.Proto.SigningInput
96383
+ * @static
96384
+ * @param {TW.Pactus.Proto.ISigningInput=} [properties] Properties to set
96385
+ * @returns {TW.Pactus.Proto.SigningInput} SigningInput instance
96386
+ */
96387
+ SigningInput.create = function create(properties) {
96388
+ return new SigningInput(properties);
96389
+ };
96390
+
96391
+ /**
96392
+ * Encodes the specified SigningInput message. Does not implicitly {@link TW.Pactus.Proto.SigningInput.verify|verify} messages.
96393
+ * @function encode
96394
+ * @memberof TW.Pactus.Proto.SigningInput
96395
+ * @static
96396
+ * @param {TW.Pactus.Proto.ISigningInput} message SigningInput message or plain object to encode
96397
+ * @param {$protobuf.Writer} [writer] Writer to encode to
96398
+ * @returns {$protobuf.Writer} Writer
96399
+ */
96400
+ SigningInput.encode = function encode(message, writer) {
96401
+ if (!writer)
96402
+ writer = $Writer.create();
96403
+ if (message.privateKey != null && Object.hasOwnProperty.call(message, "privateKey"))
96404
+ writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.privateKey);
96405
+ if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction"))
96406
+ $root.TW.Pactus.Proto.TransactionMessage.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
96407
+ return writer;
96408
+ };
96409
+
96410
+ /**
96411
+ * Decodes a SigningInput message from the specified reader or buffer.
96412
+ * @function decode
96413
+ * @memberof TW.Pactus.Proto.SigningInput
94884
96414
  * @static
94885
96415
  * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
94886
96416
  * @param {number} [length] Message length if known beforehand
94887
- * @returns {TW.Ontology.Proto.SigningInput} SigningInput
96417
+ * @returns {TW.Pactus.Proto.SigningInput} SigningInput
94888
96418
  * @throws {Error} If the payload is not a reader or valid buffer
94889
96419
  * @throws {$protobuf.util.ProtocolError} If required fields are missing
94890
96420
  */
94891
96421
  SigningInput.decode = function decode(reader, length) {
94892
96422
  if (!(reader instanceof $Reader))
94893
96423
  reader = $Reader.create(reader);
94894
- var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Ontology.Proto.SigningInput();
96424
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Pactus.Proto.SigningInput();
94895
96425
  while (reader.pos < end) {
94896
96426
  var tag = reader.uint32();
94897
96427
  switch (tag >>> 3) {
94898
96428
  case 1:
94899
- message.contract = reader.string();
96429
+ message.privateKey = reader.bytes();
94900
96430
  break;
94901
96431
  case 2:
94902
- message.method = reader.string();
94903
- break;
94904
- case 3:
94905
- message.ownerPrivateKey = reader.bytes();
94906
- break;
94907
- case 4:
94908
- message.toAddress = reader.string();
94909
- break;
94910
- case 5:
94911
- message.amount = reader.uint64();
94912
- break;
94913
- case 6:
94914
- message.payerPrivateKey = reader.bytes();
94915
- break;
94916
- case 7:
94917
- message.gasPrice = reader.uint64();
94918
- break;
94919
- case 8:
94920
- message.gasLimit = reader.uint64();
94921
- break;
94922
- case 9:
94923
- message.queryAddress = reader.string();
94924
- break;
94925
- case 10:
94926
- message.nonce = reader.uint32();
94927
- break;
94928
- case 11:
94929
- message.ownerAddress = reader.string();
94930
- break;
94931
- case 12:
94932
- message.payerAddress = reader.string();
96432
+ message.transaction = $root.TW.Pactus.Proto.TransactionMessage.decode(reader, reader.uint32());
94933
96433
  break;
94934
96434
  default:
94935
96435
  reader.skipType(tag & 7);
@@ -94942,7 +96442,7 @@
94942
96442
  /**
94943
96443
  * Verifies a SigningInput message.
94944
96444
  * @function verify
94945
- * @memberof TW.Ontology.Proto.SigningInput
96445
+ * @memberof TW.Pactus.Proto.SigningInput
94946
96446
  * @static
94947
96447
  * @param {Object.<string,*>} message Plain object to verify
94948
96448
  * @returns {string|null} `null` if valid, otherwise the reason why it is not
@@ -94950,117 +96450,48 @@
94950
96450
  SigningInput.verify = function verify(message) {
94951
96451
  if (typeof message !== "object" || message === null)
94952
96452
  return "object expected";
94953
- if (message.contract != null && message.hasOwnProperty("contract"))
94954
- if (!$util.isString(message.contract))
94955
- return "contract: string expected";
94956
- if (message.method != null && message.hasOwnProperty("method"))
94957
- if (!$util.isString(message.method))
94958
- return "method: string expected";
94959
- if (message.ownerPrivateKey != null && message.hasOwnProperty("ownerPrivateKey"))
94960
- if (!(message.ownerPrivateKey && typeof message.ownerPrivateKey.length === "number" || $util.isString(message.ownerPrivateKey)))
94961
- return "ownerPrivateKey: buffer expected";
94962
- if (message.toAddress != null && message.hasOwnProperty("toAddress"))
94963
- if (!$util.isString(message.toAddress))
94964
- return "toAddress: string expected";
94965
- if (message.amount != null && message.hasOwnProperty("amount"))
94966
- if (!$util.isInteger(message.amount) && !(message.amount && $util.isInteger(message.amount.low) && $util.isInteger(message.amount.high)))
94967
- return "amount: integer|Long expected";
94968
- if (message.payerPrivateKey != null && message.hasOwnProperty("payerPrivateKey"))
94969
- if (!(message.payerPrivateKey && typeof message.payerPrivateKey.length === "number" || $util.isString(message.payerPrivateKey)))
94970
- return "payerPrivateKey: buffer expected";
94971
- if (message.gasPrice != null && message.hasOwnProperty("gasPrice"))
94972
- if (!$util.isInteger(message.gasPrice) && !(message.gasPrice && $util.isInteger(message.gasPrice.low) && $util.isInteger(message.gasPrice.high)))
94973
- return "gasPrice: integer|Long expected";
94974
- if (message.gasLimit != null && message.hasOwnProperty("gasLimit"))
94975
- if (!$util.isInteger(message.gasLimit) && !(message.gasLimit && $util.isInteger(message.gasLimit.low) && $util.isInteger(message.gasLimit.high)))
94976
- return "gasLimit: integer|Long expected";
94977
- if (message.queryAddress != null && message.hasOwnProperty("queryAddress"))
94978
- if (!$util.isString(message.queryAddress))
94979
- return "queryAddress: string expected";
94980
- if (message.nonce != null && message.hasOwnProperty("nonce"))
94981
- if (!$util.isInteger(message.nonce))
94982
- return "nonce: integer expected";
94983
- if (message.ownerAddress != null && message.hasOwnProperty("ownerAddress"))
94984
- if (!$util.isString(message.ownerAddress))
94985
- return "ownerAddress: string expected";
94986
- if (message.payerAddress != null && message.hasOwnProperty("payerAddress"))
94987
- if (!$util.isString(message.payerAddress))
94988
- return "payerAddress: string expected";
96453
+ if (message.privateKey != null && message.hasOwnProperty("privateKey"))
96454
+ if (!(message.privateKey && typeof message.privateKey.length === "number" || $util.isString(message.privateKey)))
96455
+ return "privateKey: buffer expected";
96456
+ if (message.transaction != null && message.hasOwnProperty("transaction")) {
96457
+ var error = $root.TW.Pactus.Proto.TransactionMessage.verify(message.transaction);
96458
+ if (error)
96459
+ return "transaction." + error;
96460
+ }
94989
96461
  return null;
94990
96462
  };
94991
96463
 
94992
96464
  /**
94993
96465
  * Creates a SigningInput message from a plain object. Also converts values to their respective internal types.
94994
96466
  * @function fromObject
94995
- * @memberof TW.Ontology.Proto.SigningInput
96467
+ * @memberof TW.Pactus.Proto.SigningInput
94996
96468
  * @static
94997
96469
  * @param {Object.<string,*>} object Plain object
94998
- * @returns {TW.Ontology.Proto.SigningInput} SigningInput
96470
+ * @returns {TW.Pactus.Proto.SigningInput} SigningInput
94999
96471
  */
95000
96472
  SigningInput.fromObject = function fromObject(object) {
95001
- if (object instanceof $root.TW.Ontology.Proto.SigningInput)
96473
+ if (object instanceof $root.TW.Pactus.Proto.SigningInput)
95002
96474
  return object;
95003
- var message = new $root.TW.Ontology.Proto.SigningInput();
95004
- if (object.contract != null)
95005
- message.contract = String(object.contract);
95006
- if (object.method != null)
95007
- message.method = String(object.method);
95008
- if (object.ownerPrivateKey != null)
95009
- if (typeof object.ownerPrivateKey === "string")
95010
- $util.base64.decode(object.ownerPrivateKey, message.ownerPrivateKey = $util.newBuffer($util.base64.length(object.ownerPrivateKey)), 0);
95011
- else if (object.ownerPrivateKey.length)
95012
- message.ownerPrivateKey = object.ownerPrivateKey;
95013
- if (object.toAddress != null)
95014
- message.toAddress = String(object.toAddress);
95015
- if (object.amount != null)
95016
- if ($util.Long)
95017
- (message.amount = $util.Long.fromValue(object.amount)).unsigned = true;
95018
- else if (typeof object.amount === "string")
95019
- message.amount = parseInt(object.amount, 10);
95020
- else if (typeof object.amount === "number")
95021
- message.amount = object.amount;
95022
- else if (typeof object.amount === "object")
95023
- message.amount = new $util.LongBits(object.amount.low >>> 0, object.amount.high >>> 0).toNumber(true);
95024
- if (object.payerPrivateKey != null)
95025
- if (typeof object.payerPrivateKey === "string")
95026
- $util.base64.decode(object.payerPrivateKey, message.payerPrivateKey = $util.newBuffer($util.base64.length(object.payerPrivateKey)), 0);
95027
- else if (object.payerPrivateKey.length)
95028
- message.payerPrivateKey = object.payerPrivateKey;
95029
- if (object.gasPrice != null)
95030
- if ($util.Long)
95031
- (message.gasPrice = $util.Long.fromValue(object.gasPrice)).unsigned = true;
95032
- else if (typeof object.gasPrice === "string")
95033
- message.gasPrice = parseInt(object.gasPrice, 10);
95034
- else if (typeof object.gasPrice === "number")
95035
- message.gasPrice = object.gasPrice;
95036
- else if (typeof object.gasPrice === "object")
95037
- message.gasPrice = new $util.LongBits(object.gasPrice.low >>> 0, object.gasPrice.high >>> 0).toNumber(true);
95038
- if (object.gasLimit != null)
95039
- if ($util.Long)
95040
- (message.gasLimit = $util.Long.fromValue(object.gasLimit)).unsigned = true;
95041
- else if (typeof object.gasLimit === "string")
95042
- message.gasLimit = parseInt(object.gasLimit, 10);
95043
- else if (typeof object.gasLimit === "number")
95044
- message.gasLimit = object.gasLimit;
95045
- else if (typeof object.gasLimit === "object")
95046
- message.gasLimit = new $util.LongBits(object.gasLimit.low >>> 0, object.gasLimit.high >>> 0).toNumber(true);
95047
- if (object.queryAddress != null)
95048
- message.queryAddress = String(object.queryAddress);
95049
- if (object.nonce != null)
95050
- message.nonce = object.nonce >>> 0;
95051
- if (object.ownerAddress != null)
95052
- message.ownerAddress = String(object.ownerAddress);
95053
- if (object.payerAddress != null)
95054
- message.payerAddress = String(object.payerAddress);
96475
+ var message = new $root.TW.Pactus.Proto.SigningInput();
96476
+ if (object.privateKey != null)
96477
+ if (typeof object.privateKey === "string")
96478
+ $util.base64.decode(object.privateKey, message.privateKey = $util.newBuffer($util.base64.length(object.privateKey)), 0);
96479
+ else if (object.privateKey.length)
96480
+ message.privateKey = object.privateKey;
96481
+ if (object.transaction != null) {
96482
+ if (typeof object.transaction !== "object")
96483
+ throw TypeError(".TW.Pactus.Proto.SigningInput.transaction: object expected");
96484
+ message.transaction = $root.TW.Pactus.Proto.TransactionMessage.fromObject(object.transaction);
96485
+ }
95055
96486
  return message;
95056
96487
  };
95057
96488
 
95058
96489
  /**
95059
96490
  * Creates a plain object from a SigningInput message. Also converts values to other types if specified.
95060
96491
  * @function toObject
95061
- * @memberof TW.Ontology.Proto.SigningInput
96492
+ * @memberof TW.Pactus.Proto.SigningInput
95062
96493
  * @static
95063
- * @param {TW.Ontology.Proto.SigningInput} message SigningInput
96494
+ * @param {TW.Pactus.Proto.SigningInput} message SigningInput
95064
96495
  * @param {$protobuf.IConversionOptions} [options] Conversion options
95065
96496
  * @returns {Object.<string,*>} Plain object
95066
96497
  */
@@ -95069,83 +96500,26 @@
95069
96500
  options = {};
95070
96501
  var object = {};
95071
96502
  if (options.defaults) {
95072
- object.contract = "";
95073
- object.method = "";
95074
- if (options.bytes === String)
95075
- object.ownerPrivateKey = "";
95076
- else {
95077
- object.ownerPrivateKey = [];
95078
- if (options.bytes !== Array)
95079
- object.ownerPrivateKey = $util.newBuffer(object.ownerPrivateKey);
95080
- }
95081
- object.toAddress = "";
95082
- if ($util.Long) {
95083
- var long = new $util.Long(0, 0, true);
95084
- object.amount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
95085
- } else
95086
- object.amount = options.longs === String ? "0" : 0;
95087
96503
  if (options.bytes === String)
95088
- object.payerPrivateKey = "";
96504
+ object.privateKey = "";
95089
96505
  else {
95090
- object.payerPrivateKey = [];
96506
+ object.privateKey = [];
95091
96507
  if (options.bytes !== Array)
95092
- object.payerPrivateKey = $util.newBuffer(object.payerPrivateKey);
96508
+ object.privateKey = $util.newBuffer(object.privateKey);
95093
96509
  }
95094
- if ($util.Long) {
95095
- var long = new $util.Long(0, 0, true);
95096
- object.gasPrice = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
95097
- } else
95098
- object.gasPrice = options.longs === String ? "0" : 0;
95099
- if ($util.Long) {
95100
- var long = new $util.Long(0, 0, true);
95101
- object.gasLimit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
95102
- } else
95103
- object.gasLimit = options.longs === String ? "0" : 0;
95104
- object.queryAddress = "";
95105
- object.nonce = 0;
95106
- object.ownerAddress = "";
95107
- object.payerAddress = "";
96510
+ object.transaction = null;
95108
96511
  }
95109
- if (message.contract != null && message.hasOwnProperty("contract"))
95110
- object.contract = message.contract;
95111
- if (message.method != null && message.hasOwnProperty("method"))
95112
- object.method = message.method;
95113
- if (message.ownerPrivateKey != null && message.hasOwnProperty("ownerPrivateKey"))
95114
- object.ownerPrivateKey = options.bytes === String ? $util.base64.encode(message.ownerPrivateKey, 0, message.ownerPrivateKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.ownerPrivateKey) : message.ownerPrivateKey;
95115
- if (message.toAddress != null && message.hasOwnProperty("toAddress"))
95116
- object.toAddress = message.toAddress;
95117
- if (message.amount != null && message.hasOwnProperty("amount"))
95118
- if (typeof message.amount === "number")
95119
- object.amount = options.longs === String ? String(message.amount) : message.amount;
95120
- else
95121
- object.amount = options.longs === String ? $util.Long.prototype.toString.call(message.amount) : options.longs === Number ? new $util.LongBits(message.amount.low >>> 0, message.amount.high >>> 0).toNumber(true) : message.amount;
95122
- if (message.payerPrivateKey != null && message.hasOwnProperty("payerPrivateKey"))
95123
- object.payerPrivateKey = options.bytes === String ? $util.base64.encode(message.payerPrivateKey, 0, message.payerPrivateKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.payerPrivateKey) : message.payerPrivateKey;
95124
- if (message.gasPrice != null && message.hasOwnProperty("gasPrice"))
95125
- if (typeof message.gasPrice === "number")
95126
- object.gasPrice = options.longs === String ? String(message.gasPrice) : message.gasPrice;
95127
- else
95128
- object.gasPrice = options.longs === String ? $util.Long.prototype.toString.call(message.gasPrice) : options.longs === Number ? new $util.LongBits(message.gasPrice.low >>> 0, message.gasPrice.high >>> 0).toNumber(true) : message.gasPrice;
95129
- if (message.gasLimit != null && message.hasOwnProperty("gasLimit"))
95130
- if (typeof message.gasLimit === "number")
95131
- object.gasLimit = options.longs === String ? String(message.gasLimit) : message.gasLimit;
95132
- else
95133
- object.gasLimit = options.longs === String ? $util.Long.prototype.toString.call(message.gasLimit) : options.longs === Number ? new $util.LongBits(message.gasLimit.low >>> 0, message.gasLimit.high >>> 0).toNumber(true) : message.gasLimit;
95134
- if (message.queryAddress != null && message.hasOwnProperty("queryAddress"))
95135
- object.queryAddress = message.queryAddress;
95136
- if (message.nonce != null && message.hasOwnProperty("nonce"))
95137
- object.nonce = message.nonce;
95138
- if (message.ownerAddress != null && message.hasOwnProperty("ownerAddress"))
95139
- object.ownerAddress = message.ownerAddress;
95140
- if (message.payerAddress != null && message.hasOwnProperty("payerAddress"))
95141
- object.payerAddress = message.payerAddress;
96512
+ if (message.privateKey != null && message.hasOwnProperty("privateKey"))
96513
+ object.privateKey = options.bytes === String ? $util.base64.encode(message.privateKey, 0, message.privateKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.privateKey) : message.privateKey;
96514
+ if (message.transaction != null && message.hasOwnProperty("transaction"))
96515
+ object.transaction = $root.TW.Pactus.Proto.TransactionMessage.toObject(message.transaction, options);
95142
96516
  return object;
95143
96517
  };
95144
96518
 
95145
96519
  /**
95146
96520
  * Converts this SigningInput to JSON.
95147
96521
  * @function toJSON
95148
- * @memberof TW.Ontology.Proto.SigningInput
96522
+ * @memberof TW.Pactus.Proto.SigningInput
95149
96523
  * @instance
95150
96524
  * @returns {Object.<string,*>} JSON object
95151
96525
  */
@@ -95160,20 +96534,22 @@
95160
96534
 
95161
96535
  /**
95162
96536
  * Properties of a SigningOutput.
95163
- * @memberof TW.Ontology.Proto
96537
+ * @memberof TW.Pactus.Proto
95164
96538
  * @interface ISigningOutput
95165
- * @property {Uint8Array|null} [encoded] SigningOutput encoded
96539
+ * @property {Uint8Array|null} [transactionId] SigningOutput transactionId
96540
+ * @property {Uint8Array|null} [signedTransactionData] SigningOutput signedTransactionData
96541
+ * @property {Uint8Array|null} [signature] SigningOutput signature
95166
96542
  * @property {TW.Common.Proto.SigningError|null} [error] SigningOutput error
95167
96543
  * @property {string|null} [errorMessage] SigningOutput errorMessage
95168
96544
  */
95169
96545
 
95170
96546
  /**
95171
96547
  * Constructs a new SigningOutput.
95172
- * @memberof TW.Ontology.Proto
96548
+ * @memberof TW.Pactus.Proto
95173
96549
  * @classdesc Represents a SigningOutput.
95174
96550
  * @implements ISigningOutput
95175
96551
  * @constructor
95176
- * @param {TW.Ontology.Proto.ISigningOutput=} [properties] Properties to set
96552
+ * @param {TW.Pactus.Proto.ISigningOutput=} [properties] Properties to set
95177
96553
  */
95178
96554
  function SigningOutput(properties) {
95179
96555
  if (properties)
@@ -95183,17 +96559,33 @@
95183
96559
  }
95184
96560
 
95185
96561
  /**
95186
- * SigningOutput encoded.
95187
- * @member {Uint8Array} encoded
95188
- * @memberof TW.Ontology.Proto.SigningOutput
96562
+ * SigningOutput transactionId.
96563
+ * @member {Uint8Array} transactionId
96564
+ * @memberof TW.Pactus.Proto.SigningOutput
95189
96565
  * @instance
95190
96566
  */
95191
- SigningOutput.prototype.encoded = $util.newBuffer([]);
96567
+ SigningOutput.prototype.transactionId = $util.newBuffer([]);
96568
+
96569
+ /**
96570
+ * SigningOutput signedTransactionData.
96571
+ * @member {Uint8Array} signedTransactionData
96572
+ * @memberof TW.Pactus.Proto.SigningOutput
96573
+ * @instance
96574
+ */
96575
+ SigningOutput.prototype.signedTransactionData = $util.newBuffer([]);
96576
+
96577
+ /**
96578
+ * SigningOutput signature.
96579
+ * @member {Uint8Array} signature
96580
+ * @memberof TW.Pactus.Proto.SigningOutput
96581
+ * @instance
96582
+ */
96583
+ SigningOutput.prototype.signature = $util.newBuffer([]);
95192
96584
 
95193
96585
  /**
95194
96586
  * SigningOutput error.
95195
96587
  * @member {TW.Common.Proto.SigningError} error
95196
- * @memberof TW.Ontology.Proto.SigningOutput
96588
+ * @memberof TW.Pactus.Proto.SigningOutput
95197
96589
  * @instance
95198
96590
  */
95199
96591
  SigningOutput.prototype.error = 0;
@@ -95201,7 +96593,7 @@
95201
96593
  /**
95202
96594
  * SigningOutput errorMessage.
95203
96595
  * @member {string} errorMessage
95204
- * @memberof TW.Ontology.Proto.SigningOutput
96596
+ * @memberof TW.Pactus.Proto.SigningOutput
95205
96597
  * @instance
95206
96598
  */
95207
96599
  SigningOutput.prototype.errorMessage = "";
@@ -95209,61 +96601,71 @@
95209
96601
  /**
95210
96602
  * Creates a new SigningOutput instance using the specified properties.
95211
96603
  * @function create
95212
- * @memberof TW.Ontology.Proto.SigningOutput
96604
+ * @memberof TW.Pactus.Proto.SigningOutput
95213
96605
  * @static
95214
- * @param {TW.Ontology.Proto.ISigningOutput=} [properties] Properties to set
95215
- * @returns {TW.Ontology.Proto.SigningOutput} SigningOutput instance
96606
+ * @param {TW.Pactus.Proto.ISigningOutput=} [properties] Properties to set
96607
+ * @returns {TW.Pactus.Proto.SigningOutput} SigningOutput instance
95216
96608
  */
95217
96609
  SigningOutput.create = function create(properties) {
95218
96610
  return new SigningOutput(properties);
95219
96611
  };
95220
96612
 
95221
96613
  /**
95222
- * Encodes the specified SigningOutput message. Does not implicitly {@link TW.Ontology.Proto.SigningOutput.verify|verify} messages.
96614
+ * Encodes the specified SigningOutput message. Does not implicitly {@link TW.Pactus.Proto.SigningOutput.verify|verify} messages.
95223
96615
  * @function encode
95224
- * @memberof TW.Ontology.Proto.SigningOutput
96616
+ * @memberof TW.Pactus.Proto.SigningOutput
95225
96617
  * @static
95226
- * @param {TW.Ontology.Proto.ISigningOutput} message SigningOutput message or plain object to encode
96618
+ * @param {TW.Pactus.Proto.ISigningOutput} message SigningOutput message or plain object to encode
95227
96619
  * @param {$protobuf.Writer} [writer] Writer to encode to
95228
96620
  * @returns {$protobuf.Writer} Writer
95229
96621
  */
95230
96622
  SigningOutput.encode = function encode(message, writer) {
95231
96623
  if (!writer)
95232
96624
  writer = $Writer.create();
95233
- if (message.encoded != null && Object.hasOwnProperty.call(message, "encoded"))
95234
- writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.encoded);
96625
+ if (message.transactionId != null && Object.hasOwnProperty.call(message, "transactionId"))
96626
+ writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.transactionId);
96627
+ if (message.signedTransactionData != null && Object.hasOwnProperty.call(message, "signedTransactionData"))
96628
+ writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.signedTransactionData);
96629
+ if (message.signature != null && Object.hasOwnProperty.call(message, "signature"))
96630
+ writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.signature);
95235
96631
  if (message.error != null && Object.hasOwnProperty.call(message, "error"))
95236
- writer.uint32(/* id 2, wireType 0 =*/16).int32(message.error);
96632
+ writer.uint32(/* id 4, wireType 0 =*/32).int32(message.error);
95237
96633
  if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage"))
95238
- writer.uint32(/* id 3, wireType 2 =*/26).string(message.errorMessage);
96634
+ writer.uint32(/* id 5, wireType 2 =*/42).string(message.errorMessage);
95239
96635
  return writer;
95240
96636
  };
95241
96637
 
95242
96638
  /**
95243
96639
  * Decodes a SigningOutput message from the specified reader or buffer.
95244
96640
  * @function decode
95245
- * @memberof TW.Ontology.Proto.SigningOutput
96641
+ * @memberof TW.Pactus.Proto.SigningOutput
95246
96642
  * @static
95247
96643
  * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
95248
96644
  * @param {number} [length] Message length if known beforehand
95249
- * @returns {TW.Ontology.Proto.SigningOutput} SigningOutput
96645
+ * @returns {TW.Pactus.Proto.SigningOutput} SigningOutput
95250
96646
  * @throws {Error} If the payload is not a reader or valid buffer
95251
96647
  * @throws {$protobuf.util.ProtocolError} If required fields are missing
95252
96648
  */
95253
96649
  SigningOutput.decode = function decode(reader, length) {
95254
96650
  if (!(reader instanceof $Reader))
95255
96651
  reader = $Reader.create(reader);
95256
- var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Ontology.Proto.SigningOutput();
96652
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Pactus.Proto.SigningOutput();
95257
96653
  while (reader.pos < end) {
95258
96654
  var tag = reader.uint32();
95259
96655
  switch (tag >>> 3) {
95260
96656
  case 1:
95261
- message.encoded = reader.bytes();
96657
+ message.transactionId = reader.bytes();
95262
96658
  break;
95263
96659
  case 2:
95264
- message.error = reader.int32();
96660
+ message.signedTransactionData = reader.bytes();
95265
96661
  break;
95266
96662
  case 3:
96663
+ message.signature = reader.bytes();
96664
+ break;
96665
+ case 4:
96666
+ message.error = reader.int32();
96667
+ break;
96668
+ case 5:
95267
96669
  message.errorMessage = reader.string();
95268
96670
  break;
95269
96671
  default:
@@ -95277,7 +96679,7 @@
95277
96679
  /**
95278
96680
  * Verifies a SigningOutput message.
95279
96681
  * @function verify
95280
- * @memberof TW.Ontology.Proto.SigningOutput
96682
+ * @memberof TW.Pactus.Proto.SigningOutput
95281
96683
  * @static
95282
96684
  * @param {Object.<string,*>} message Plain object to verify
95283
96685
  * @returns {string|null} `null` if valid, otherwise the reason why it is not
@@ -95285,9 +96687,15 @@
95285
96687
  SigningOutput.verify = function verify(message) {
95286
96688
  if (typeof message !== "object" || message === null)
95287
96689
  return "object expected";
95288
- if (message.encoded != null && message.hasOwnProperty("encoded"))
95289
- if (!(message.encoded && typeof message.encoded.length === "number" || $util.isString(message.encoded)))
95290
- return "encoded: buffer expected";
96690
+ if (message.transactionId != null && message.hasOwnProperty("transactionId"))
96691
+ if (!(message.transactionId && typeof message.transactionId.length === "number" || $util.isString(message.transactionId)))
96692
+ return "transactionId: buffer expected";
96693
+ if (message.signedTransactionData != null && message.hasOwnProperty("signedTransactionData"))
96694
+ if (!(message.signedTransactionData && typeof message.signedTransactionData.length === "number" || $util.isString(message.signedTransactionData)))
96695
+ return "signedTransactionData: buffer expected";
96696
+ if (message.signature != null && message.hasOwnProperty("signature"))
96697
+ if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature)))
96698
+ return "signature: buffer expected";
95291
96699
  if (message.error != null && message.hasOwnProperty("error"))
95292
96700
  switch (message.error) {
95293
96701
  default:
@@ -95329,20 +96737,30 @@
95329
96737
  /**
95330
96738
  * Creates a SigningOutput message from a plain object. Also converts values to their respective internal types.
95331
96739
  * @function fromObject
95332
- * @memberof TW.Ontology.Proto.SigningOutput
96740
+ * @memberof TW.Pactus.Proto.SigningOutput
95333
96741
  * @static
95334
96742
  * @param {Object.<string,*>} object Plain object
95335
- * @returns {TW.Ontology.Proto.SigningOutput} SigningOutput
96743
+ * @returns {TW.Pactus.Proto.SigningOutput} SigningOutput
95336
96744
  */
95337
96745
  SigningOutput.fromObject = function fromObject(object) {
95338
- if (object instanceof $root.TW.Ontology.Proto.SigningOutput)
96746
+ if (object instanceof $root.TW.Pactus.Proto.SigningOutput)
95339
96747
  return object;
95340
- var message = new $root.TW.Ontology.Proto.SigningOutput();
95341
- if (object.encoded != null)
95342
- if (typeof object.encoded === "string")
95343
- $util.base64.decode(object.encoded, message.encoded = $util.newBuffer($util.base64.length(object.encoded)), 0);
95344
- else if (object.encoded.length)
95345
- message.encoded = object.encoded;
96748
+ var message = new $root.TW.Pactus.Proto.SigningOutput();
96749
+ if (object.transactionId != null)
96750
+ if (typeof object.transactionId === "string")
96751
+ $util.base64.decode(object.transactionId, message.transactionId = $util.newBuffer($util.base64.length(object.transactionId)), 0);
96752
+ else if (object.transactionId.length)
96753
+ message.transactionId = object.transactionId;
96754
+ if (object.signedTransactionData != null)
96755
+ if (typeof object.signedTransactionData === "string")
96756
+ $util.base64.decode(object.signedTransactionData, message.signedTransactionData = $util.newBuffer($util.base64.length(object.signedTransactionData)), 0);
96757
+ else if (object.signedTransactionData.length)
96758
+ message.signedTransactionData = object.signedTransactionData;
96759
+ if (object.signature != null)
96760
+ if (typeof object.signature === "string")
96761
+ $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0);
96762
+ else if (object.signature.length)
96763
+ message.signature = object.signature;
95346
96764
  switch (object.error) {
95347
96765
  case "OK":
95348
96766
  case 0:
@@ -95457,9 +96875,9 @@
95457
96875
  /**
95458
96876
  * Creates a plain object from a SigningOutput message. Also converts values to other types if specified.
95459
96877
  * @function toObject
95460
- * @memberof TW.Ontology.Proto.SigningOutput
96878
+ * @memberof TW.Pactus.Proto.SigningOutput
95461
96879
  * @static
95462
- * @param {TW.Ontology.Proto.SigningOutput} message SigningOutput
96880
+ * @param {TW.Pactus.Proto.SigningOutput} message SigningOutput
95463
96881
  * @param {$protobuf.IConversionOptions} [options] Conversion options
95464
96882
  * @returns {Object.<string,*>} Plain object
95465
96883
  */
@@ -95469,17 +96887,35 @@
95469
96887
  var object = {};
95470
96888
  if (options.defaults) {
95471
96889
  if (options.bytes === String)
95472
- object.encoded = "";
96890
+ object.transactionId = "";
95473
96891
  else {
95474
- object.encoded = [];
96892
+ object.transactionId = [];
95475
96893
  if (options.bytes !== Array)
95476
- object.encoded = $util.newBuffer(object.encoded);
96894
+ object.transactionId = $util.newBuffer(object.transactionId);
96895
+ }
96896
+ if (options.bytes === String)
96897
+ object.signedTransactionData = "";
96898
+ else {
96899
+ object.signedTransactionData = [];
96900
+ if (options.bytes !== Array)
96901
+ object.signedTransactionData = $util.newBuffer(object.signedTransactionData);
96902
+ }
96903
+ if (options.bytes === String)
96904
+ object.signature = "";
96905
+ else {
96906
+ object.signature = [];
96907
+ if (options.bytes !== Array)
96908
+ object.signature = $util.newBuffer(object.signature);
95477
96909
  }
95478
96910
  object.error = options.enums === String ? "OK" : 0;
95479
96911
  object.errorMessage = "";
95480
96912
  }
95481
- if (message.encoded != null && message.hasOwnProperty("encoded"))
95482
- object.encoded = options.bytes === String ? $util.base64.encode(message.encoded, 0, message.encoded.length) : options.bytes === Array ? Array.prototype.slice.call(message.encoded) : message.encoded;
96913
+ if (message.transactionId != null && message.hasOwnProperty("transactionId"))
96914
+ object.transactionId = options.bytes === String ? $util.base64.encode(message.transactionId, 0, message.transactionId.length) : options.bytes === Array ? Array.prototype.slice.call(message.transactionId) : message.transactionId;
96915
+ if (message.signedTransactionData != null && message.hasOwnProperty("signedTransactionData"))
96916
+ object.signedTransactionData = options.bytes === String ? $util.base64.encode(message.signedTransactionData, 0, message.signedTransactionData.length) : options.bytes === Array ? Array.prototype.slice.call(message.signedTransactionData) : message.signedTransactionData;
96917
+ if (message.signature != null && message.hasOwnProperty("signature"))
96918
+ object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature;
95483
96919
  if (message.error != null && message.hasOwnProperty("error"))
95484
96920
  object.error = options.enums === String ? $root.TW.Common.Proto.SigningError[message.error] : message.error;
95485
96921
  if (message.errorMessage != null && message.hasOwnProperty("errorMessage"))
@@ -95490,7 +96926,7 @@
95490
96926
  /**
95491
96927
  * Converts this SigningOutput to JSON.
95492
96928
  * @function toJSON
95493
- * @memberof TW.Ontology.Proto.SigningOutput
96929
+ * @memberof TW.Pactus.Proto.SigningOutput
95494
96930
  * @instance
95495
96931
  * @returns {Object.<string,*>} JSON object
95496
96932
  */
@@ -95504,7 +96940,7 @@
95504
96940
  return Proto;
95505
96941
  })();
95506
96942
 
95507
- return Ontology;
96943
+ return Pactus;
95508
96944
  })();
95509
96945
 
95510
96946
  TW.Polkadot = (function() {
@@ -120826,8 +122262,9 @@
120826
122262
  * @property {number|null} [mode] Transfer mode
120827
122263
  * @property {string|null} [comment] Transfer comment
120828
122264
  * @property {boolean|null} [bounceable] Transfer bounceable
122265
+ * @property {string|null} [stateInit] Transfer stateInit
120829
122266
  * @property {TW.TheOpenNetwork.Proto.IJettonTransfer|null} [jettonTransfer] Transfer jettonTransfer
120830
- * @property {TW.TheOpenNetwork.Proto.ICustomPayload|null} [customPayload] Transfer customPayload
122267
+ * @property {string|null} [customPayload] Transfer customPayload
120831
122268
  */
120832
122269
 
120833
122270
  /**
@@ -120885,6 +122322,14 @@
120885
122322
  */
120886
122323
  Transfer.prototype.bounceable = false;
120887
122324
 
122325
+ /**
122326
+ * Transfer stateInit.
122327
+ * @member {string} stateInit
122328
+ * @memberof TW.TheOpenNetwork.Proto.Transfer
122329
+ * @instance
122330
+ */
122331
+ Transfer.prototype.stateInit = "";
122332
+
120888
122333
  /**
120889
122334
  * Transfer jettonTransfer.
120890
122335
  * @member {TW.TheOpenNetwork.Proto.IJettonTransfer|null|undefined} jettonTransfer
@@ -120895,7 +122340,7 @@
120895
122340
 
120896
122341
  /**
120897
122342
  * Transfer customPayload.
120898
- * @member {TW.TheOpenNetwork.Proto.ICustomPayload|null|undefined} customPayload
122343
+ * @member {string|null|undefined} customPayload
120899
122344
  * @memberof TW.TheOpenNetwork.Proto.Transfer
120900
122345
  * @instance
120901
122346
  */
@@ -120949,10 +122394,12 @@
120949
122394
  writer.uint32(/* id 4, wireType 2 =*/34).string(message.comment);
120950
122395
  if (message.bounceable != null && Object.hasOwnProperty.call(message, "bounceable"))
120951
122396
  writer.uint32(/* id 5, wireType 0 =*/40).bool(message.bounceable);
122397
+ if (message.stateInit != null && Object.hasOwnProperty.call(message, "stateInit"))
122398
+ writer.uint32(/* id 6, wireType 2 =*/50).string(message.stateInit);
120952
122399
  if (message.jettonTransfer != null && Object.hasOwnProperty.call(message, "jettonTransfer"))
120953
- $root.TW.TheOpenNetwork.Proto.JettonTransfer.encode(message.jettonTransfer, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
122400
+ $root.TW.TheOpenNetwork.Proto.JettonTransfer.encode(message.jettonTransfer, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
120954
122401
  if (message.customPayload != null && Object.hasOwnProperty.call(message, "customPayload"))
120955
- $root.TW.TheOpenNetwork.Proto.CustomPayload.encode(message.customPayload, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim();
122402
+ writer.uint32(/* id 8, wireType 2 =*/66).string(message.customPayload);
120956
122403
  return writer;
120957
122404
  };
120958
122405
 
@@ -120990,10 +122437,13 @@
120990
122437
  message.bounceable = reader.bool();
120991
122438
  break;
120992
122439
  case 6:
120993
- message.jettonTransfer = $root.TW.TheOpenNetwork.Proto.JettonTransfer.decode(reader, reader.uint32());
122440
+ message.stateInit = reader.string();
120994
122441
  break;
120995
122442
  case 7:
120996
- message.customPayload = $root.TW.TheOpenNetwork.Proto.CustomPayload.decode(reader, reader.uint32());
122443
+ message.jettonTransfer = $root.TW.TheOpenNetwork.Proto.JettonTransfer.decode(reader, reader.uint32());
122444
+ break;
122445
+ case 8:
122446
+ message.customPayload = reader.string();
120997
122447
  break;
120998
122448
  default:
120999
122449
  reader.skipType(tag & 7);
@@ -121030,6 +122480,9 @@
121030
122480
  if (message.bounceable != null && message.hasOwnProperty("bounceable"))
121031
122481
  if (typeof message.bounceable !== "boolean")
121032
122482
  return "bounceable: boolean expected";
122483
+ if (message.stateInit != null && message.hasOwnProperty("stateInit"))
122484
+ if (!$util.isString(message.stateInit))
122485
+ return "stateInit: string expected";
121033
122486
  if (message.jettonTransfer != null && message.hasOwnProperty("jettonTransfer")) {
121034
122487
  properties.payload = 1;
121035
122488
  {
@@ -121042,11 +122495,8 @@
121042
122495
  if (properties.payload === 1)
121043
122496
  return "payload: multiple values";
121044
122497
  properties.payload = 1;
121045
- {
121046
- var error = $root.TW.TheOpenNetwork.Proto.CustomPayload.verify(message.customPayload);
121047
- if (error)
121048
- return "customPayload." + error;
121049
- }
122498
+ if (!$util.isString(message.customPayload))
122499
+ return "customPayload: string expected";
121050
122500
  }
121051
122501
  return null;
121052
122502
  };
@@ -121080,16 +122530,15 @@
121080
122530
  message.comment = String(object.comment);
121081
122531
  if (object.bounceable != null)
121082
122532
  message.bounceable = Boolean(object.bounceable);
122533
+ if (object.stateInit != null)
122534
+ message.stateInit = String(object.stateInit);
121083
122535
  if (object.jettonTransfer != null) {
121084
122536
  if (typeof object.jettonTransfer !== "object")
121085
122537
  throw TypeError(".TW.TheOpenNetwork.Proto.Transfer.jettonTransfer: object expected");
121086
122538
  message.jettonTransfer = $root.TW.TheOpenNetwork.Proto.JettonTransfer.fromObject(object.jettonTransfer);
121087
122539
  }
121088
- if (object.customPayload != null) {
121089
- if (typeof object.customPayload !== "object")
121090
- throw TypeError(".TW.TheOpenNetwork.Proto.Transfer.customPayload: object expected");
121091
- message.customPayload = $root.TW.TheOpenNetwork.Proto.CustomPayload.fromObject(object.customPayload);
121092
- }
122540
+ if (object.customPayload != null)
122541
+ message.customPayload = String(object.customPayload);
121093
122542
  return message;
121094
122543
  };
121095
122544
 
@@ -121116,6 +122565,7 @@
121116
122565
  object.mode = 0;
121117
122566
  object.comment = "";
121118
122567
  object.bounceable = false;
122568
+ object.stateInit = "";
121119
122569
  }
121120
122570
  if (message.dest != null && message.hasOwnProperty("dest"))
121121
122571
  object.dest = message.dest;
@@ -121130,13 +122580,15 @@
121130
122580
  object.comment = message.comment;
121131
122581
  if (message.bounceable != null && message.hasOwnProperty("bounceable"))
121132
122582
  object.bounceable = message.bounceable;
122583
+ if (message.stateInit != null && message.hasOwnProperty("stateInit"))
122584
+ object.stateInit = message.stateInit;
121133
122585
  if (message.jettonTransfer != null && message.hasOwnProperty("jettonTransfer")) {
121134
122586
  object.jettonTransfer = $root.TW.TheOpenNetwork.Proto.JettonTransfer.toObject(message.jettonTransfer, options);
121135
122587
  if (options.oneofs)
121136
122588
  object.payload = "jettonTransfer";
121137
122589
  }
121138
122590
  if (message.customPayload != null && message.hasOwnProperty("customPayload")) {
121139
- object.customPayload = $root.TW.TheOpenNetwork.Proto.CustomPayload.toObject(message.customPayload, options);
122591
+ object.customPayload = message.customPayload;
121140
122592
  if (options.oneofs)
121141
122593
  object.payload = "customPayload";
121142
122594
  }
@@ -121168,6 +122620,7 @@
121168
122620
  * @property {string|null} [toOwner] JettonTransfer toOwner
121169
122621
  * @property {string|null} [responseAddress] JettonTransfer responseAddress
121170
122622
  * @property {Long|null} [forwardAmount] JettonTransfer forwardAmount
122623
+ * @property {string|null} [customPayload] JettonTransfer customPayload
121171
122624
  */
121172
122625
 
121173
122626
  /**
@@ -121225,6 +122678,14 @@
121225
122678
  */
121226
122679
  JettonTransfer.prototype.forwardAmount = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
121227
122680
 
122681
+ /**
122682
+ * JettonTransfer customPayload.
122683
+ * @member {string} customPayload
122684
+ * @memberof TW.TheOpenNetwork.Proto.JettonTransfer
122685
+ * @instance
122686
+ */
122687
+ JettonTransfer.prototype.customPayload = "";
122688
+
121228
122689
  /**
121229
122690
  * Creates a new JettonTransfer instance using the specified properties.
121230
122691
  * @function create
@@ -121259,6 +122720,8 @@
121259
122720
  writer.uint32(/* id 4, wireType 2 =*/34).string(message.responseAddress);
121260
122721
  if (message.forwardAmount != null && Object.hasOwnProperty.call(message, "forwardAmount"))
121261
122722
  writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.forwardAmount);
122723
+ if (message.customPayload != null && Object.hasOwnProperty.call(message, "customPayload"))
122724
+ writer.uint32(/* id 6, wireType 2 =*/50).string(message.customPayload);
121262
122725
  return writer;
121263
122726
  };
121264
122727
 
@@ -121295,6 +122758,9 @@
121295
122758
  case 5:
121296
122759
  message.forwardAmount = reader.uint64();
121297
122760
  break;
122761
+ case 6:
122762
+ message.customPayload = reader.string();
122763
+ break;
121298
122764
  default:
121299
122765
  reader.skipType(tag & 7);
121300
122766
  break;
@@ -121329,6 +122795,9 @@
121329
122795
  if (message.forwardAmount != null && message.hasOwnProperty("forwardAmount"))
121330
122796
  if (!$util.isInteger(message.forwardAmount) && !(message.forwardAmount && $util.isInteger(message.forwardAmount.low) && $util.isInteger(message.forwardAmount.high)))
121331
122797
  return "forwardAmount: integer|Long expected";
122798
+ if (message.customPayload != null && message.hasOwnProperty("customPayload"))
122799
+ if (!$util.isString(message.customPayload))
122800
+ return "customPayload: string expected";
121332
122801
  return null;
121333
122802
  };
121334
122803
 
@@ -121375,6 +122844,8 @@
121375
122844
  message.forwardAmount = object.forwardAmount;
121376
122845
  else if (typeof object.forwardAmount === "object")
121377
122846
  message.forwardAmount = new $util.LongBits(object.forwardAmount.low >>> 0, object.forwardAmount.high >>> 0).toNumber(true);
122847
+ if (object.customPayload != null)
122848
+ message.customPayload = String(object.customPayload);
121378
122849
  return message;
121379
122850
  };
121380
122851
 
@@ -121409,6 +122880,7 @@
121409
122880
  object.forwardAmount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
121410
122881
  } else
121411
122882
  object.forwardAmount = options.longs === String ? "0" : 0;
122883
+ object.customPayload = "";
121412
122884
  }
121413
122885
  if (message.queryId != null && message.hasOwnProperty("queryId"))
121414
122886
  if (typeof message.queryId === "number")
@@ -121429,6 +122901,8 @@
121429
122901
  object.forwardAmount = options.longs === String ? String(message.forwardAmount) : message.forwardAmount;
121430
122902
  else
121431
122903
  object.forwardAmount = options.longs === String ? $util.Long.prototype.toString.call(message.forwardAmount) : options.longs === Number ? new $util.LongBits(message.forwardAmount.low >>> 0, message.forwardAmount.high >>> 0).toNumber(true) : message.forwardAmount;
122904
+ if (message.customPayload != null && message.hasOwnProperty("customPayload"))
122905
+ object.customPayload = message.customPayload;
121432
122906
  return object;
121433
122907
  };
121434
122908
 
@@ -121446,187 +122920,6 @@
121446
122920
  return JettonTransfer;
121447
122921
  })();
121448
122922
 
121449
- Proto.CustomPayload = (function() {
121450
-
121451
- /**
121452
- * Properties of a CustomPayload.
121453
- * @memberof TW.TheOpenNetwork.Proto
121454
- * @interface ICustomPayload
121455
- * @property {string|null} [stateInit] CustomPayload stateInit
121456
- * @property {string|null} [payload] CustomPayload payload
121457
- */
121458
-
121459
- /**
121460
- * Constructs a new CustomPayload.
121461
- * @memberof TW.TheOpenNetwork.Proto
121462
- * @classdesc Represents a CustomPayload.
121463
- * @implements ICustomPayload
121464
- * @constructor
121465
- * @param {TW.TheOpenNetwork.Proto.ICustomPayload=} [properties] Properties to set
121466
- */
121467
- function CustomPayload(properties) {
121468
- if (properties)
121469
- for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
121470
- if (properties[keys[i]] != null)
121471
- this[keys[i]] = properties[keys[i]];
121472
- }
121473
-
121474
- /**
121475
- * CustomPayload stateInit.
121476
- * @member {string} stateInit
121477
- * @memberof TW.TheOpenNetwork.Proto.CustomPayload
121478
- * @instance
121479
- */
121480
- CustomPayload.prototype.stateInit = "";
121481
-
121482
- /**
121483
- * CustomPayload payload.
121484
- * @member {string} payload
121485
- * @memberof TW.TheOpenNetwork.Proto.CustomPayload
121486
- * @instance
121487
- */
121488
- CustomPayload.prototype.payload = "";
121489
-
121490
- /**
121491
- * Creates a new CustomPayload instance using the specified properties.
121492
- * @function create
121493
- * @memberof TW.TheOpenNetwork.Proto.CustomPayload
121494
- * @static
121495
- * @param {TW.TheOpenNetwork.Proto.ICustomPayload=} [properties] Properties to set
121496
- * @returns {TW.TheOpenNetwork.Proto.CustomPayload} CustomPayload instance
121497
- */
121498
- CustomPayload.create = function create(properties) {
121499
- return new CustomPayload(properties);
121500
- };
121501
-
121502
- /**
121503
- * Encodes the specified CustomPayload message. Does not implicitly {@link TW.TheOpenNetwork.Proto.CustomPayload.verify|verify} messages.
121504
- * @function encode
121505
- * @memberof TW.TheOpenNetwork.Proto.CustomPayload
121506
- * @static
121507
- * @param {TW.TheOpenNetwork.Proto.ICustomPayload} message CustomPayload message or plain object to encode
121508
- * @param {$protobuf.Writer} [writer] Writer to encode to
121509
- * @returns {$protobuf.Writer} Writer
121510
- */
121511
- CustomPayload.encode = function encode(message, writer) {
121512
- if (!writer)
121513
- writer = $Writer.create();
121514
- if (message.stateInit != null && Object.hasOwnProperty.call(message, "stateInit"))
121515
- writer.uint32(/* id 1, wireType 2 =*/10).string(message.stateInit);
121516
- if (message.payload != null && Object.hasOwnProperty.call(message, "payload"))
121517
- writer.uint32(/* id 2, wireType 2 =*/18).string(message.payload);
121518
- return writer;
121519
- };
121520
-
121521
- /**
121522
- * Decodes a CustomPayload message from the specified reader or buffer.
121523
- * @function decode
121524
- * @memberof TW.TheOpenNetwork.Proto.CustomPayload
121525
- * @static
121526
- * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
121527
- * @param {number} [length] Message length if known beforehand
121528
- * @returns {TW.TheOpenNetwork.Proto.CustomPayload} CustomPayload
121529
- * @throws {Error} If the payload is not a reader or valid buffer
121530
- * @throws {$protobuf.util.ProtocolError} If required fields are missing
121531
- */
121532
- CustomPayload.decode = function decode(reader, length) {
121533
- if (!(reader instanceof $Reader))
121534
- reader = $Reader.create(reader);
121535
- var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.TheOpenNetwork.Proto.CustomPayload();
121536
- while (reader.pos < end) {
121537
- var tag = reader.uint32();
121538
- switch (tag >>> 3) {
121539
- case 1:
121540
- message.stateInit = reader.string();
121541
- break;
121542
- case 2:
121543
- message.payload = reader.string();
121544
- break;
121545
- default:
121546
- reader.skipType(tag & 7);
121547
- break;
121548
- }
121549
- }
121550
- return message;
121551
- };
121552
-
121553
- /**
121554
- * Verifies a CustomPayload message.
121555
- * @function verify
121556
- * @memberof TW.TheOpenNetwork.Proto.CustomPayload
121557
- * @static
121558
- * @param {Object.<string,*>} message Plain object to verify
121559
- * @returns {string|null} `null` if valid, otherwise the reason why it is not
121560
- */
121561
- CustomPayload.verify = function verify(message) {
121562
- if (typeof message !== "object" || message === null)
121563
- return "object expected";
121564
- if (message.stateInit != null && message.hasOwnProperty("stateInit"))
121565
- if (!$util.isString(message.stateInit))
121566
- return "stateInit: string expected";
121567
- if (message.payload != null && message.hasOwnProperty("payload"))
121568
- if (!$util.isString(message.payload))
121569
- return "payload: string expected";
121570
- return null;
121571
- };
121572
-
121573
- /**
121574
- * Creates a CustomPayload message from a plain object. Also converts values to their respective internal types.
121575
- * @function fromObject
121576
- * @memberof TW.TheOpenNetwork.Proto.CustomPayload
121577
- * @static
121578
- * @param {Object.<string,*>} object Plain object
121579
- * @returns {TW.TheOpenNetwork.Proto.CustomPayload} CustomPayload
121580
- */
121581
- CustomPayload.fromObject = function fromObject(object) {
121582
- if (object instanceof $root.TW.TheOpenNetwork.Proto.CustomPayload)
121583
- return object;
121584
- var message = new $root.TW.TheOpenNetwork.Proto.CustomPayload();
121585
- if (object.stateInit != null)
121586
- message.stateInit = String(object.stateInit);
121587
- if (object.payload != null)
121588
- message.payload = String(object.payload);
121589
- return message;
121590
- };
121591
-
121592
- /**
121593
- * Creates a plain object from a CustomPayload message. Also converts values to other types if specified.
121594
- * @function toObject
121595
- * @memberof TW.TheOpenNetwork.Proto.CustomPayload
121596
- * @static
121597
- * @param {TW.TheOpenNetwork.Proto.CustomPayload} message CustomPayload
121598
- * @param {$protobuf.IConversionOptions} [options] Conversion options
121599
- * @returns {Object.<string,*>} Plain object
121600
- */
121601
- CustomPayload.toObject = function toObject(message, options) {
121602
- if (!options)
121603
- options = {};
121604
- var object = {};
121605
- if (options.defaults) {
121606
- object.stateInit = "";
121607
- object.payload = "";
121608
- }
121609
- if (message.stateInit != null && message.hasOwnProperty("stateInit"))
121610
- object.stateInit = message.stateInit;
121611
- if (message.payload != null && message.hasOwnProperty("payload"))
121612
- object.payload = message.payload;
121613
- return object;
121614
- };
121615
-
121616
- /**
121617
- * Converts this CustomPayload to JSON.
121618
- * @function toJSON
121619
- * @memberof TW.TheOpenNetwork.Proto.CustomPayload
121620
- * @instance
121621
- * @returns {Object.<string,*>} JSON object
121622
- */
121623
- CustomPayload.prototype.toJSON = function toJSON() {
121624
- return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
121625
- };
121626
-
121627
- return CustomPayload;
121628
- })();
121629
-
121630
122923
  Proto.SigningInput = (function() {
121631
122924
 
121632
122925
  /**
@@ -129077,6 +130370,7 @@
129077
130370
  * @property {Long|null} [expiration] Transaction expiration
129078
130371
  * @property {TW.Tron.Proto.IBlockHeader|null} [blockHeader] Transaction blockHeader
129079
130372
  * @property {Long|null} [feeLimit] Transaction feeLimit
130373
+ * @property {string|null} [memo] Transaction memo
129080
130374
  * @property {TW.Tron.Proto.ITransferContract|null} [transfer] Transaction transfer
129081
130375
  * @property {TW.Tron.Proto.ITransferAssetContract|null} [transferAsset] Transaction transferAsset
129082
130376
  * @property {TW.Tron.Proto.IFreezeBalanceContract|null} [freezeBalance] Transaction freezeBalance
@@ -129141,6 +130435,14 @@
129141
130435
  */
129142
130436
  Transaction.prototype.feeLimit = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
129143
130437
 
130438
+ /**
130439
+ * Transaction memo.
130440
+ * @member {string} memo
130441
+ * @memberof TW.Tron.Proto.Transaction
130442
+ * @instance
130443
+ */
130444
+ Transaction.prototype.memo = "";
130445
+
129144
130446
  /**
129145
130447
  * Transaction transfer.
129146
130448
  * @member {TW.Tron.Proto.ITransferContract|null|undefined} transfer
@@ -129307,6 +130609,8 @@
129307
130609
  $root.TW.Tron.Proto.BlockHeader.encode(message.blockHeader, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
129308
130610
  if (message.feeLimit != null && Object.hasOwnProperty.call(message, "feeLimit"))
129309
130611
  writer.uint32(/* id 4, wireType 0 =*/32).int64(message.feeLimit);
130612
+ if (message.memo != null && Object.hasOwnProperty.call(message, "memo"))
130613
+ writer.uint32(/* id 5, wireType 2 =*/42).string(message.memo);
129310
130614
  if (message.transfer != null && Object.hasOwnProperty.call(message, "transfer"))
129311
130615
  $root.TW.Tron.Proto.TransferContract.encode(message.transfer, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim();
129312
130616
  if (message.transferAsset != null && Object.hasOwnProperty.call(message, "transferAsset"))
@@ -129370,6 +130674,9 @@
129370
130674
  case 4:
129371
130675
  message.feeLimit = reader.int64();
129372
130676
  break;
130677
+ case 5:
130678
+ message.memo = reader.string();
130679
+ break;
129373
130680
  case 10:
129374
130681
  message.transfer = $root.TW.Tron.Proto.TransferContract.decode(reader, reader.uint32());
129375
130682
  break;
@@ -129449,6 +130756,9 @@
129449
130756
  if (message.feeLimit != null && message.hasOwnProperty("feeLimit"))
129450
130757
  if (!$util.isInteger(message.feeLimit) && !(message.feeLimit && $util.isInteger(message.feeLimit.low) && $util.isInteger(message.feeLimit.high)))
129451
130758
  return "feeLimit: integer|Long expected";
130759
+ if (message.memo != null && message.hasOwnProperty("memo"))
130760
+ if (!$util.isString(message.memo))
130761
+ return "memo: string expected";
129452
130762
  if (message.transfer != null && message.hasOwnProperty("transfer")) {
129453
130763
  properties.contractOneof = 1;
129454
130764
  {
@@ -129644,6 +130954,8 @@
129644
130954
  message.feeLimit = object.feeLimit;
129645
130955
  else if (typeof object.feeLimit === "object")
129646
130956
  message.feeLimit = new $util.LongBits(object.feeLimit.low >>> 0, object.feeLimit.high >>> 0).toNumber();
130957
+ if (object.memo != null)
130958
+ message.memo = String(object.memo);
129647
130959
  if (object.transfer != null) {
129648
130960
  if (typeof object.transfer !== "object")
129649
130961
  throw TypeError(".TW.Tron.Proto.Transaction.transfer: object expected");
@@ -129752,6 +131064,7 @@
129752
131064
  object.feeLimit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
129753
131065
  } else
129754
131066
  object.feeLimit = options.longs === String ? "0" : 0;
131067
+ object.memo = "";
129755
131068
  }
129756
131069
  if (message.timestamp != null && message.hasOwnProperty("timestamp"))
129757
131070
  if (typeof message.timestamp === "number")
@@ -129770,6 +131083,8 @@
129770
131083
  object.feeLimit = options.longs === String ? String(message.feeLimit) : message.feeLimit;
129771
131084
  else
129772
131085
  object.feeLimit = options.longs === String ? $util.Long.prototype.toString.call(message.feeLimit) : options.longs === Number ? new $util.LongBits(message.feeLimit.low >>> 0, message.feeLimit.high >>> 0).toNumber() : message.feeLimit;
131086
+ if (message.memo != null && message.hasOwnProperty("memo"))
131087
+ object.memo = message.memo;
129773
131088
  if (message.transfer != null && message.hasOwnProperty("transfer")) {
129774
131089
  object.transfer = $root.TW.Tron.Proto.TransferContract.toObject(message.transfer, options);
129775
131090
  if (options.oneofs)