@trustwallet/wallet-core 3.0.9 → 3.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -40793,6 +40793,1361 @@
40793
40793
  return Harmony;
40794
40794
  })();
40795
40795
 
40796
+ TW.Hedera = (function() {
40797
+
40798
+ /**
40799
+ * Namespace Hedera.
40800
+ * @memberof TW
40801
+ * @namespace
40802
+ */
40803
+ var Hedera = {};
40804
+
40805
+ Hedera.Proto = (function() {
40806
+
40807
+ /**
40808
+ * Namespace Proto.
40809
+ * @memberof TW.Hedera
40810
+ * @namespace
40811
+ */
40812
+ var Proto = {};
40813
+
40814
+ Proto.Timestamp = (function() {
40815
+
40816
+ /**
40817
+ * Properties of a Timestamp.
40818
+ * @memberof TW.Hedera.Proto
40819
+ * @interface ITimestamp
40820
+ * @property {Long|null} [seconds] Timestamp seconds
40821
+ * @property {number|null} [nanos] Timestamp nanos
40822
+ */
40823
+
40824
+ /**
40825
+ * Constructs a new Timestamp.
40826
+ * @memberof TW.Hedera.Proto
40827
+ * @classdesc Represents a Timestamp.
40828
+ * @implements ITimestamp
40829
+ * @constructor
40830
+ * @param {TW.Hedera.Proto.ITimestamp=} [properties] Properties to set
40831
+ */
40832
+ function Timestamp(properties) {
40833
+ if (properties)
40834
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
40835
+ if (properties[keys[i]] != null)
40836
+ this[keys[i]] = properties[keys[i]];
40837
+ }
40838
+
40839
+ /**
40840
+ * Timestamp seconds.
40841
+ * @member {Long} seconds
40842
+ * @memberof TW.Hedera.Proto.Timestamp
40843
+ * @instance
40844
+ */
40845
+ Timestamp.prototype.seconds = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
40846
+
40847
+ /**
40848
+ * Timestamp nanos.
40849
+ * @member {number} nanos
40850
+ * @memberof TW.Hedera.Proto.Timestamp
40851
+ * @instance
40852
+ */
40853
+ Timestamp.prototype.nanos = 0;
40854
+
40855
+ /**
40856
+ * Creates a new Timestamp instance using the specified properties.
40857
+ * @function create
40858
+ * @memberof TW.Hedera.Proto.Timestamp
40859
+ * @static
40860
+ * @param {TW.Hedera.Proto.ITimestamp=} [properties] Properties to set
40861
+ * @returns {TW.Hedera.Proto.Timestamp} Timestamp instance
40862
+ */
40863
+ Timestamp.create = function create(properties) {
40864
+ return new Timestamp(properties);
40865
+ };
40866
+
40867
+ /**
40868
+ * Encodes the specified Timestamp message. Does not implicitly {@link TW.Hedera.Proto.Timestamp.verify|verify} messages.
40869
+ * @function encode
40870
+ * @memberof TW.Hedera.Proto.Timestamp
40871
+ * @static
40872
+ * @param {TW.Hedera.Proto.ITimestamp} message Timestamp message or plain object to encode
40873
+ * @param {$protobuf.Writer} [writer] Writer to encode to
40874
+ * @returns {$protobuf.Writer} Writer
40875
+ */
40876
+ Timestamp.encode = function encode(message, writer) {
40877
+ if (!writer)
40878
+ writer = $Writer.create();
40879
+ if (message.seconds != null && Object.hasOwnProperty.call(message, "seconds"))
40880
+ writer.uint32(/* id 1, wireType 0 =*/8).int64(message.seconds);
40881
+ if (message.nanos != null && Object.hasOwnProperty.call(message, "nanos"))
40882
+ writer.uint32(/* id 2, wireType 0 =*/16).int32(message.nanos);
40883
+ return writer;
40884
+ };
40885
+
40886
+ /**
40887
+ * Decodes a Timestamp message from the specified reader or buffer.
40888
+ * @function decode
40889
+ * @memberof TW.Hedera.Proto.Timestamp
40890
+ * @static
40891
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
40892
+ * @param {number} [length] Message length if known beforehand
40893
+ * @returns {TW.Hedera.Proto.Timestamp} Timestamp
40894
+ * @throws {Error} If the payload is not a reader or valid buffer
40895
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
40896
+ */
40897
+ Timestamp.decode = function decode(reader, length) {
40898
+ if (!(reader instanceof $Reader))
40899
+ reader = $Reader.create(reader);
40900
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Hedera.Proto.Timestamp();
40901
+ while (reader.pos < end) {
40902
+ var tag = reader.uint32();
40903
+ switch (tag >>> 3) {
40904
+ case 1:
40905
+ message.seconds = reader.int64();
40906
+ break;
40907
+ case 2:
40908
+ message.nanos = reader.int32();
40909
+ break;
40910
+ default:
40911
+ reader.skipType(tag & 7);
40912
+ break;
40913
+ }
40914
+ }
40915
+ return message;
40916
+ };
40917
+
40918
+ /**
40919
+ * Verifies a Timestamp message.
40920
+ * @function verify
40921
+ * @memberof TW.Hedera.Proto.Timestamp
40922
+ * @static
40923
+ * @param {Object.<string,*>} message Plain object to verify
40924
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
40925
+ */
40926
+ Timestamp.verify = function verify(message) {
40927
+ if (typeof message !== "object" || message === null)
40928
+ return "object expected";
40929
+ if (message.seconds != null && message.hasOwnProperty("seconds"))
40930
+ if (!$util.isInteger(message.seconds) && !(message.seconds && $util.isInteger(message.seconds.low) && $util.isInteger(message.seconds.high)))
40931
+ return "seconds: integer|Long expected";
40932
+ if (message.nanos != null && message.hasOwnProperty("nanos"))
40933
+ if (!$util.isInteger(message.nanos))
40934
+ return "nanos: integer expected";
40935
+ return null;
40936
+ };
40937
+
40938
+ /**
40939
+ * Creates a Timestamp message from a plain object. Also converts values to their respective internal types.
40940
+ * @function fromObject
40941
+ * @memberof TW.Hedera.Proto.Timestamp
40942
+ * @static
40943
+ * @param {Object.<string,*>} object Plain object
40944
+ * @returns {TW.Hedera.Proto.Timestamp} Timestamp
40945
+ */
40946
+ Timestamp.fromObject = function fromObject(object) {
40947
+ if (object instanceof $root.TW.Hedera.Proto.Timestamp)
40948
+ return object;
40949
+ var message = new $root.TW.Hedera.Proto.Timestamp();
40950
+ if (object.seconds != null)
40951
+ if ($util.Long)
40952
+ (message.seconds = $util.Long.fromValue(object.seconds)).unsigned = false;
40953
+ else if (typeof object.seconds === "string")
40954
+ message.seconds = parseInt(object.seconds, 10);
40955
+ else if (typeof object.seconds === "number")
40956
+ message.seconds = object.seconds;
40957
+ else if (typeof object.seconds === "object")
40958
+ message.seconds = new $util.LongBits(object.seconds.low >>> 0, object.seconds.high >>> 0).toNumber();
40959
+ if (object.nanos != null)
40960
+ message.nanos = object.nanos | 0;
40961
+ return message;
40962
+ };
40963
+
40964
+ /**
40965
+ * Creates a plain object from a Timestamp message. Also converts values to other types if specified.
40966
+ * @function toObject
40967
+ * @memberof TW.Hedera.Proto.Timestamp
40968
+ * @static
40969
+ * @param {TW.Hedera.Proto.Timestamp} message Timestamp
40970
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
40971
+ * @returns {Object.<string,*>} Plain object
40972
+ */
40973
+ Timestamp.toObject = function toObject(message, options) {
40974
+ if (!options)
40975
+ options = {};
40976
+ var object = {};
40977
+ if (options.defaults) {
40978
+ if ($util.Long) {
40979
+ var long = new $util.Long(0, 0, false);
40980
+ object.seconds = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
40981
+ } else
40982
+ object.seconds = options.longs === String ? "0" : 0;
40983
+ object.nanos = 0;
40984
+ }
40985
+ if (message.seconds != null && message.hasOwnProperty("seconds"))
40986
+ if (typeof message.seconds === "number")
40987
+ object.seconds = options.longs === String ? String(message.seconds) : message.seconds;
40988
+ else
40989
+ object.seconds = options.longs === String ? $util.Long.prototype.toString.call(message.seconds) : options.longs === Number ? new $util.LongBits(message.seconds.low >>> 0, message.seconds.high >>> 0).toNumber() : message.seconds;
40990
+ if (message.nanos != null && message.hasOwnProperty("nanos"))
40991
+ object.nanos = message.nanos;
40992
+ return object;
40993
+ };
40994
+
40995
+ /**
40996
+ * Converts this Timestamp to JSON.
40997
+ * @function toJSON
40998
+ * @memberof TW.Hedera.Proto.Timestamp
40999
+ * @instance
41000
+ * @returns {Object.<string,*>} JSON object
41001
+ */
41002
+ Timestamp.prototype.toJSON = function toJSON() {
41003
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
41004
+ };
41005
+
41006
+ return Timestamp;
41007
+ })();
41008
+
41009
+ Proto.TransactionID = (function() {
41010
+
41011
+ /**
41012
+ * Properties of a TransactionID.
41013
+ * @memberof TW.Hedera.Proto
41014
+ * @interface ITransactionID
41015
+ * @property {TW.Hedera.Proto.ITimestamp|null} [transactionValidStart] TransactionID transactionValidStart
41016
+ * @property {string|null} [accountID] TransactionID accountID
41017
+ * @property {boolean|null} [scheduled] TransactionID scheduled
41018
+ * @property {number|null} [nonce] TransactionID nonce
41019
+ */
41020
+
41021
+ /**
41022
+ * Constructs a new TransactionID.
41023
+ * @memberof TW.Hedera.Proto
41024
+ * @classdesc Represents a TransactionID.
41025
+ * @implements ITransactionID
41026
+ * @constructor
41027
+ * @param {TW.Hedera.Proto.ITransactionID=} [properties] Properties to set
41028
+ */
41029
+ function TransactionID(properties) {
41030
+ if (properties)
41031
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
41032
+ if (properties[keys[i]] != null)
41033
+ this[keys[i]] = properties[keys[i]];
41034
+ }
41035
+
41036
+ /**
41037
+ * TransactionID transactionValidStart.
41038
+ * @member {TW.Hedera.Proto.ITimestamp|null|undefined} transactionValidStart
41039
+ * @memberof TW.Hedera.Proto.TransactionID
41040
+ * @instance
41041
+ */
41042
+ TransactionID.prototype.transactionValidStart = null;
41043
+
41044
+ /**
41045
+ * TransactionID accountID.
41046
+ * @member {string} accountID
41047
+ * @memberof TW.Hedera.Proto.TransactionID
41048
+ * @instance
41049
+ */
41050
+ TransactionID.prototype.accountID = "";
41051
+
41052
+ /**
41053
+ * TransactionID scheduled.
41054
+ * @member {boolean} scheduled
41055
+ * @memberof TW.Hedera.Proto.TransactionID
41056
+ * @instance
41057
+ */
41058
+ TransactionID.prototype.scheduled = false;
41059
+
41060
+ /**
41061
+ * TransactionID nonce.
41062
+ * @member {number} nonce
41063
+ * @memberof TW.Hedera.Proto.TransactionID
41064
+ * @instance
41065
+ */
41066
+ TransactionID.prototype.nonce = 0;
41067
+
41068
+ /**
41069
+ * Creates a new TransactionID instance using the specified properties.
41070
+ * @function create
41071
+ * @memberof TW.Hedera.Proto.TransactionID
41072
+ * @static
41073
+ * @param {TW.Hedera.Proto.ITransactionID=} [properties] Properties to set
41074
+ * @returns {TW.Hedera.Proto.TransactionID} TransactionID instance
41075
+ */
41076
+ TransactionID.create = function create(properties) {
41077
+ return new TransactionID(properties);
41078
+ };
41079
+
41080
+ /**
41081
+ * Encodes the specified TransactionID message. Does not implicitly {@link TW.Hedera.Proto.TransactionID.verify|verify} messages.
41082
+ * @function encode
41083
+ * @memberof TW.Hedera.Proto.TransactionID
41084
+ * @static
41085
+ * @param {TW.Hedera.Proto.ITransactionID} message TransactionID message or plain object to encode
41086
+ * @param {$protobuf.Writer} [writer] Writer to encode to
41087
+ * @returns {$protobuf.Writer} Writer
41088
+ */
41089
+ TransactionID.encode = function encode(message, writer) {
41090
+ if (!writer)
41091
+ writer = $Writer.create();
41092
+ if (message.transactionValidStart != null && Object.hasOwnProperty.call(message, "transactionValidStart"))
41093
+ $root.TW.Hedera.Proto.Timestamp.encode(message.transactionValidStart, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
41094
+ if (message.accountID != null && Object.hasOwnProperty.call(message, "accountID"))
41095
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.accountID);
41096
+ if (message.scheduled != null && Object.hasOwnProperty.call(message, "scheduled"))
41097
+ writer.uint32(/* id 3, wireType 0 =*/24).bool(message.scheduled);
41098
+ if (message.nonce != null && Object.hasOwnProperty.call(message, "nonce"))
41099
+ writer.uint32(/* id 4, wireType 0 =*/32).int32(message.nonce);
41100
+ return writer;
41101
+ };
41102
+
41103
+ /**
41104
+ * Decodes a TransactionID message from the specified reader or buffer.
41105
+ * @function decode
41106
+ * @memberof TW.Hedera.Proto.TransactionID
41107
+ * @static
41108
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
41109
+ * @param {number} [length] Message length if known beforehand
41110
+ * @returns {TW.Hedera.Proto.TransactionID} TransactionID
41111
+ * @throws {Error} If the payload is not a reader or valid buffer
41112
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
41113
+ */
41114
+ TransactionID.decode = function decode(reader, length) {
41115
+ if (!(reader instanceof $Reader))
41116
+ reader = $Reader.create(reader);
41117
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Hedera.Proto.TransactionID();
41118
+ while (reader.pos < end) {
41119
+ var tag = reader.uint32();
41120
+ switch (tag >>> 3) {
41121
+ case 1:
41122
+ message.transactionValidStart = $root.TW.Hedera.Proto.Timestamp.decode(reader, reader.uint32());
41123
+ break;
41124
+ case 2:
41125
+ message.accountID = reader.string();
41126
+ break;
41127
+ case 3:
41128
+ message.scheduled = reader.bool();
41129
+ break;
41130
+ case 4:
41131
+ message.nonce = reader.int32();
41132
+ break;
41133
+ default:
41134
+ reader.skipType(tag & 7);
41135
+ break;
41136
+ }
41137
+ }
41138
+ return message;
41139
+ };
41140
+
41141
+ /**
41142
+ * Verifies a TransactionID message.
41143
+ * @function verify
41144
+ * @memberof TW.Hedera.Proto.TransactionID
41145
+ * @static
41146
+ * @param {Object.<string,*>} message Plain object to verify
41147
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
41148
+ */
41149
+ TransactionID.verify = function verify(message) {
41150
+ if (typeof message !== "object" || message === null)
41151
+ return "object expected";
41152
+ if (message.transactionValidStart != null && message.hasOwnProperty("transactionValidStart")) {
41153
+ var error = $root.TW.Hedera.Proto.Timestamp.verify(message.transactionValidStart);
41154
+ if (error)
41155
+ return "transactionValidStart." + error;
41156
+ }
41157
+ if (message.accountID != null && message.hasOwnProperty("accountID"))
41158
+ if (!$util.isString(message.accountID))
41159
+ return "accountID: string expected";
41160
+ if (message.scheduled != null && message.hasOwnProperty("scheduled"))
41161
+ if (typeof message.scheduled !== "boolean")
41162
+ return "scheduled: boolean expected";
41163
+ if (message.nonce != null && message.hasOwnProperty("nonce"))
41164
+ if (!$util.isInteger(message.nonce))
41165
+ return "nonce: integer expected";
41166
+ return null;
41167
+ };
41168
+
41169
+ /**
41170
+ * Creates a TransactionID message from a plain object. Also converts values to their respective internal types.
41171
+ * @function fromObject
41172
+ * @memberof TW.Hedera.Proto.TransactionID
41173
+ * @static
41174
+ * @param {Object.<string,*>} object Plain object
41175
+ * @returns {TW.Hedera.Proto.TransactionID} TransactionID
41176
+ */
41177
+ TransactionID.fromObject = function fromObject(object) {
41178
+ if (object instanceof $root.TW.Hedera.Proto.TransactionID)
41179
+ return object;
41180
+ var message = new $root.TW.Hedera.Proto.TransactionID();
41181
+ if (object.transactionValidStart != null) {
41182
+ if (typeof object.transactionValidStart !== "object")
41183
+ throw TypeError(".TW.Hedera.Proto.TransactionID.transactionValidStart: object expected");
41184
+ message.transactionValidStart = $root.TW.Hedera.Proto.Timestamp.fromObject(object.transactionValidStart);
41185
+ }
41186
+ if (object.accountID != null)
41187
+ message.accountID = String(object.accountID);
41188
+ if (object.scheduled != null)
41189
+ message.scheduled = Boolean(object.scheduled);
41190
+ if (object.nonce != null)
41191
+ message.nonce = object.nonce | 0;
41192
+ return message;
41193
+ };
41194
+
41195
+ /**
41196
+ * Creates a plain object from a TransactionID message. Also converts values to other types if specified.
41197
+ * @function toObject
41198
+ * @memberof TW.Hedera.Proto.TransactionID
41199
+ * @static
41200
+ * @param {TW.Hedera.Proto.TransactionID} message TransactionID
41201
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
41202
+ * @returns {Object.<string,*>} Plain object
41203
+ */
41204
+ TransactionID.toObject = function toObject(message, options) {
41205
+ if (!options)
41206
+ options = {};
41207
+ var object = {};
41208
+ if (options.defaults) {
41209
+ object.transactionValidStart = null;
41210
+ object.accountID = "";
41211
+ object.scheduled = false;
41212
+ object.nonce = 0;
41213
+ }
41214
+ if (message.transactionValidStart != null && message.hasOwnProperty("transactionValidStart"))
41215
+ object.transactionValidStart = $root.TW.Hedera.Proto.Timestamp.toObject(message.transactionValidStart, options);
41216
+ if (message.accountID != null && message.hasOwnProperty("accountID"))
41217
+ object.accountID = message.accountID;
41218
+ if (message.scheduled != null && message.hasOwnProperty("scheduled"))
41219
+ object.scheduled = message.scheduled;
41220
+ if (message.nonce != null && message.hasOwnProperty("nonce"))
41221
+ object.nonce = message.nonce;
41222
+ return object;
41223
+ };
41224
+
41225
+ /**
41226
+ * Converts this TransactionID to JSON.
41227
+ * @function toJSON
41228
+ * @memberof TW.Hedera.Proto.TransactionID
41229
+ * @instance
41230
+ * @returns {Object.<string,*>} JSON object
41231
+ */
41232
+ TransactionID.prototype.toJSON = function toJSON() {
41233
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
41234
+ };
41235
+
41236
+ return TransactionID;
41237
+ })();
41238
+
41239
+ Proto.TransferMessage = (function() {
41240
+
41241
+ /**
41242
+ * Properties of a TransferMessage.
41243
+ * @memberof TW.Hedera.Proto
41244
+ * @interface ITransferMessage
41245
+ * @property {string|null} [from] TransferMessage from
41246
+ * @property {string|null} [to] TransferMessage to
41247
+ * @property {Long|null} [amount] TransferMessage amount
41248
+ */
41249
+
41250
+ /**
41251
+ * Constructs a new TransferMessage.
41252
+ * @memberof TW.Hedera.Proto
41253
+ * @classdesc Represents a TransferMessage.
41254
+ * @implements ITransferMessage
41255
+ * @constructor
41256
+ * @param {TW.Hedera.Proto.ITransferMessage=} [properties] Properties to set
41257
+ */
41258
+ function TransferMessage(properties) {
41259
+ if (properties)
41260
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
41261
+ if (properties[keys[i]] != null)
41262
+ this[keys[i]] = properties[keys[i]];
41263
+ }
41264
+
41265
+ /**
41266
+ * TransferMessage from.
41267
+ * @member {string} from
41268
+ * @memberof TW.Hedera.Proto.TransferMessage
41269
+ * @instance
41270
+ */
41271
+ TransferMessage.prototype.from = "";
41272
+
41273
+ /**
41274
+ * TransferMessage to.
41275
+ * @member {string} to
41276
+ * @memberof TW.Hedera.Proto.TransferMessage
41277
+ * @instance
41278
+ */
41279
+ TransferMessage.prototype.to = "";
41280
+
41281
+ /**
41282
+ * TransferMessage amount.
41283
+ * @member {Long} amount
41284
+ * @memberof TW.Hedera.Proto.TransferMessage
41285
+ * @instance
41286
+ */
41287
+ TransferMessage.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
41288
+
41289
+ /**
41290
+ * Creates a new TransferMessage instance using the specified properties.
41291
+ * @function create
41292
+ * @memberof TW.Hedera.Proto.TransferMessage
41293
+ * @static
41294
+ * @param {TW.Hedera.Proto.ITransferMessage=} [properties] Properties to set
41295
+ * @returns {TW.Hedera.Proto.TransferMessage} TransferMessage instance
41296
+ */
41297
+ TransferMessage.create = function create(properties) {
41298
+ return new TransferMessage(properties);
41299
+ };
41300
+
41301
+ /**
41302
+ * Encodes the specified TransferMessage message. Does not implicitly {@link TW.Hedera.Proto.TransferMessage.verify|verify} messages.
41303
+ * @function encode
41304
+ * @memberof TW.Hedera.Proto.TransferMessage
41305
+ * @static
41306
+ * @param {TW.Hedera.Proto.ITransferMessage} message TransferMessage message or plain object to encode
41307
+ * @param {$protobuf.Writer} [writer] Writer to encode to
41308
+ * @returns {$protobuf.Writer} Writer
41309
+ */
41310
+ TransferMessage.encode = function encode(message, writer) {
41311
+ if (!writer)
41312
+ writer = $Writer.create();
41313
+ if (message.from != null && Object.hasOwnProperty.call(message, "from"))
41314
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.from);
41315
+ if (message.to != null && Object.hasOwnProperty.call(message, "to"))
41316
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.to);
41317
+ if (message.amount != null && Object.hasOwnProperty.call(message, "amount"))
41318
+ writer.uint32(/* id 3, wireType 0 =*/24).sint64(message.amount);
41319
+ return writer;
41320
+ };
41321
+
41322
+ /**
41323
+ * Decodes a TransferMessage message from the specified reader or buffer.
41324
+ * @function decode
41325
+ * @memberof TW.Hedera.Proto.TransferMessage
41326
+ * @static
41327
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
41328
+ * @param {number} [length] Message length if known beforehand
41329
+ * @returns {TW.Hedera.Proto.TransferMessage} TransferMessage
41330
+ * @throws {Error} If the payload is not a reader or valid buffer
41331
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
41332
+ */
41333
+ TransferMessage.decode = function decode(reader, length) {
41334
+ if (!(reader instanceof $Reader))
41335
+ reader = $Reader.create(reader);
41336
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Hedera.Proto.TransferMessage();
41337
+ while (reader.pos < end) {
41338
+ var tag = reader.uint32();
41339
+ switch (tag >>> 3) {
41340
+ case 1:
41341
+ message.from = reader.string();
41342
+ break;
41343
+ case 2:
41344
+ message.to = reader.string();
41345
+ break;
41346
+ case 3:
41347
+ message.amount = reader.sint64();
41348
+ break;
41349
+ default:
41350
+ reader.skipType(tag & 7);
41351
+ break;
41352
+ }
41353
+ }
41354
+ return message;
41355
+ };
41356
+
41357
+ /**
41358
+ * Verifies a TransferMessage message.
41359
+ * @function verify
41360
+ * @memberof TW.Hedera.Proto.TransferMessage
41361
+ * @static
41362
+ * @param {Object.<string,*>} message Plain object to verify
41363
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
41364
+ */
41365
+ TransferMessage.verify = function verify(message) {
41366
+ if (typeof message !== "object" || message === null)
41367
+ return "object expected";
41368
+ if (message.from != null && message.hasOwnProperty("from"))
41369
+ if (!$util.isString(message.from))
41370
+ return "from: string expected";
41371
+ if (message.to != null && message.hasOwnProperty("to"))
41372
+ if (!$util.isString(message.to))
41373
+ return "to: string expected";
41374
+ if (message.amount != null && message.hasOwnProperty("amount"))
41375
+ if (!$util.isInteger(message.amount) && !(message.amount && $util.isInteger(message.amount.low) && $util.isInteger(message.amount.high)))
41376
+ return "amount: integer|Long expected";
41377
+ return null;
41378
+ };
41379
+
41380
+ /**
41381
+ * Creates a TransferMessage message from a plain object. Also converts values to their respective internal types.
41382
+ * @function fromObject
41383
+ * @memberof TW.Hedera.Proto.TransferMessage
41384
+ * @static
41385
+ * @param {Object.<string,*>} object Plain object
41386
+ * @returns {TW.Hedera.Proto.TransferMessage} TransferMessage
41387
+ */
41388
+ TransferMessage.fromObject = function fromObject(object) {
41389
+ if (object instanceof $root.TW.Hedera.Proto.TransferMessage)
41390
+ return object;
41391
+ var message = new $root.TW.Hedera.Proto.TransferMessage();
41392
+ if (object.from != null)
41393
+ message.from = String(object.from);
41394
+ if (object.to != null)
41395
+ message.to = String(object.to);
41396
+ if (object.amount != null)
41397
+ if ($util.Long)
41398
+ (message.amount = $util.Long.fromValue(object.amount)).unsigned = false;
41399
+ else if (typeof object.amount === "string")
41400
+ message.amount = parseInt(object.amount, 10);
41401
+ else if (typeof object.amount === "number")
41402
+ message.amount = object.amount;
41403
+ else if (typeof object.amount === "object")
41404
+ message.amount = new $util.LongBits(object.amount.low >>> 0, object.amount.high >>> 0).toNumber();
41405
+ return message;
41406
+ };
41407
+
41408
+ /**
41409
+ * Creates a plain object from a TransferMessage message. Also converts values to other types if specified.
41410
+ * @function toObject
41411
+ * @memberof TW.Hedera.Proto.TransferMessage
41412
+ * @static
41413
+ * @param {TW.Hedera.Proto.TransferMessage} message TransferMessage
41414
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
41415
+ * @returns {Object.<string,*>} Plain object
41416
+ */
41417
+ TransferMessage.toObject = function toObject(message, options) {
41418
+ if (!options)
41419
+ options = {};
41420
+ var object = {};
41421
+ if (options.defaults) {
41422
+ object.from = "";
41423
+ object.to = "";
41424
+ if ($util.Long) {
41425
+ var long = new $util.Long(0, 0, false);
41426
+ object.amount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
41427
+ } else
41428
+ object.amount = options.longs === String ? "0" : 0;
41429
+ }
41430
+ if (message.from != null && message.hasOwnProperty("from"))
41431
+ object.from = message.from;
41432
+ if (message.to != null && message.hasOwnProperty("to"))
41433
+ object.to = message.to;
41434
+ if (message.amount != null && message.hasOwnProperty("amount"))
41435
+ if (typeof message.amount === "number")
41436
+ object.amount = options.longs === String ? String(message.amount) : message.amount;
41437
+ else
41438
+ 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;
41439
+ return object;
41440
+ };
41441
+
41442
+ /**
41443
+ * Converts this TransferMessage to JSON.
41444
+ * @function toJSON
41445
+ * @memberof TW.Hedera.Proto.TransferMessage
41446
+ * @instance
41447
+ * @returns {Object.<string,*>} JSON object
41448
+ */
41449
+ TransferMessage.prototype.toJSON = function toJSON() {
41450
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
41451
+ };
41452
+
41453
+ return TransferMessage;
41454
+ })();
41455
+
41456
+ Proto.TransactionBody = (function() {
41457
+
41458
+ /**
41459
+ * Properties of a TransactionBody.
41460
+ * @memberof TW.Hedera.Proto
41461
+ * @interface ITransactionBody
41462
+ * @property {TW.Hedera.Proto.ITransactionID|null} [transactionID] TransactionBody transactionID
41463
+ * @property {string|null} [nodeAccountID] TransactionBody nodeAccountID
41464
+ * @property {Long|null} [transactionFee] TransactionBody transactionFee
41465
+ * @property {Long|null} [transactionValidDuration] TransactionBody transactionValidDuration
41466
+ * @property {string|null} [memo] TransactionBody memo
41467
+ * @property {TW.Hedera.Proto.ITransferMessage|null} [transfer] TransactionBody transfer
41468
+ */
41469
+
41470
+ /**
41471
+ * Constructs a new TransactionBody.
41472
+ * @memberof TW.Hedera.Proto
41473
+ * @classdesc Represents a TransactionBody.
41474
+ * @implements ITransactionBody
41475
+ * @constructor
41476
+ * @param {TW.Hedera.Proto.ITransactionBody=} [properties] Properties to set
41477
+ */
41478
+ function TransactionBody(properties) {
41479
+ if (properties)
41480
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
41481
+ if (properties[keys[i]] != null)
41482
+ this[keys[i]] = properties[keys[i]];
41483
+ }
41484
+
41485
+ /**
41486
+ * TransactionBody transactionID.
41487
+ * @member {TW.Hedera.Proto.ITransactionID|null|undefined} transactionID
41488
+ * @memberof TW.Hedera.Proto.TransactionBody
41489
+ * @instance
41490
+ */
41491
+ TransactionBody.prototype.transactionID = null;
41492
+
41493
+ /**
41494
+ * TransactionBody nodeAccountID.
41495
+ * @member {string} nodeAccountID
41496
+ * @memberof TW.Hedera.Proto.TransactionBody
41497
+ * @instance
41498
+ */
41499
+ TransactionBody.prototype.nodeAccountID = "";
41500
+
41501
+ /**
41502
+ * TransactionBody transactionFee.
41503
+ * @member {Long} transactionFee
41504
+ * @memberof TW.Hedera.Proto.TransactionBody
41505
+ * @instance
41506
+ */
41507
+ TransactionBody.prototype.transactionFee = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
41508
+
41509
+ /**
41510
+ * TransactionBody transactionValidDuration.
41511
+ * @member {Long} transactionValidDuration
41512
+ * @memberof TW.Hedera.Proto.TransactionBody
41513
+ * @instance
41514
+ */
41515
+ TransactionBody.prototype.transactionValidDuration = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
41516
+
41517
+ /**
41518
+ * TransactionBody memo.
41519
+ * @member {string} memo
41520
+ * @memberof TW.Hedera.Proto.TransactionBody
41521
+ * @instance
41522
+ */
41523
+ TransactionBody.prototype.memo = "";
41524
+
41525
+ /**
41526
+ * TransactionBody transfer.
41527
+ * @member {TW.Hedera.Proto.ITransferMessage|null|undefined} transfer
41528
+ * @memberof TW.Hedera.Proto.TransactionBody
41529
+ * @instance
41530
+ */
41531
+ TransactionBody.prototype.transfer = null;
41532
+
41533
+ // OneOf field names bound to virtual getters and setters
41534
+ var $oneOfFields;
41535
+
41536
+ /**
41537
+ * TransactionBody data.
41538
+ * @member {"transfer"|undefined} data
41539
+ * @memberof TW.Hedera.Proto.TransactionBody
41540
+ * @instance
41541
+ */
41542
+ Object.defineProperty(TransactionBody.prototype, "data", {
41543
+ get: $util.oneOfGetter($oneOfFields = ["transfer"]),
41544
+ set: $util.oneOfSetter($oneOfFields)
41545
+ });
41546
+
41547
+ /**
41548
+ * Creates a new TransactionBody instance using the specified properties.
41549
+ * @function create
41550
+ * @memberof TW.Hedera.Proto.TransactionBody
41551
+ * @static
41552
+ * @param {TW.Hedera.Proto.ITransactionBody=} [properties] Properties to set
41553
+ * @returns {TW.Hedera.Proto.TransactionBody} TransactionBody instance
41554
+ */
41555
+ TransactionBody.create = function create(properties) {
41556
+ return new TransactionBody(properties);
41557
+ };
41558
+
41559
+ /**
41560
+ * Encodes the specified TransactionBody message. Does not implicitly {@link TW.Hedera.Proto.TransactionBody.verify|verify} messages.
41561
+ * @function encode
41562
+ * @memberof TW.Hedera.Proto.TransactionBody
41563
+ * @static
41564
+ * @param {TW.Hedera.Proto.ITransactionBody} message TransactionBody message or plain object to encode
41565
+ * @param {$protobuf.Writer} [writer] Writer to encode to
41566
+ * @returns {$protobuf.Writer} Writer
41567
+ */
41568
+ TransactionBody.encode = function encode(message, writer) {
41569
+ if (!writer)
41570
+ writer = $Writer.create();
41571
+ if (message.transactionID != null && Object.hasOwnProperty.call(message, "transactionID"))
41572
+ $root.TW.Hedera.Proto.TransactionID.encode(message.transactionID, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
41573
+ if (message.nodeAccountID != null && Object.hasOwnProperty.call(message, "nodeAccountID"))
41574
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.nodeAccountID);
41575
+ if (message.transactionFee != null && Object.hasOwnProperty.call(message, "transactionFee"))
41576
+ writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.transactionFee);
41577
+ if (message.transactionValidDuration != null && Object.hasOwnProperty.call(message, "transactionValidDuration"))
41578
+ writer.uint32(/* id 4, wireType 0 =*/32).int64(message.transactionValidDuration);
41579
+ if (message.memo != null && Object.hasOwnProperty.call(message, "memo"))
41580
+ writer.uint32(/* id 5, wireType 2 =*/42).string(message.memo);
41581
+ if (message.transfer != null && Object.hasOwnProperty.call(message, "transfer"))
41582
+ $root.TW.Hedera.Proto.TransferMessage.encode(message.transfer, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim();
41583
+ return writer;
41584
+ };
41585
+
41586
+ /**
41587
+ * Decodes a TransactionBody message from the specified reader or buffer.
41588
+ * @function decode
41589
+ * @memberof TW.Hedera.Proto.TransactionBody
41590
+ * @static
41591
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
41592
+ * @param {number} [length] Message length if known beforehand
41593
+ * @returns {TW.Hedera.Proto.TransactionBody} TransactionBody
41594
+ * @throws {Error} If the payload is not a reader or valid buffer
41595
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
41596
+ */
41597
+ TransactionBody.decode = function decode(reader, length) {
41598
+ if (!(reader instanceof $Reader))
41599
+ reader = $Reader.create(reader);
41600
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Hedera.Proto.TransactionBody();
41601
+ while (reader.pos < end) {
41602
+ var tag = reader.uint32();
41603
+ switch (tag >>> 3) {
41604
+ case 1:
41605
+ message.transactionID = $root.TW.Hedera.Proto.TransactionID.decode(reader, reader.uint32());
41606
+ break;
41607
+ case 2:
41608
+ message.nodeAccountID = reader.string();
41609
+ break;
41610
+ case 3:
41611
+ message.transactionFee = reader.uint64();
41612
+ break;
41613
+ case 4:
41614
+ message.transactionValidDuration = reader.int64();
41615
+ break;
41616
+ case 5:
41617
+ message.memo = reader.string();
41618
+ break;
41619
+ case 6:
41620
+ message.transfer = $root.TW.Hedera.Proto.TransferMessage.decode(reader, reader.uint32());
41621
+ break;
41622
+ default:
41623
+ reader.skipType(tag & 7);
41624
+ break;
41625
+ }
41626
+ }
41627
+ return message;
41628
+ };
41629
+
41630
+ /**
41631
+ * Verifies a TransactionBody message.
41632
+ * @function verify
41633
+ * @memberof TW.Hedera.Proto.TransactionBody
41634
+ * @static
41635
+ * @param {Object.<string,*>} message Plain object to verify
41636
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
41637
+ */
41638
+ TransactionBody.verify = function verify(message) {
41639
+ if (typeof message !== "object" || message === null)
41640
+ return "object expected";
41641
+ var properties = {};
41642
+ if (message.transactionID != null && message.hasOwnProperty("transactionID")) {
41643
+ var error = $root.TW.Hedera.Proto.TransactionID.verify(message.transactionID);
41644
+ if (error)
41645
+ return "transactionID." + error;
41646
+ }
41647
+ if (message.nodeAccountID != null && message.hasOwnProperty("nodeAccountID"))
41648
+ if (!$util.isString(message.nodeAccountID))
41649
+ return "nodeAccountID: string expected";
41650
+ if (message.transactionFee != null && message.hasOwnProperty("transactionFee"))
41651
+ if (!$util.isInteger(message.transactionFee) && !(message.transactionFee && $util.isInteger(message.transactionFee.low) && $util.isInteger(message.transactionFee.high)))
41652
+ return "transactionFee: integer|Long expected";
41653
+ if (message.transactionValidDuration != null && message.hasOwnProperty("transactionValidDuration"))
41654
+ if (!$util.isInteger(message.transactionValidDuration) && !(message.transactionValidDuration && $util.isInteger(message.transactionValidDuration.low) && $util.isInteger(message.transactionValidDuration.high)))
41655
+ return "transactionValidDuration: integer|Long expected";
41656
+ if (message.memo != null && message.hasOwnProperty("memo"))
41657
+ if (!$util.isString(message.memo))
41658
+ return "memo: string expected";
41659
+ if (message.transfer != null && message.hasOwnProperty("transfer")) {
41660
+ properties.data = 1;
41661
+ {
41662
+ var error = $root.TW.Hedera.Proto.TransferMessage.verify(message.transfer);
41663
+ if (error)
41664
+ return "transfer." + error;
41665
+ }
41666
+ }
41667
+ return null;
41668
+ };
41669
+
41670
+ /**
41671
+ * Creates a TransactionBody message from a plain object. Also converts values to their respective internal types.
41672
+ * @function fromObject
41673
+ * @memberof TW.Hedera.Proto.TransactionBody
41674
+ * @static
41675
+ * @param {Object.<string,*>} object Plain object
41676
+ * @returns {TW.Hedera.Proto.TransactionBody} TransactionBody
41677
+ */
41678
+ TransactionBody.fromObject = function fromObject(object) {
41679
+ if (object instanceof $root.TW.Hedera.Proto.TransactionBody)
41680
+ return object;
41681
+ var message = new $root.TW.Hedera.Proto.TransactionBody();
41682
+ if (object.transactionID != null) {
41683
+ if (typeof object.transactionID !== "object")
41684
+ throw TypeError(".TW.Hedera.Proto.TransactionBody.transactionID: object expected");
41685
+ message.transactionID = $root.TW.Hedera.Proto.TransactionID.fromObject(object.transactionID);
41686
+ }
41687
+ if (object.nodeAccountID != null)
41688
+ message.nodeAccountID = String(object.nodeAccountID);
41689
+ if (object.transactionFee != null)
41690
+ if ($util.Long)
41691
+ (message.transactionFee = $util.Long.fromValue(object.transactionFee)).unsigned = true;
41692
+ else if (typeof object.transactionFee === "string")
41693
+ message.transactionFee = parseInt(object.transactionFee, 10);
41694
+ else if (typeof object.transactionFee === "number")
41695
+ message.transactionFee = object.transactionFee;
41696
+ else if (typeof object.transactionFee === "object")
41697
+ message.transactionFee = new $util.LongBits(object.transactionFee.low >>> 0, object.transactionFee.high >>> 0).toNumber(true);
41698
+ if (object.transactionValidDuration != null)
41699
+ if ($util.Long)
41700
+ (message.transactionValidDuration = $util.Long.fromValue(object.transactionValidDuration)).unsigned = false;
41701
+ else if (typeof object.transactionValidDuration === "string")
41702
+ message.transactionValidDuration = parseInt(object.transactionValidDuration, 10);
41703
+ else if (typeof object.transactionValidDuration === "number")
41704
+ message.transactionValidDuration = object.transactionValidDuration;
41705
+ else if (typeof object.transactionValidDuration === "object")
41706
+ message.transactionValidDuration = new $util.LongBits(object.transactionValidDuration.low >>> 0, object.transactionValidDuration.high >>> 0).toNumber();
41707
+ if (object.memo != null)
41708
+ message.memo = String(object.memo);
41709
+ if (object.transfer != null) {
41710
+ if (typeof object.transfer !== "object")
41711
+ throw TypeError(".TW.Hedera.Proto.TransactionBody.transfer: object expected");
41712
+ message.transfer = $root.TW.Hedera.Proto.TransferMessage.fromObject(object.transfer);
41713
+ }
41714
+ return message;
41715
+ };
41716
+
41717
+ /**
41718
+ * Creates a plain object from a TransactionBody message. Also converts values to other types if specified.
41719
+ * @function toObject
41720
+ * @memberof TW.Hedera.Proto.TransactionBody
41721
+ * @static
41722
+ * @param {TW.Hedera.Proto.TransactionBody} message TransactionBody
41723
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
41724
+ * @returns {Object.<string,*>} Plain object
41725
+ */
41726
+ TransactionBody.toObject = function toObject(message, options) {
41727
+ if (!options)
41728
+ options = {};
41729
+ var object = {};
41730
+ if (options.defaults) {
41731
+ object.transactionID = null;
41732
+ object.nodeAccountID = "";
41733
+ if ($util.Long) {
41734
+ var long = new $util.Long(0, 0, true);
41735
+ object.transactionFee = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
41736
+ } else
41737
+ object.transactionFee = options.longs === String ? "0" : 0;
41738
+ if ($util.Long) {
41739
+ var long = new $util.Long(0, 0, false);
41740
+ object.transactionValidDuration = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
41741
+ } else
41742
+ object.transactionValidDuration = options.longs === String ? "0" : 0;
41743
+ object.memo = "";
41744
+ }
41745
+ if (message.transactionID != null && message.hasOwnProperty("transactionID"))
41746
+ object.transactionID = $root.TW.Hedera.Proto.TransactionID.toObject(message.transactionID, options);
41747
+ if (message.nodeAccountID != null && message.hasOwnProperty("nodeAccountID"))
41748
+ object.nodeAccountID = message.nodeAccountID;
41749
+ if (message.transactionFee != null && message.hasOwnProperty("transactionFee"))
41750
+ if (typeof message.transactionFee === "number")
41751
+ object.transactionFee = options.longs === String ? String(message.transactionFee) : message.transactionFee;
41752
+ else
41753
+ object.transactionFee = options.longs === String ? $util.Long.prototype.toString.call(message.transactionFee) : options.longs === Number ? new $util.LongBits(message.transactionFee.low >>> 0, message.transactionFee.high >>> 0).toNumber(true) : message.transactionFee;
41754
+ if (message.transactionValidDuration != null && message.hasOwnProperty("transactionValidDuration"))
41755
+ if (typeof message.transactionValidDuration === "number")
41756
+ object.transactionValidDuration = options.longs === String ? String(message.transactionValidDuration) : message.transactionValidDuration;
41757
+ else
41758
+ object.transactionValidDuration = options.longs === String ? $util.Long.prototype.toString.call(message.transactionValidDuration) : options.longs === Number ? new $util.LongBits(message.transactionValidDuration.low >>> 0, message.transactionValidDuration.high >>> 0).toNumber() : message.transactionValidDuration;
41759
+ if (message.memo != null && message.hasOwnProperty("memo"))
41760
+ object.memo = message.memo;
41761
+ if (message.transfer != null && message.hasOwnProperty("transfer")) {
41762
+ object.transfer = $root.TW.Hedera.Proto.TransferMessage.toObject(message.transfer, options);
41763
+ if (options.oneofs)
41764
+ object.data = "transfer";
41765
+ }
41766
+ return object;
41767
+ };
41768
+
41769
+ /**
41770
+ * Converts this TransactionBody to JSON.
41771
+ * @function toJSON
41772
+ * @memberof TW.Hedera.Proto.TransactionBody
41773
+ * @instance
41774
+ * @returns {Object.<string,*>} JSON object
41775
+ */
41776
+ TransactionBody.prototype.toJSON = function toJSON() {
41777
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
41778
+ };
41779
+
41780
+ return TransactionBody;
41781
+ })();
41782
+
41783
+ Proto.SigningInput = (function() {
41784
+
41785
+ /**
41786
+ * Properties of a SigningInput.
41787
+ * @memberof TW.Hedera.Proto
41788
+ * @interface ISigningInput
41789
+ * @property {Uint8Array|null} [privateKey] SigningInput privateKey
41790
+ * @property {TW.Hedera.Proto.ITransactionBody|null} [body] SigningInput body
41791
+ */
41792
+
41793
+ /**
41794
+ * Constructs a new SigningInput.
41795
+ * @memberof TW.Hedera.Proto
41796
+ * @classdesc Represents a SigningInput.
41797
+ * @implements ISigningInput
41798
+ * @constructor
41799
+ * @param {TW.Hedera.Proto.ISigningInput=} [properties] Properties to set
41800
+ */
41801
+ function SigningInput(properties) {
41802
+ if (properties)
41803
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
41804
+ if (properties[keys[i]] != null)
41805
+ this[keys[i]] = properties[keys[i]];
41806
+ }
41807
+
41808
+ /**
41809
+ * SigningInput privateKey.
41810
+ * @member {Uint8Array} privateKey
41811
+ * @memberof TW.Hedera.Proto.SigningInput
41812
+ * @instance
41813
+ */
41814
+ SigningInput.prototype.privateKey = $util.newBuffer([]);
41815
+
41816
+ /**
41817
+ * SigningInput body.
41818
+ * @member {TW.Hedera.Proto.ITransactionBody|null|undefined} body
41819
+ * @memberof TW.Hedera.Proto.SigningInput
41820
+ * @instance
41821
+ */
41822
+ SigningInput.prototype.body = null;
41823
+
41824
+ /**
41825
+ * Creates a new SigningInput instance using the specified properties.
41826
+ * @function create
41827
+ * @memberof TW.Hedera.Proto.SigningInput
41828
+ * @static
41829
+ * @param {TW.Hedera.Proto.ISigningInput=} [properties] Properties to set
41830
+ * @returns {TW.Hedera.Proto.SigningInput} SigningInput instance
41831
+ */
41832
+ SigningInput.create = function create(properties) {
41833
+ return new SigningInput(properties);
41834
+ };
41835
+
41836
+ /**
41837
+ * Encodes the specified SigningInput message. Does not implicitly {@link TW.Hedera.Proto.SigningInput.verify|verify} messages.
41838
+ * @function encode
41839
+ * @memberof TW.Hedera.Proto.SigningInput
41840
+ * @static
41841
+ * @param {TW.Hedera.Proto.ISigningInput} message SigningInput message or plain object to encode
41842
+ * @param {$protobuf.Writer} [writer] Writer to encode to
41843
+ * @returns {$protobuf.Writer} Writer
41844
+ */
41845
+ SigningInput.encode = function encode(message, writer) {
41846
+ if (!writer)
41847
+ writer = $Writer.create();
41848
+ if (message.privateKey != null && Object.hasOwnProperty.call(message, "privateKey"))
41849
+ writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.privateKey);
41850
+ if (message.body != null && Object.hasOwnProperty.call(message, "body"))
41851
+ $root.TW.Hedera.Proto.TransactionBody.encode(message.body, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
41852
+ return writer;
41853
+ };
41854
+
41855
+ /**
41856
+ * Decodes a SigningInput message from the specified reader or buffer.
41857
+ * @function decode
41858
+ * @memberof TW.Hedera.Proto.SigningInput
41859
+ * @static
41860
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
41861
+ * @param {number} [length] Message length if known beforehand
41862
+ * @returns {TW.Hedera.Proto.SigningInput} SigningInput
41863
+ * @throws {Error} If the payload is not a reader or valid buffer
41864
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
41865
+ */
41866
+ SigningInput.decode = function decode(reader, length) {
41867
+ if (!(reader instanceof $Reader))
41868
+ reader = $Reader.create(reader);
41869
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Hedera.Proto.SigningInput();
41870
+ while (reader.pos < end) {
41871
+ var tag = reader.uint32();
41872
+ switch (tag >>> 3) {
41873
+ case 1:
41874
+ message.privateKey = reader.bytes();
41875
+ break;
41876
+ case 2:
41877
+ message.body = $root.TW.Hedera.Proto.TransactionBody.decode(reader, reader.uint32());
41878
+ break;
41879
+ default:
41880
+ reader.skipType(tag & 7);
41881
+ break;
41882
+ }
41883
+ }
41884
+ return message;
41885
+ };
41886
+
41887
+ /**
41888
+ * Verifies a SigningInput message.
41889
+ * @function verify
41890
+ * @memberof TW.Hedera.Proto.SigningInput
41891
+ * @static
41892
+ * @param {Object.<string,*>} message Plain object to verify
41893
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
41894
+ */
41895
+ SigningInput.verify = function verify(message) {
41896
+ if (typeof message !== "object" || message === null)
41897
+ return "object expected";
41898
+ if (message.privateKey != null && message.hasOwnProperty("privateKey"))
41899
+ if (!(message.privateKey && typeof message.privateKey.length === "number" || $util.isString(message.privateKey)))
41900
+ return "privateKey: buffer expected";
41901
+ if (message.body != null && message.hasOwnProperty("body")) {
41902
+ var error = $root.TW.Hedera.Proto.TransactionBody.verify(message.body);
41903
+ if (error)
41904
+ return "body." + error;
41905
+ }
41906
+ return null;
41907
+ };
41908
+
41909
+ /**
41910
+ * Creates a SigningInput message from a plain object. Also converts values to their respective internal types.
41911
+ * @function fromObject
41912
+ * @memberof TW.Hedera.Proto.SigningInput
41913
+ * @static
41914
+ * @param {Object.<string,*>} object Plain object
41915
+ * @returns {TW.Hedera.Proto.SigningInput} SigningInput
41916
+ */
41917
+ SigningInput.fromObject = function fromObject(object) {
41918
+ if (object instanceof $root.TW.Hedera.Proto.SigningInput)
41919
+ return object;
41920
+ var message = new $root.TW.Hedera.Proto.SigningInput();
41921
+ if (object.privateKey != null)
41922
+ if (typeof object.privateKey === "string")
41923
+ $util.base64.decode(object.privateKey, message.privateKey = $util.newBuffer($util.base64.length(object.privateKey)), 0);
41924
+ else if (object.privateKey.length)
41925
+ message.privateKey = object.privateKey;
41926
+ if (object.body != null) {
41927
+ if (typeof object.body !== "object")
41928
+ throw TypeError(".TW.Hedera.Proto.SigningInput.body: object expected");
41929
+ message.body = $root.TW.Hedera.Proto.TransactionBody.fromObject(object.body);
41930
+ }
41931
+ return message;
41932
+ };
41933
+
41934
+ /**
41935
+ * Creates a plain object from a SigningInput message. Also converts values to other types if specified.
41936
+ * @function toObject
41937
+ * @memberof TW.Hedera.Proto.SigningInput
41938
+ * @static
41939
+ * @param {TW.Hedera.Proto.SigningInput} message SigningInput
41940
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
41941
+ * @returns {Object.<string,*>} Plain object
41942
+ */
41943
+ SigningInput.toObject = function toObject(message, options) {
41944
+ if (!options)
41945
+ options = {};
41946
+ var object = {};
41947
+ if (options.defaults) {
41948
+ if (options.bytes === String)
41949
+ object.privateKey = "";
41950
+ else {
41951
+ object.privateKey = [];
41952
+ if (options.bytes !== Array)
41953
+ object.privateKey = $util.newBuffer(object.privateKey);
41954
+ }
41955
+ object.body = null;
41956
+ }
41957
+ if (message.privateKey != null && message.hasOwnProperty("privateKey"))
41958
+ 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;
41959
+ if (message.body != null && message.hasOwnProperty("body"))
41960
+ object.body = $root.TW.Hedera.Proto.TransactionBody.toObject(message.body, options);
41961
+ return object;
41962
+ };
41963
+
41964
+ /**
41965
+ * Converts this SigningInput to JSON.
41966
+ * @function toJSON
41967
+ * @memberof TW.Hedera.Proto.SigningInput
41968
+ * @instance
41969
+ * @returns {Object.<string,*>} JSON object
41970
+ */
41971
+ SigningInput.prototype.toJSON = function toJSON() {
41972
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
41973
+ };
41974
+
41975
+ return SigningInput;
41976
+ })();
41977
+
41978
+ Proto.SigningOutput = (function() {
41979
+
41980
+ /**
41981
+ * Properties of a SigningOutput.
41982
+ * @memberof TW.Hedera.Proto
41983
+ * @interface ISigningOutput
41984
+ * @property {Uint8Array|null} [encoded] SigningOutput encoded
41985
+ */
41986
+
41987
+ /**
41988
+ * Constructs a new SigningOutput.
41989
+ * @memberof TW.Hedera.Proto
41990
+ * @classdesc Represents a SigningOutput.
41991
+ * @implements ISigningOutput
41992
+ * @constructor
41993
+ * @param {TW.Hedera.Proto.ISigningOutput=} [properties] Properties to set
41994
+ */
41995
+ function SigningOutput(properties) {
41996
+ if (properties)
41997
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
41998
+ if (properties[keys[i]] != null)
41999
+ this[keys[i]] = properties[keys[i]];
42000
+ }
42001
+
42002
+ /**
42003
+ * SigningOutput encoded.
42004
+ * @member {Uint8Array} encoded
42005
+ * @memberof TW.Hedera.Proto.SigningOutput
42006
+ * @instance
42007
+ */
42008
+ SigningOutput.prototype.encoded = $util.newBuffer([]);
42009
+
42010
+ /**
42011
+ * Creates a new SigningOutput instance using the specified properties.
42012
+ * @function create
42013
+ * @memberof TW.Hedera.Proto.SigningOutput
42014
+ * @static
42015
+ * @param {TW.Hedera.Proto.ISigningOutput=} [properties] Properties to set
42016
+ * @returns {TW.Hedera.Proto.SigningOutput} SigningOutput instance
42017
+ */
42018
+ SigningOutput.create = function create(properties) {
42019
+ return new SigningOutput(properties);
42020
+ };
42021
+
42022
+ /**
42023
+ * Encodes the specified SigningOutput message. Does not implicitly {@link TW.Hedera.Proto.SigningOutput.verify|verify} messages.
42024
+ * @function encode
42025
+ * @memberof TW.Hedera.Proto.SigningOutput
42026
+ * @static
42027
+ * @param {TW.Hedera.Proto.ISigningOutput} message SigningOutput message or plain object to encode
42028
+ * @param {$protobuf.Writer} [writer] Writer to encode to
42029
+ * @returns {$protobuf.Writer} Writer
42030
+ */
42031
+ SigningOutput.encode = function encode(message, writer) {
42032
+ if (!writer)
42033
+ writer = $Writer.create();
42034
+ if (message.encoded != null && Object.hasOwnProperty.call(message, "encoded"))
42035
+ writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.encoded);
42036
+ return writer;
42037
+ };
42038
+
42039
+ /**
42040
+ * Decodes a SigningOutput message from the specified reader or buffer.
42041
+ * @function decode
42042
+ * @memberof TW.Hedera.Proto.SigningOutput
42043
+ * @static
42044
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
42045
+ * @param {number} [length] Message length if known beforehand
42046
+ * @returns {TW.Hedera.Proto.SigningOutput} SigningOutput
42047
+ * @throws {Error} If the payload is not a reader or valid buffer
42048
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
42049
+ */
42050
+ SigningOutput.decode = function decode(reader, length) {
42051
+ if (!(reader instanceof $Reader))
42052
+ reader = $Reader.create(reader);
42053
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Hedera.Proto.SigningOutput();
42054
+ while (reader.pos < end) {
42055
+ var tag = reader.uint32();
42056
+ switch (tag >>> 3) {
42057
+ case 1:
42058
+ message.encoded = reader.bytes();
42059
+ break;
42060
+ default:
42061
+ reader.skipType(tag & 7);
42062
+ break;
42063
+ }
42064
+ }
42065
+ return message;
42066
+ };
42067
+
42068
+ /**
42069
+ * Verifies a SigningOutput message.
42070
+ * @function verify
42071
+ * @memberof TW.Hedera.Proto.SigningOutput
42072
+ * @static
42073
+ * @param {Object.<string,*>} message Plain object to verify
42074
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
42075
+ */
42076
+ SigningOutput.verify = function verify(message) {
42077
+ if (typeof message !== "object" || message === null)
42078
+ return "object expected";
42079
+ if (message.encoded != null && message.hasOwnProperty("encoded"))
42080
+ if (!(message.encoded && typeof message.encoded.length === "number" || $util.isString(message.encoded)))
42081
+ return "encoded: buffer expected";
42082
+ return null;
42083
+ };
42084
+
42085
+ /**
42086
+ * Creates a SigningOutput message from a plain object. Also converts values to their respective internal types.
42087
+ * @function fromObject
42088
+ * @memberof TW.Hedera.Proto.SigningOutput
42089
+ * @static
42090
+ * @param {Object.<string,*>} object Plain object
42091
+ * @returns {TW.Hedera.Proto.SigningOutput} SigningOutput
42092
+ */
42093
+ SigningOutput.fromObject = function fromObject(object) {
42094
+ if (object instanceof $root.TW.Hedera.Proto.SigningOutput)
42095
+ return object;
42096
+ var message = new $root.TW.Hedera.Proto.SigningOutput();
42097
+ if (object.encoded != null)
42098
+ if (typeof object.encoded === "string")
42099
+ $util.base64.decode(object.encoded, message.encoded = $util.newBuffer($util.base64.length(object.encoded)), 0);
42100
+ else if (object.encoded.length)
42101
+ message.encoded = object.encoded;
42102
+ return message;
42103
+ };
42104
+
42105
+ /**
42106
+ * Creates a plain object from a SigningOutput message. Also converts values to other types if specified.
42107
+ * @function toObject
42108
+ * @memberof TW.Hedera.Proto.SigningOutput
42109
+ * @static
42110
+ * @param {TW.Hedera.Proto.SigningOutput} message SigningOutput
42111
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
42112
+ * @returns {Object.<string,*>} Plain object
42113
+ */
42114
+ SigningOutput.toObject = function toObject(message, options) {
42115
+ if (!options)
42116
+ options = {};
42117
+ var object = {};
42118
+ if (options.defaults)
42119
+ if (options.bytes === String)
42120
+ object.encoded = "";
42121
+ else {
42122
+ object.encoded = [];
42123
+ if (options.bytes !== Array)
42124
+ object.encoded = $util.newBuffer(object.encoded);
42125
+ }
42126
+ if (message.encoded != null && message.hasOwnProperty("encoded"))
42127
+ 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;
42128
+ return object;
42129
+ };
42130
+
42131
+ /**
42132
+ * Converts this SigningOutput to JSON.
42133
+ * @function toJSON
42134
+ * @memberof TW.Hedera.Proto.SigningOutput
42135
+ * @instance
42136
+ * @returns {Object.<string,*>} JSON object
42137
+ */
42138
+ SigningOutput.prototype.toJSON = function toJSON() {
42139
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
42140
+ };
42141
+
42142
+ return SigningOutput;
42143
+ })();
42144
+
42145
+ return Proto;
42146
+ })();
42147
+
42148
+ return Hedera;
42149
+ })();
42150
+
40796
42151
  TW.Icon = (function() {
40797
42152
 
40798
42153
  /**
@@ -73569,6 +74924,9 @@
73569
74924
  * @property {string|null} [routerAddress] SwapInput routerAddress
73570
74925
  * @property {string|null} [fromAmount] SwapInput fromAmount
73571
74926
  * @property {string|null} [toAmountLimit] SwapInput toAmountLimit
74927
+ * @property {string|null} [affiliateFeeAddress] SwapInput affiliateFeeAddress
74928
+ * @property {string|null} [affiliateFeeRateBp] SwapInput affiliateFeeRateBp
74929
+ * @property {string|null} [extraMemo] SwapInput extraMemo
73572
74930
  */
73573
74931
 
73574
74932
  /**
@@ -73650,6 +75008,30 @@
73650
75008
  */
73651
75009
  SwapInput.prototype.toAmountLimit = "";
73652
75010
 
75011
+ /**
75012
+ * SwapInput affiliateFeeAddress.
75013
+ * @member {string} affiliateFeeAddress
75014
+ * @memberof TW.THORChainSwap.Proto.SwapInput
75015
+ * @instance
75016
+ */
75017
+ SwapInput.prototype.affiliateFeeAddress = "";
75018
+
75019
+ /**
75020
+ * SwapInput affiliateFeeRateBp.
75021
+ * @member {string} affiliateFeeRateBp
75022
+ * @memberof TW.THORChainSwap.Proto.SwapInput
75023
+ * @instance
75024
+ */
75025
+ SwapInput.prototype.affiliateFeeRateBp = "";
75026
+
75027
+ /**
75028
+ * SwapInput extraMemo.
75029
+ * @member {string} extraMemo
75030
+ * @memberof TW.THORChainSwap.Proto.SwapInput
75031
+ * @instance
75032
+ */
75033
+ SwapInput.prototype.extraMemo = "";
75034
+
73653
75035
  /**
73654
75036
  * Creates a new SwapInput instance using the specified properties.
73655
75037
  * @function create
@@ -73690,6 +75072,12 @@
73690
75072
  writer.uint32(/* id 7, wireType 2 =*/58).string(message.fromAmount);
73691
75073
  if (message.toAmountLimit != null && Object.hasOwnProperty.call(message, "toAmountLimit"))
73692
75074
  writer.uint32(/* id 8, wireType 2 =*/66).string(message.toAmountLimit);
75075
+ if (message.affiliateFeeAddress != null && Object.hasOwnProperty.call(message, "affiliateFeeAddress"))
75076
+ writer.uint32(/* id 9, wireType 2 =*/74).string(message.affiliateFeeAddress);
75077
+ if (message.affiliateFeeRateBp != null && Object.hasOwnProperty.call(message, "affiliateFeeRateBp"))
75078
+ writer.uint32(/* id 10, wireType 2 =*/82).string(message.affiliateFeeRateBp);
75079
+ if (message.extraMemo != null && Object.hasOwnProperty.call(message, "extraMemo"))
75080
+ writer.uint32(/* id 11, wireType 2 =*/90).string(message.extraMemo);
73693
75081
  return writer;
73694
75082
  };
