From 642b00a48e583e6d0c4072132296020834f7fc95 Mon Sep 17 00:00:00 2001 From: danielailie Date: Thu, 12 Dec 2024 10:20:19 +0200 Subject: [PATCH] Generate proto file --- src/proto/compiled.js | 671 ++++++++++++++++-------------------------- 1 file changed, 256 insertions(+), 415 deletions(-) diff --git a/src/proto/compiled.js b/src/proto/compiled.js index c0424d78..5677d707 100644 --- a/src/proto/compiled.js +++ b/src/proto/compiled.js @@ -1,30 +1,32 @@ /*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/ -(function (global, factory) { - /* global define, require, module */ +(function(global, factory) { /* global define, require, module */ - /* AMD */ if (typeof define === "function" && define.amd) define(["protobufjs/minimal"], factory); - /* CommonJS */ else if (typeof require === "function" && typeof module === "object" && module && module.exports) + /* AMD */ if (typeof define === 'function' && define.amd) + define(["protobufjs/minimal"], factory); + + /* CommonJS */ else if (typeof require === 'function' && typeof module === 'object' && module && module.exports) module.exports = factory(require("protobufjs/minimal")); -})(this, function ($protobuf) { + +})(this, function($protobuf) { "use strict"; // Common aliases - var $Reader = $protobuf.Reader, - $Writer = $protobuf.Writer, - $util = $protobuf.util; - + var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util; + // Exported root namespace var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {}); - - $root.proto = (function () { + + $root.proto = (function() { + /** * Namespace proto. * @exports proto * @namespace */ var proto = {}; - - proto.Transaction = (function () { + + proto.Transaction = (function() { + /** * Properties of a Transaction. * @memberof proto @@ -44,10 +46,10 @@ * @property {number|null} [Options] Transaction Options * @property {Uint8Array|null} [GuardianAddr] Transaction GuardianAddr * @property {Uint8Array|null} [GuardianSignature] Transaction GuardianSignature - * @property {Uint8Array|null} [Relayer] Transaction RelayerAddr + * @property {Uint8Array|null} [Relayer] Transaction Relayer * @property {Uint8Array|null} [RelayerSignature] Transaction RelayerSignature */ - + /** * Constructs a new Transaction. * @memberof proto @@ -59,17 +61,18 @@ function Transaction(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]]; + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; } - + /** * Transaction Nonce. * @member {number|Long} Nonce * @memberof proto.Transaction * @instance */ - Transaction.prototype.Nonce = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - + Transaction.prototype.Nonce = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + /** * Transaction Value. * @member {Uint8Array} Value @@ -77,7 +80,7 @@ * @instance */ Transaction.prototype.Value = $util.newBuffer([]); - + /** * Transaction RcvAddr. * @member {Uint8Array} RcvAddr @@ -85,7 +88,7 @@ * @instance */ Transaction.prototype.RcvAddr = $util.newBuffer([]); - + /** * Transaction RcvUserName. * @member {Uint8Array} RcvUserName @@ -93,7 +96,7 @@ * @instance */ Transaction.prototype.RcvUserName = $util.newBuffer([]); - + /** * Transaction SndAddr. * @member {Uint8Array} SndAddr @@ -101,7 +104,7 @@ * @instance */ Transaction.prototype.SndAddr = $util.newBuffer([]); - + /** * Transaction SndUserName. * @member {Uint8Array} SndUserName @@ -109,23 +112,23 @@ * @instance */ Transaction.prototype.SndUserName = $util.newBuffer([]); - + /** * Transaction GasPrice. * @member {number|Long} GasPrice * @memberof proto.Transaction * @instance */ - Transaction.prototype.GasPrice = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - + Transaction.prototype.GasPrice = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + /** * Transaction GasLimit. * @member {number|Long} GasLimit * @memberof proto.Transaction * @instance */ - Transaction.prototype.GasLimit = $util.Long ? $util.Long.fromBits(0, 0, true) : 0; - + Transaction.prototype.GasLimit = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + /** * Transaction Data. * @member {Uint8Array} Data @@ -133,7 +136,7 @@ * @instance */ Transaction.prototype.Data = $util.newBuffer([]); - + /** * Transaction ChainID. * @member {Uint8Array} ChainID @@ -141,7 +144,7 @@ * @instance */ Transaction.prototype.ChainID = $util.newBuffer([]); - + /** * Transaction Version. * @member {number} Version @@ -149,7 +152,7 @@ * @instance */ Transaction.prototype.Version = 0; - + /** * Transaction Signature. * @member {Uint8Array} Signature @@ -157,7 +160,7 @@ * @instance */ Transaction.prototype.Signature = $util.newBuffer([]); - + /** * Transaction Options. * @member {number} Options @@ -165,7 +168,7 @@ * @instance */ Transaction.prototype.Options = 0; - + /** * Transaction GuardianAddr. * @member {Uint8Array} GuardianAddr @@ -173,7 +176,7 @@ * @instance */ Transaction.prototype.GuardianAddr = $util.newBuffer([]); - + /** * Transaction GuardianSignature. * @member {Uint8Array} GuardianSignature @@ -181,14 +184,15 @@ * @instance */ Transaction.prototype.GuardianSignature = $util.newBuffer([]); - + /** * Transaction Relayer. * @member {Uint8Array} Relayer + * @memberof proto.Transaction * @instance */ Transaction.prototype.Relayer = $util.newBuffer([]); - + /** * Transaction RelayerSignature. * @member {Uint8Array} RelayerSignature @@ -196,7 +200,7 @@ * @instance */ Transaction.prototype.RelayerSignature = $util.newBuffer([]); - + /** * Creates a new Transaction instance using the specified properties. * @function create @@ -208,7 +212,7 @@ Transaction.create = function create(properties) { return new Transaction(properties); }; - + /** * Encodes the specified Transaction message. Does not implicitly {@link proto.Transaction.verify|verify} messages. * @function encode @@ -219,44 +223,45 @@ * @returns {$protobuf.Writer} Writer */ Transaction.encode = function encode(message, writer) { - if (!writer) writer = $Writer.create(); + if (!writer) + writer = $Writer.create(); if (message.Nonce != null && Object.hasOwnProperty.call(message, "Nonce")) - writer.uint32(/* id 1, wireType 0 =*/ 8).uint64(message.Nonce); + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.Nonce); if (message.Value != null && Object.hasOwnProperty.call(message, "Value")) - writer.uint32(/* id 2, wireType 2 =*/ 18).bytes(message.Value); + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.Value); if (message.RcvAddr != null && Object.hasOwnProperty.call(message, "RcvAddr")) - writer.uint32(/* id 3, wireType 2 =*/ 26).bytes(message.RcvAddr); + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.RcvAddr); if (message.RcvUserName != null && Object.hasOwnProperty.call(message, "RcvUserName")) - writer.uint32(/* id 4, wireType 2 =*/ 34).bytes(message.RcvUserName); + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.RcvUserName); if (message.SndAddr != null && Object.hasOwnProperty.call(message, "SndAddr")) - writer.uint32(/* id 5, wireType 2 =*/ 42).bytes(message.SndAddr); + writer.uint32(/* id 5, wireType 2 =*/42).bytes(message.SndAddr); if (message.SndUserName != null && Object.hasOwnProperty.call(message, "SndUserName")) - writer.uint32(/* id 6, wireType 2 =*/ 50).bytes(message.SndUserName); + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.SndUserName); if (message.GasPrice != null && Object.hasOwnProperty.call(message, "GasPrice")) - writer.uint32(/* id 7, wireType 0 =*/ 56).uint64(message.GasPrice); + writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.GasPrice); if (message.GasLimit != null && Object.hasOwnProperty.call(message, "GasLimit")) - writer.uint32(/* id 8, wireType 0 =*/ 64).uint64(message.GasLimit); + writer.uint32(/* id 8, wireType 0 =*/64).uint64(message.GasLimit); if (message.Data != null && Object.hasOwnProperty.call(message, "Data")) - writer.uint32(/* id 9, wireType 2 =*/ 74).bytes(message.Data); + writer.uint32(/* id 9, wireType 2 =*/74).bytes(message.Data); if (message.ChainID != null && Object.hasOwnProperty.call(message, "ChainID")) - writer.uint32(/* id 10, wireType 2 =*/ 82).bytes(message.ChainID); + writer.uint32(/* id 10, wireType 2 =*/82).bytes(message.ChainID); if (message.Version != null && Object.hasOwnProperty.call(message, "Version")) - writer.uint32(/* id 11, wireType 0 =*/ 88).uint32(message.Version); + writer.uint32(/* id 11, wireType 0 =*/88).uint32(message.Version); if (message.Signature != null && Object.hasOwnProperty.call(message, "Signature")) - writer.uint32(/* id 12, wireType 2 =*/ 98).bytes(message.Signature); + writer.uint32(/* id 12, wireType 2 =*/98).bytes(message.Signature); if (message.Options != null && Object.hasOwnProperty.call(message, "Options")) - writer.uint32(/* id 13, wireType 0 =*/ 104).uint32(message.Options); + writer.uint32(/* id 13, wireType 0 =*/104).uint32(message.Options); if (message.GuardianAddr != null && Object.hasOwnProperty.call(message, "GuardianAddr")) - writer.uint32(/* id 14, wireType 2 =*/ 114).bytes(message.GuardianAddr); + writer.uint32(/* id 14, wireType 2 =*/114).bytes(message.GuardianAddr); if (message.GuardianSignature != null && Object.hasOwnProperty.call(message, "GuardianSignature")) - writer.uint32(/* id 15, wireType 2 =*/ 122).bytes(message.GuardianSignature); + writer.uint32(/* id 15, wireType 2 =*/122).bytes(message.GuardianSignature); if (message.Relayer != null && Object.hasOwnProperty.call(message, "Relayer")) - writer.uint32(/* id 14, wireType 2 =*/ 114).bytes(message.Relayer); + writer.uint32(/* id 16, wireType 2 =*/130).bytes(message.Relayer); if (message.RelayerSignature != null && Object.hasOwnProperty.call(message, "RelayerSignature")) - writer.uint32(/* id 15, wireType 2 =*/ 122).bytes(message.RelayerSignature); + writer.uint32(/* id 17, wireType 2 =*/138).bytes(message.RelayerSignature); return writer; }; - + /** * Encodes the specified Transaction message, length delimited. Does not implicitly {@link proto.Transaction.verify|verify} messages. * @function encodeDelimited @@ -269,7 +274,7 @@ Transaction.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; - + /** * Decodes a Transaction message from the specified reader or buffer. * @function decode @@ -282,88 +287,88 @@ * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Transaction.decode = function decode(reader, length) { - if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, - message = new $root.proto.Transaction(); + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.proto.Transaction(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: { + case 1: { message.Nonce = reader.uint64(); break; } - case 2: { + case 2: { message.Value = reader.bytes(); break; } - case 3: { + case 3: { message.RcvAddr = reader.bytes(); break; } - case 4: { + case 4: { message.RcvUserName = reader.bytes(); break; } - case 5: { + case 5: { message.SndAddr = reader.bytes(); break; } - case 6: { + case 6: { message.SndUserName = reader.bytes(); break; } - case 7: { + case 7: { message.GasPrice = reader.uint64(); break; } - case 8: { + case 8: { message.GasLimit = reader.uint64(); break; } - case 9: { + case 9: { message.Data = reader.bytes(); break; } - case 10: { + case 10: { message.ChainID = reader.bytes(); break; } - case 11: { + case 11: { message.Version = reader.uint32(); break; } - case 12: { + case 12: { message.Signature = reader.bytes(); break; } - case 13: { + case 13: { message.Options = reader.uint32(); break; } - case 14: { + case 14: { message.GuardianAddr = reader.bytes(); break; } - case 15: { + case 15: { message.GuardianSignature = reader.bytes(); break; } - case 16: { + case 16: { message.Relayer = reader.bytes(); break; } - case 17: { + case 17: { message.RelayerSignature = reader.bytes(); break; } - default: - reader.skipType(tag & 7); - break; + default: + reader.skipType(tag & 7); + break; } } return message; }; - + /** * Decodes a Transaction message from the specified reader or buffer, length delimited. * @function decodeDelimited @@ -375,10 +380,11 @@ * @throws {$protobuf.util.ProtocolError} If required fields are missing */ Transaction.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) reader = new $Reader(reader); + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; - + /** * Verifies a Transaction message. * @function verify @@ -388,126 +394,62 @@ * @returns {string|null} `null` if valid, otherwise the reason why it is not */ Transaction.verify = function verify(message) { - if (typeof message !== "object" || message === null) return "object expected"; + if (typeof message !== "object" || message === null) + return "object expected"; if (message.Nonce != null && message.hasOwnProperty("Nonce")) - if ( - !$util.isInteger(message.Nonce) && - !(message.Nonce && $util.isInteger(message.Nonce.low) && $util.isInteger(message.Nonce.high)) - ) + if (!$util.isInteger(message.Nonce) && !(message.Nonce && $util.isInteger(message.Nonce.low) && $util.isInteger(message.Nonce.high))) return "Nonce: integer|Long expected"; if (message.Value != null && message.hasOwnProperty("Value")) - if (!((message.Value && typeof message.Value.length === "number") || $util.isString(message.Value))) + if (!(message.Value && typeof message.Value.length === "number" || $util.isString(message.Value))) return "Value: buffer expected"; if (message.RcvAddr != null && message.hasOwnProperty("RcvAddr")) - if ( - !( - (message.RcvAddr && typeof message.RcvAddr.length === "number") || - $util.isString(message.RcvAddr) - ) - ) + if (!(message.RcvAddr && typeof message.RcvAddr.length === "number" || $util.isString(message.RcvAddr))) return "RcvAddr: buffer expected"; if (message.RcvUserName != null && message.hasOwnProperty("RcvUserName")) - if ( - !( - (message.RcvUserName && typeof message.RcvUserName.length === "number") || - $util.isString(message.RcvUserName) - ) - ) + if (!(message.RcvUserName && typeof message.RcvUserName.length === "number" || $util.isString(message.RcvUserName))) return "RcvUserName: buffer expected"; if (message.SndAddr != null && message.hasOwnProperty("SndAddr")) - if ( - !( - (message.SndAddr && typeof message.SndAddr.length === "number") || - $util.isString(message.SndAddr) - ) - ) + if (!(message.SndAddr && typeof message.SndAddr.length === "number" || $util.isString(message.SndAddr))) return "SndAddr: buffer expected"; if (message.SndUserName != null && message.hasOwnProperty("SndUserName")) - if ( - !( - (message.SndUserName && typeof message.SndUserName.length === "number") || - $util.isString(message.SndUserName) - ) - ) + if (!(message.SndUserName && typeof message.SndUserName.length === "number" || $util.isString(message.SndUserName))) return "SndUserName: buffer expected"; if (message.GasPrice != null && message.hasOwnProperty("GasPrice")) - if ( - !$util.isInteger(message.GasPrice) && - !( - message.GasPrice && - $util.isInteger(message.GasPrice.low) && - $util.isInteger(message.GasPrice.high) - ) - ) + if (!$util.isInteger(message.GasPrice) && !(message.GasPrice && $util.isInteger(message.GasPrice.low) && $util.isInteger(message.GasPrice.high))) return "GasPrice: integer|Long expected"; if (message.GasLimit != null && message.hasOwnProperty("GasLimit")) - if ( - !$util.isInteger(message.GasLimit) && - !( - message.GasLimit && - $util.isInteger(message.GasLimit.low) && - $util.isInteger(message.GasLimit.high) - ) - ) + if (!$util.isInteger(message.GasLimit) && !(message.GasLimit && $util.isInteger(message.GasLimit.low) && $util.isInteger(message.GasLimit.high))) return "GasLimit: integer|Long expected"; if (message.Data != null && message.hasOwnProperty("Data")) - if (!((message.Data && typeof message.Data.length === "number") || $util.isString(message.Data))) + if (!(message.Data && typeof message.Data.length === "number" || $util.isString(message.Data))) return "Data: buffer expected"; if (message.ChainID != null && message.hasOwnProperty("ChainID")) - if ( - !( - (message.ChainID && typeof message.ChainID.length === "number") || - $util.isString(message.ChainID) - ) - ) + if (!(message.ChainID && typeof message.ChainID.length === "number" || $util.isString(message.ChainID))) return "ChainID: buffer expected"; if (message.Version != null && message.hasOwnProperty("Version")) - if (!$util.isInteger(message.Version)) return "Version: integer expected"; + if (!$util.isInteger(message.Version)) + return "Version: integer expected"; if (message.Signature != null && message.hasOwnProperty("Signature")) - if ( - !( - (message.Signature && typeof message.Signature.length === "number") || - $util.isString(message.Signature) - ) - ) + if (!(message.Signature && typeof message.Signature.length === "number" || $util.isString(message.Signature))) return "Signature: buffer expected"; if (message.Options != null && message.hasOwnProperty("Options")) - if (!$util.isInteger(message.Options)) return "Options: integer expected"; + if (!$util.isInteger(message.Options)) + return "Options: integer expected"; if (message.GuardianAddr != null && message.hasOwnProperty("GuardianAddr")) - if ( - !( - (message.GuardianAddr && typeof message.GuardianAddr.length === "number") || - $util.isString(message.GuardianAddr) - ) - ) + if (!(message.GuardianAddr && typeof message.GuardianAddr.length === "number" || $util.isString(message.GuardianAddr))) return "GuardianAddr: buffer expected"; if (message.GuardianSignature != null && message.hasOwnProperty("GuardianSignature")) - if ( - !( - (message.GuardianSignature && typeof message.GuardianSignature.length === "number") || - $util.isString(message.GuardianSignature) - ) - ) + if (!(message.GuardianSignature && typeof message.GuardianSignature.length === "number" || $util.isString(message.GuardianSignature))) return "GuardianSignature: buffer expected"; if (message.Relayer != null && message.hasOwnProperty("Relayer")) - if ( - !( - (message.Relayer && typeof message.Relayer.length === "number") || - $util.isString(message.Relayer) - ) - ) + if (!(message.Relayer && typeof message.Relayer.length === "number" || $util.isString(message.Relayer))) return "Relayer: buffer expected"; if (message.RelayerSignature != null && message.hasOwnProperty("RelayerSignature")) - if ( - !( - (message.RelayerSignature && typeof message.RelayerSignature.length === "number") || - $util.isString(message.RelayerSignature) - ) - ) + if (!(message.RelayerSignature && typeof message.RelayerSignature.length === "number" || $util.isString(message.RelayerSignature))) return "RelayerSignature: buffer expected"; return null; }; - + /** * Creates a Transaction message from a plain object. Also converts values to their respective internal types. * @function fromObject @@ -517,137 +459,103 @@ * @returns {proto.Transaction} Transaction */ Transaction.fromObject = function fromObject(object) { - if (object instanceof $root.proto.Transaction) return object; + if (object instanceof $root.proto.Transaction) + return object; var message = new $root.proto.Transaction(); if (object.Nonce != null) - if ($util.Long) (message.Nonce = $util.Long.fromValue(object.Nonce)).unsigned = true; - else if (typeof object.Nonce === "string") message.Nonce = parseInt(object.Nonce, 10); - else if (typeof object.Nonce === "number") message.Nonce = object.Nonce; + if ($util.Long) + (message.Nonce = $util.Long.fromValue(object.Nonce)).unsigned = true; + else if (typeof object.Nonce === "string") + message.Nonce = parseInt(object.Nonce, 10); + else if (typeof object.Nonce === "number") + message.Nonce = object.Nonce; else if (typeof object.Nonce === "object") - message.Nonce = new $util.LongBits(object.Nonce.low >>> 0, object.Nonce.high >>> 0).toNumber( - true, - ); + message.Nonce = new $util.LongBits(object.Nonce.low >>> 0, object.Nonce.high >>> 0).toNumber(true); if (object.Value != null) if (typeof object.Value === "string") - $util.base64.decode( - object.Value, - (message.Value = $util.newBuffer($util.base64.length(object.Value))), - 0, - ); - else if (object.Value.length >= 0) message.Value = object.Value; + $util.base64.decode(object.Value, message.Value = $util.newBuffer($util.base64.length(object.Value)), 0); + else if (object.Value.length >= 0) + message.Value = object.Value; if (object.RcvAddr != null) if (typeof object.RcvAddr === "string") - $util.base64.decode( - object.RcvAddr, - (message.RcvAddr = $util.newBuffer($util.base64.length(object.RcvAddr))), - 0, - ); - else if (object.RcvAddr.length >= 0) message.RcvAddr = object.RcvAddr; + $util.base64.decode(object.RcvAddr, message.RcvAddr = $util.newBuffer($util.base64.length(object.RcvAddr)), 0); + else if (object.RcvAddr.length >= 0) + message.RcvAddr = object.RcvAddr; if (object.RcvUserName != null) if (typeof object.RcvUserName === "string") - $util.base64.decode( - object.RcvUserName, - (message.RcvUserName = $util.newBuffer($util.base64.length(object.RcvUserName))), - 0, - ); - else if (object.RcvUserName.length >= 0) message.RcvUserName = object.RcvUserName; + $util.base64.decode(object.RcvUserName, message.RcvUserName = $util.newBuffer($util.base64.length(object.RcvUserName)), 0); + else if (object.RcvUserName.length >= 0) + message.RcvUserName = object.RcvUserName; if (object.SndAddr != null) if (typeof object.SndAddr === "string") - $util.base64.decode( - object.SndAddr, - (message.SndAddr = $util.newBuffer($util.base64.length(object.SndAddr))), - 0, - ); - else if (object.SndAddr.length >= 0) message.SndAddr = object.SndAddr; + $util.base64.decode(object.SndAddr, message.SndAddr = $util.newBuffer($util.base64.length(object.SndAddr)), 0); + else if (object.SndAddr.length >= 0) + message.SndAddr = object.SndAddr; if (object.SndUserName != null) if (typeof object.SndUserName === "string") - $util.base64.decode( - object.SndUserName, - (message.SndUserName = $util.newBuffer($util.base64.length(object.SndUserName))), - 0, - ); - else if (object.SndUserName.length >= 0) message.SndUserName = object.SndUserName; + $util.base64.decode(object.SndUserName, message.SndUserName = $util.newBuffer($util.base64.length(object.SndUserName)), 0); + else if (object.SndUserName.length >= 0) + message.SndUserName = object.SndUserName; if (object.GasPrice != null) - if ($util.Long) (message.GasPrice = $util.Long.fromValue(object.GasPrice)).unsigned = true; - else if (typeof object.GasPrice === "string") message.GasPrice = parseInt(object.GasPrice, 10); - else if (typeof object.GasPrice === "number") message.GasPrice = object.GasPrice; + if ($util.Long) + (message.GasPrice = $util.Long.fromValue(object.GasPrice)).unsigned = true; + else if (typeof object.GasPrice === "string") + message.GasPrice = parseInt(object.GasPrice, 10); + else if (typeof object.GasPrice === "number") + message.GasPrice = object.GasPrice; else if (typeof object.GasPrice === "object") - message.GasPrice = new $util.LongBits( - object.GasPrice.low >>> 0, - object.GasPrice.high >>> 0, - ).toNumber(true); + message.GasPrice = new $util.LongBits(object.GasPrice.low >>> 0, object.GasPrice.high >>> 0).toNumber(true); if (object.GasLimit != null) - if ($util.Long) (message.GasLimit = $util.Long.fromValue(object.GasLimit)).unsigned = true; - else if (typeof object.GasLimit === "string") message.GasLimit = parseInt(object.GasLimit, 10); - else if (typeof object.GasLimit === "number") message.GasLimit = object.GasLimit; + if ($util.Long) + (message.GasLimit = $util.Long.fromValue(object.GasLimit)).unsigned = true; + else if (typeof object.GasLimit === "string") + message.GasLimit = parseInt(object.GasLimit, 10); + else if (typeof object.GasLimit === "number") + message.GasLimit = object.GasLimit; else if (typeof object.GasLimit === "object") - message.GasLimit = new $util.LongBits( - object.GasLimit.low >>> 0, - object.GasLimit.high >>> 0, - ).toNumber(true); + message.GasLimit = new $util.LongBits(object.GasLimit.low >>> 0, object.GasLimit.high >>> 0).toNumber(true); if (object.Data != null) if (typeof object.Data === "string") - $util.base64.decode( - object.Data, - (message.Data = $util.newBuffer($util.base64.length(object.Data))), - 0, - ); - else if (object.Data.length >= 0) message.Data = object.Data; + $util.base64.decode(object.Data, message.Data = $util.newBuffer($util.base64.length(object.Data)), 0); + else if (object.Data.length >= 0) + message.Data = object.Data; if (object.ChainID != null) if (typeof object.ChainID === "string") - $util.base64.decode( - object.ChainID, - (message.ChainID = $util.newBuffer($util.base64.length(object.ChainID))), - 0, - ); - else if (object.ChainID.length >= 0) message.ChainID = object.ChainID; - if (object.Version != null) message.Version = object.Version >>> 0; + $util.base64.decode(object.ChainID, message.ChainID = $util.newBuffer($util.base64.length(object.ChainID)), 0); + else if (object.ChainID.length >= 0) + message.ChainID = object.ChainID; + if (object.Version != null) + message.Version = object.Version >>> 0; if (object.Signature != null) if (typeof object.Signature === "string") - $util.base64.decode( - object.Signature, - (message.Signature = $util.newBuffer($util.base64.length(object.Signature))), - 0, - ); - else if (object.Signature.length >= 0) message.Signature = object.Signature; - if (object.Options != null) message.Options = object.Options >>> 0; + $util.base64.decode(object.Signature, message.Signature = $util.newBuffer($util.base64.length(object.Signature)), 0); + else if (object.Signature.length >= 0) + message.Signature = object.Signature; + if (object.Options != null) + message.Options = object.Options >>> 0; if (object.GuardianAddr != null) if (typeof object.GuardianAddr === "string") - $util.base64.decode( - object.GuardianAddr, - (message.GuardianAddr = $util.newBuffer($util.base64.length(object.GuardianAddr))), - 0, - ); - else if (object.GuardianAddr.length >= 0) message.GuardianAddr = object.GuardianAddr; + $util.base64.decode(object.GuardianAddr, message.GuardianAddr = $util.newBuffer($util.base64.length(object.GuardianAddr)), 0); + else if (object.GuardianAddr.length >= 0) + message.GuardianAddr = object.GuardianAddr; if (object.GuardianSignature != null) if (typeof object.GuardianSignature === "string") - $util.base64.decode( - object.GuardianSignature, - (message.GuardianSignature = $util.newBuffer( - $util.base64.length(object.GuardianSignature), - )), - 0, - ); - else if (object.GuardianSignature.length >= 0) message.GuardianSignature = object.GuardianSignature; + $util.base64.decode(object.GuardianSignature, message.GuardianSignature = $util.newBuffer($util.base64.length(object.GuardianSignature)), 0); + else if (object.GuardianSignature.length >= 0) + message.GuardianSignature = object.GuardianSignature; if (object.Relayer != null) if (typeof object.Relayer === "string") - $util.base64.decode( - object.Relayer, - (message.Relayer = $util.newBuffer($util.base64.length(object.Relayer))), - 0, - ); - else if (object.Relayer.length >= 0) message.Relayer = object.Relayer; + $util.base64.decode(object.Relayer, message.Relayer = $util.newBuffer($util.base64.length(object.Relayer)), 0); + else if (object.Relayer.length >= 0) + message.Relayer = object.Relayer; if (object.RelayerSignature != null) if (typeof object.RelayerSignature === "string") - $util.base64.decode( - object.RelayerSignature, - (message.RelayerSignature = $util.newBuffer($util.base64.length(object.RelayerSignature))), - 0, - ); - else if (object.RelayerSignature.length >= 0) message.RelayerSignature = object.RelayerSignature; + $util.base64.decode(object.RelayerSignature, message.RelayerSignature = $util.newBuffer($util.base64.length(object.RelayerSignature)), 0); + else if (object.RelayerSignature.length >= 0) + message.RelayerSignature = object.RelayerSignature; return message; }; - + /** * Creates a plain object from a Transaction message. Also converts values to other types if specified. * @function toObject @@ -658,225 +566,158 @@ * @returns {Object.} Plain object */ Transaction.toObject = function toObject(message, options) { - if (!options) options = {}; + if (!options) + options = {}; var object = {}; if (options.defaults) { if ($util.Long) { var long = new $util.Long(0, 0, true); - object.Nonce = - options.longs === String - ? long.toString() - : options.longs === Number - ? long.toNumber() - : long; - } else object.Nonce = options.longs === String ? "0" : 0; - if (options.bytes === String) object.Value = ""; + object.Nonce = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.Nonce = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.Value = ""; else { object.Value = []; - if (options.bytes !== Array) object.Value = $util.newBuffer(object.Value); + if (options.bytes !== Array) + object.Value = $util.newBuffer(object.Value); } - if (options.bytes === String) object.RcvAddr = ""; + if (options.bytes === String) + object.RcvAddr = ""; else { object.RcvAddr = []; - if (options.bytes !== Array) object.RcvAddr = $util.newBuffer(object.RcvAddr); + if (options.bytes !== Array) + object.RcvAddr = $util.newBuffer(object.RcvAddr); } - if (options.bytes === String) object.RcvUserName = ""; + if (options.bytes === String) + object.RcvUserName = ""; else { object.RcvUserName = []; - if (options.bytes !== Array) object.RcvUserName = $util.newBuffer(object.RcvUserName); + if (options.bytes !== Array) + object.RcvUserName = $util.newBuffer(object.RcvUserName); } - if (options.bytes === String) object.SndAddr = ""; + if (options.bytes === String) + object.SndAddr = ""; else { object.SndAddr = []; - if (options.bytes !== Array) object.SndAddr = $util.newBuffer(object.SndAddr); + if (options.bytes !== Array) + object.SndAddr = $util.newBuffer(object.SndAddr); } - if (options.bytes === String) object.SndUserName = ""; + if (options.bytes === String) + object.SndUserName = ""; else { object.SndUserName = []; - if (options.bytes !== Array) object.SndUserName = $util.newBuffer(object.SndUserName); + if (options.bytes !== Array) + object.SndUserName = $util.newBuffer(object.SndUserName); } if ($util.Long) { var long = new $util.Long(0, 0, true); - object.GasPrice = - options.longs === String - ? long.toString() - : options.longs === Number - ? long.toNumber() - : long; - } else object.GasPrice = options.longs === String ? "0" : 0; + object.GasPrice = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.GasPrice = options.longs === String ? "0" : 0; if ($util.Long) { var long = new $util.Long(0, 0, true); - object.GasLimit = - options.longs === String - ? long.toString() - : options.longs === Number - ? long.toNumber() - : long; - } else object.GasLimit = options.longs === String ? "0" : 0; - if (options.bytes === String) object.Data = ""; + object.GasLimit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.GasLimit = options.longs === String ? "0" : 0; + if (options.bytes === String) + object.Data = ""; else { object.Data = []; - if (options.bytes !== Array) object.Data = $util.newBuffer(object.Data); + if (options.bytes !== Array) + object.Data = $util.newBuffer(object.Data); } - if (options.bytes === String) object.ChainID = ""; + if (options.bytes === String) + object.ChainID = ""; else { object.ChainID = []; - if (options.bytes !== Array) object.ChainID = $util.newBuffer(object.ChainID); + if (options.bytes !== Array) + object.ChainID = $util.newBuffer(object.ChainID); } object.Version = 0; - if (options.bytes === String) object.Signature = ""; + if (options.bytes === String) + object.Signature = ""; else { object.Signature = []; - if (options.bytes !== Array) object.Signature = $util.newBuffer(object.Signature); + if (options.bytes !== Array) + object.Signature = $util.newBuffer(object.Signature); } object.Options = 0; - if (options.bytes === String) object.GuardianAddr = ""; + if (options.bytes === String) + object.GuardianAddr = ""; else { object.GuardianAddr = []; - if (options.bytes !== Array) object.GuardianAddr = $util.newBuffer(object.GuardianAddr); + if (options.bytes !== Array) + object.GuardianAddr = $util.newBuffer(object.GuardianAddr); } - if (options.bytes === String) object.GuardianSignature = ""; + if (options.bytes === String) + object.GuardianSignature = ""; else { object.GuardianSignature = []; if (options.bytes !== Array) object.GuardianSignature = $util.newBuffer(object.GuardianSignature); } - if (options.bytes === String) object.Relayer = ""; + if (options.bytes === String) + object.Relayer = ""; else { object.Relayer = []; - if (options.bytes !== Array) object.Relayer = $util.newBuffer(object.Relayer); + if (options.bytes !== Array) + object.Relayer = $util.newBuffer(object.Relayer); } - if (options.bytes === String) object.RelayerSignature = ""; + if (options.bytes === String) + object.RelayerSignature = ""; else { object.RelayerSignature = []; - if (options.bytes !== Array) object.RelayerSignature = $util.newBuffer(object.RelayerSignature); + if (options.bytes !== Array) + object.RelayerSignature = $util.newBuffer(object.RelayerSignature); } } if (message.Nonce != null && message.hasOwnProperty("Nonce")) if (typeof message.Nonce === "number") object.Nonce = options.longs === String ? String(message.Nonce) : message.Nonce; else - object.Nonce = - options.longs === String - ? $util.Long.prototype.toString.call(message.Nonce) - : options.longs === Number - ? new $util.LongBits(message.Nonce.low >>> 0, message.Nonce.high >>> 0).toNumber(true) - : message.Nonce; + object.Nonce = options.longs === String ? $util.Long.prototype.toString.call(message.Nonce) : options.longs === Number ? new $util.LongBits(message.Nonce.low >>> 0, message.Nonce.high >>> 0).toNumber(true) : message.Nonce; if (message.Value != null && message.hasOwnProperty("Value")) - object.Value = - options.bytes === String - ? $util.base64.encode(message.Value, 0, message.Value.length) - : options.bytes === Array - ? Array.prototype.slice.call(message.Value) - : message.Value; + object.Value = options.bytes === String ? $util.base64.encode(message.Value, 0, message.Value.length) : options.bytes === Array ? Array.prototype.slice.call(message.Value) : message.Value; if (message.RcvAddr != null && message.hasOwnProperty("RcvAddr")) - object.RcvAddr = - options.bytes === String - ? $util.base64.encode(message.RcvAddr, 0, message.RcvAddr.length) - : options.bytes === Array - ? Array.prototype.slice.call(message.RcvAddr) - : message.RcvAddr; + object.RcvAddr = options.bytes === String ? $util.base64.encode(message.RcvAddr, 0, message.RcvAddr.length) : options.bytes === Array ? Array.prototype.slice.call(message.RcvAddr) : message.RcvAddr; if (message.RcvUserName != null && message.hasOwnProperty("RcvUserName")) - object.RcvUserName = - options.bytes === String - ? $util.base64.encode(message.RcvUserName, 0, message.RcvUserName.length) - : options.bytes === Array - ? Array.prototype.slice.call(message.RcvUserName) - : message.RcvUserName; + object.RcvUserName = options.bytes === String ? $util.base64.encode(message.RcvUserName, 0, message.RcvUserName.length) : options.bytes === Array ? Array.prototype.slice.call(message.RcvUserName) : message.RcvUserName; if (message.SndAddr != null && message.hasOwnProperty("SndAddr")) - object.SndAddr = - options.bytes === String - ? $util.base64.encode(message.SndAddr, 0, message.SndAddr.length) - : options.bytes === Array - ? Array.prototype.slice.call(message.SndAddr) - : message.SndAddr; + object.SndAddr = options.bytes === String ? $util.base64.encode(message.SndAddr, 0, message.SndAddr.length) : options.bytes === Array ? Array.prototype.slice.call(message.SndAddr) : message.SndAddr; if (message.SndUserName != null && message.hasOwnProperty("SndUserName")) - object.SndUserName = - options.bytes === String - ? $util.base64.encode(message.SndUserName, 0, message.SndUserName.length) - : options.bytes === Array - ? Array.prototype.slice.call(message.SndUserName) - : message.SndUserName; + object.SndUserName = options.bytes === String ? $util.base64.encode(message.SndUserName, 0, message.SndUserName.length) : options.bytes === Array ? Array.prototype.slice.call(message.SndUserName) : message.SndUserName; if (message.GasPrice != null && message.hasOwnProperty("GasPrice")) if (typeof message.GasPrice === "number") object.GasPrice = options.longs === String ? String(message.GasPrice) : message.GasPrice; else - 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; + 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; if (message.GasLimit != null && message.hasOwnProperty("GasLimit")) if (typeof message.GasLimit === "number") object.GasLimit = options.longs === String ? String(message.GasLimit) : message.GasLimit; else - 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; + 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; if (message.Data != null && message.hasOwnProperty("Data")) - object.Data = - options.bytes === String - ? $util.base64.encode(message.Data, 0, message.Data.length) - : options.bytes === Array - ? Array.prototype.slice.call(message.Data) - : message.Data; + object.Data = options.bytes === String ? $util.base64.encode(message.Data, 0, message.Data.length) : options.bytes === Array ? Array.prototype.slice.call(message.Data) : message.Data; if (message.ChainID != null && message.hasOwnProperty("ChainID")) - object.ChainID = - options.bytes === String - ? $util.base64.encode(message.ChainID, 0, message.ChainID.length) - : options.bytes === Array - ? Array.prototype.slice.call(message.ChainID) - : message.ChainID; - if (message.Version != null && message.hasOwnProperty("Version")) object.Version = message.Version; + object.ChainID = options.bytes === String ? $util.base64.encode(message.ChainID, 0, message.ChainID.length) : options.bytes === Array ? Array.prototype.slice.call(message.ChainID) : message.ChainID; + if (message.Version != null && message.hasOwnProperty("Version")) + object.Version = message.Version; if (message.Signature != null && message.hasOwnProperty("Signature")) - 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; - if (message.Options != null && message.hasOwnProperty("Options")) object.Options = message.Options; + 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; + if (message.Options != null && message.hasOwnProperty("Options")) + object.Options = message.Options; if (message.GuardianAddr != null && message.hasOwnProperty("GuardianAddr")) - object.GuardianAddr = - options.bytes === String - ? $util.base64.encode(message.GuardianAddr, 0, message.GuardianAddr.length) - : options.bytes === Array - ? Array.prototype.slice.call(message.GuardianAddr) - : message.GuardianAddr; + object.GuardianAddr = options.bytes === String ? $util.base64.encode(message.GuardianAddr, 0, message.GuardianAddr.length) : options.bytes === Array ? Array.prototype.slice.call(message.GuardianAddr) : message.GuardianAddr; if (message.GuardianSignature != null && message.hasOwnProperty("GuardianSignature")) - object.GuardianSignature = - options.bytes === String - ? $util.base64.encode(message.GuardianSignature, 0, message.GuardianSignature.length) - : options.bytes === Array - ? Array.prototype.slice.call(message.GuardianSignature) - : message.GuardianSignature; + object.GuardianSignature = options.bytes === String ? $util.base64.encode(message.GuardianSignature, 0, message.GuardianSignature.length) : options.bytes === Array ? Array.prototype.slice.call(message.GuardianSignature) : message.GuardianSignature; if (message.Relayer != null && message.hasOwnProperty("Relayer")) - object.Relayer = - options.bytes === String - ? $util.base64.encode(message.Relayer, 0, message.Relayer.length) - : options.bytes === Array - ? Array.prototype.slice.call(message.Relayer) - : message.Relayer; + object.Relayer = options.bytes === String ? $util.base64.encode(message.Relayer, 0, message.Relayer.length) : options.bytes === Array ? Array.prototype.slice.call(message.Relayer) : message.Relayer; if (message.RelayerSignature != null && message.hasOwnProperty("RelayerSignature")) - object.RelayerSignature = - options.bytes === String - ? $util.base64.encode(message.RelayerSignature, 0, message.RelayerSignature.length) - : options.bytes === Array - ? Array.prototype.slice.call(message.RelayerSignature) - : message.RelayerSignature; + object.RelayerSignature = options.bytes === String ? $util.base64.encode(message.RelayerSignature, 0, message.RelayerSignature.length) : options.bytes === Array ? Array.prototype.slice.call(message.RelayerSignature) : message.RelayerSignature; return object; }; - + /** * Converts this Transaction to JSON. * @function toJSON @@ -887,7 +728,7 @@ Transaction.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - + /** * Gets the default type url for Transaction * @function getTypeUrl @@ -902,10 +743,10 @@ } return typeUrlPrefix + "/proto.Transaction"; }; - + return Transaction; })(); - + return proto; })();