73695
75083
 
@@ -73735,6 +75123,15 @@
73735
75123
  case 8:
73736
75124
  message.toAmountLimit = reader.string();
73737
75125
  break;
75126
+ case 9:
75127
+ message.affiliateFeeAddress = reader.string();
75128
+ break;
75129
+ case 10:
75130
+ message.affiliateFeeRateBp = reader.string();
75131
+ break;
75132
+ case 11:
75133
+ message.extraMemo = reader.string();
75134
+ break;
73738
75135
  default:
73739
75136
  reader.skipType(tag & 7);
73740
75137
  break;
@@ -73787,6 +75184,15 @@
73787
75184
  if (message.toAmountLimit != null && message.hasOwnProperty("toAmountLimit"))
73788
75185
  if (!$util.isString(message.toAmountLimit))
73789
75186
  return "toAmountLimit: string expected";
75187
+ if (message.affiliateFeeAddress != null && message.hasOwnProperty("affiliateFeeAddress"))
75188
+ if (!$util.isString(message.affiliateFeeAddress))
75189
+ return "affiliateFeeAddress: string expected";
75190
+ if (message.affiliateFeeRateBp != null && message.hasOwnProperty("affiliateFeeRateBp"))
75191
+ if (!$util.isString(message.affiliateFeeRateBp))
75192
+ return "affiliateFeeRateBp: string expected";
75193
+ if (message.extraMemo != null && message.hasOwnProperty("extraMemo"))
75194
+ if (!$util.isString(message.extraMemo))
75195
+ return "extraMemo: string expected";
73790
75196
  return null;
73791
75197
  };
73792
75198
 
@@ -73837,6 +75243,12 @@
73837
75243
  message.fromAmount = String(object.fromAmount);
73838
75244
  if (object.toAmountLimit != null)
73839
75245
  message.toAmountLimit = String(object.toAmountLimit);
75246
+ if (object.affiliateFeeAddress != null)
75247
+ message.affiliateFeeAddress = String(object.affiliateFeeAddress);
75248
+ if (object.affiliateFeeRateBp != null)
75249
+ message.affiliateFeeRateBp = String(object.affiliateFeeRateBp);
75250
+ if (object.extraMemo != null)
75251
+ message.extraMemo = String(object.extraMemo);
73840
75252
  return message;
73841
75253
  };
73842
75254
 
@@ -73862,6 +75274,9 @@
73862
75274
  object.routerAddress = "";
73863
75275
  object.fromAmount = "";
73864
75276
  object.toAmountLimit = "";
75277
+ object.affiliateFeeAddress = "";
75278
+ object.affiliateFeeRateBp = "";
75279
+ object.extraMemo = "";
73865
75280
  }
73866
75281
  if (message.fromChain != null && message.hasOwnProperty("fromChain"))
73867
75282
  object.fromChain = options.enums === String ? $root.TW.THORChainSwap.Proto.Chain[message.fromChain] : message.fromChain;
@@ -73879,6 +75294,12 @@
73879
75294
  object.fromAmount = message.fromAmount;
73880
75295
  if (message.toAmountLimit != null && message.hasOwnProperty("toAmountLimit"))
73881
75296
  object.toAmountLimit = message.toAmountLimit;
75297
+ if (message.affiliateFeeAddress != null && message.hasOwnProperty("affiliateFeeAddress"))
75298
+ object.affiliateFeeAddress = message.affiliateFeeAddress;
75299
+ if (message.affiliateFeeRateBp != null && message.hasOwnProperty("affiliateFeeRateBp"))
75300
+ object.affiliateFeeRateBp = message.affiliateFeeRateBp;
75301
+ if (message.extraMemo != null && message.hasOwnProperty("extraMemo"))
75302
+ object.extraMemo = message.extraMemo;
73882
75303
  return object;
73883
75304
  };
73884
75305