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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -90644,6 +90644,22 @@
90644
90644
  */
90645
90645
  var Proto = {};
90646
90646
 
90647
+ /**
90648
+ * NetworkId enum.
90649
+ * @name TW.Nimiq.Proto.NetworkId
90650
+ * @enum {number}
90651
+ * @property {number} UseDefault=0 UseDefault value
90652
+ * @property {number} Mainnet=42 Mainnet value
90653
+ * @property {number} MainnetAlbatross=24 MainnetAlbatross value
90654
+ */
90655
+ Proto.NetworkId = (function() {
90656
+ var valuesById = {}, values = Object.create(valuesById);
90657
+ values[valuesById[0] = "UseDefault"] = 0;
90658
+ values[valuesById[42] = "Mainnet"] = 42;
90659
+ values[valuesById[24] = "MainnetAlbatross"] = 24;
90660
+ return values;
90661
+ })();
90662
+
90647
90663
  Proto.SigningInput = (function() {
90648
90664
 
90649
90665
  /**
@@ -90655,6 +90671,7 @@
90655
90671
  * @property {Long|null} [value] SigningInput value
90656
90672
  * @property {Long|null} [fee] SigningInput fee
90657
90673
  * @property {number|null} [validityStartHeight] SigningInput validityStartHeight
90674
+ * @property {TW.Nimiq.Proto.NetworkId|null} [networkId] SigningInput networkId
90658
90675
  */
90659
90676
 
90660
90677
  /**
@@ -90712,6 +90729,14 @@
90712
90729
  */
90713
90730
  SigningInput.prototype.validityStartHeight = 0;
90714
90731
 
90732
+ /**
90733
+ * SigningInput networkId.
90734
+ * @member {TW.Nimiq.Proto.NetworkId} networkId
90735
+ * @memberof TW.Nimiq.Proto.SigningInput
90736
+ * @instance
90737
+ */
90738
+ SigningInput.prototype.networkId = 0;
90739
+
90715
90740
  /**
90716
90741
  * Creates a new SigningInput instance using the specified properties.
90717
90742
  * @function create
@@ -90746,6 +90771,8 @@
90746
90771
  writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.fee);
90747
90772
  if (message.validityStartHeight != null && Object.hasOwnProperty.call(message, "validityStartHeight"))
90748
90773
  writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.validityStartHeight);
90774
+ if (message.networkId != null && Object.hasOwnProperty.call(message, "networkId"))
90775
+ writer.uint32(/* id 6, wireType 0 =*/48).int32(message.networkId);
90749
90776
  return writer;
90750
90777
  };
90751
90778
 
@@ -90782,6 +90809,9 @@
90782
90809
  case 5:
90783
90810
  message.validityStartHeight = reader.uint32();
90784
90811
  break;
90812
+ case 6:
90813
+ message.networkId = reader.int32();
90814
+ break;
90785
90815
  default:
90786
90816
  reader.skipType(tag & 7);
90787
90817
  break;
@@ -90816,6 +90846,15 @@
90816
90846
  if (message.validityStartHeight != null && message.hasOwnProperty("validityStartHeight"))
90817
90847
  if (!$util.isInteger(message.validityStartHeight))
90818
90848
  return "validityStartHeight: integer expected";
90849
+ if (message.networkId != null && message.hasOwnProperty("networkId"))
90850
+ switch (message.networkId) {
90851
+ default:
90852
+ return "networkId: enum value expected";
90853
+ case 0:
90854
+ case 42:
90855
+ case 24:
90856
+ break;
90857
+ }
90819
90858
  return null;
90820
90859
  };
90821
90860
 
@@ -90858,6 +90897,20 @@
90858
90897
  message.fee = new $util.LongBits(object.fee.low >>> 0, object.fee.high >>> 0).toNumber(true);
90859
90898
  if (object.validityStartHeight != null)
90860
90899
  message.validityStartHeight = object.validityStartHeight >>> 0;
90900
+ switch (object.networkId) {
90901
+ case "UseDefault":
90902
+ case 0:
90903
+ message.networkId = 0;
90904
+ break;
90905
+ case "Mainnet":
90906
+ case 42:
90907
+ message.networkId = 42;
90908
+ break;
90909
+ case "MainnetAlbatross":
90910
+ case 24:
90911
+ message.networkId = 24;
90912
+ break;
90913
+ }
90861
90914
  return message;
90862
90915
  };
90863
90916
 
@@ -90894,6 +90947,7 @@
90894
90947
  } else
90895
90948
  object.fee = options.longs === String ? "0" : 0;
90896
90949
  object.validityStartHeight = 0;
90950
+ object.networkId = options.enums === String ? "UseDefault" : 0;
90897
90951
  }
90898
90952
  if (message.privateKey != null && message.hasOwnProperty("privateKey"))
90899
90953
  object.privateKey = options.bytes === String ? $util.base64.encode(message.privateKey, 0, message.privateKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.privateKey) : message.privateKey;
@@ -90911,6 +90965,8 @@
90911
90965
  object.fee = options.longs === String ? $util.Long.prototype.toString.call(message.fee) : options.longs === Number ? new $util.LongBits(message.fee.low >>> 0, message.fee.high >>> 0).toNumber(true) : message.fee;
90912
90966
  if (message.validityStartHeight != null && message.hasOwnProperty("validityStartHeight"))
90913
90967
  object.validityStartHeight = message.validityStartHeight;
90968
+ if (message.networkId != null && message.hasOwnProperty("networkId"))
90969
+ object.networkId = options.enums === String ? $root.TW.Nimiq.Proto.NetworkId[message.networkId] : message.networkId;
90914
90970
  return object;
90915
90971
  };
90916
90972
 
@@ -94658,70 +94714,1644 @@
94658
94714
  };
94659
94715
 
94660
94716
  /**
94661
- * Converts this SigningOutput to JSON.
94717
+ * Converts this SigningOutput to JSON.
94718
+ * @function toJSON
94719
+ * @memberof TW.Oasis.Proto.SigningOutput
94720
+ * @instance
94721
+ * @returns {Object.<string,*>} JSON object
94722
+ */
94723
+ SigningOutput.prototype.toJSON = function toJSON() {
94724
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
94725
+ };
94726
+
94727
+ return SigningOutput;
94728
+ })();
94729
+
94730
+ return Proto;
94731
+ })();
94732
+
94733
+ return Oasis;
94734
+ })();
94735
+
94736
+ TW.Ontology = (function() {
94737
+
94738
+ /**
94739
+ * Namespace Ontology.
94740
+ * @memberof TW
94741
+ * @namespace
94742
+ */
94743
+ var Ontology = {};
94744
+
94745
+ Ontology.Proto = (function() {
94746
+
94747
+ /**
94748
+ * Namespace Proto.
94749
+ * @memberof TW.Ontology
94750
+ * @namespace
94751
+ */
94752
+ var Proto = {};
94753
+
94754
+ Proto.SigningInput = (function() {
94755
+
94756
+ /**
94757
+ * Properties of a SigningInput.
94758
+ * @memberof TW.Ontology.Proto
94759
+ * @interface ISigningInput
94760
+ * @property {string|null} [contract] SigningInput contract
94761
+ * @property {string|null} [method] SigningInput method
94762
+ * @property {Uint8Array|null} [ownerPrivateKey] SigningInput ownerPrivateKey
94763
+ * @property {string|null} [toAddress] SigningInput toAddress
94764
+ * @property {Long|null} [amount] SigningInput amount
94765
+ * @property {Uint8Array|null} [payerPrivateKey] SigningInput payerPrivateKey
94766
+ * @property {Long|null} [gasPrice] SigningInput gasPrice
94767
+ * @property {Long|null} [gasLimit] SigningInput gasLimit
94768
+ * @property {string|null} [queryAddress] SigningInput queryAddress
94769
+ * @property {number|null} [nonce] SigningInput nonce
94770
+ * @property {string|null} [ownerAddress] SigningInput ownerAddress
94771
+ * @property {string|null} [payerAddress] SigningInput payerAddress
94772
+ */
94773
+
94774
+ /**
94775
+ * Constructs a new SigningInput.
94776
+ * @memberof TW.Ontology.Proto
94777
+ * @classdesc Represents a SigningInput.
94778
+ * @implements ISigningInput
94779
+ * @constructor
94780
+ * @param {TW.Ontology.Proto.ISigningInput=} [properties] Properties to set
94781
+ */
94782
+ function SigningInput(properties) {
94783
+ if (properties)
94784
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
94785
+ if (properties[keys[i]] != null)
94786
+ this[keys[i]] = properties[keys[i]];
94787
+ }
94788
+
94789
+ /**
94790
+ * SigningInput contract.
94791
+ * @member {string} contract
94792
+ * @memberof TW.Ontology.Proto.SigningInput
94793
+ * @instance
94794
+ */
94795
+ SigningInput.prototype.contract = "";
94796
+
94797
+ /**
94798
+ * SigningInput method.
94799
+ * @member {string} method
94800
+ * @memberof TW.Ontology.Proto.SigningInput
94801
+ * @instance
94802
+ */
94803
+ SigningInput.prototype.method = "";
94804
+
94805
+ /**
94806
+ * SigningInput ownerPrivateKey.
94807
+ * @member {Uint8Array} ownerPrivateKey
94808
+ * @memberof TW.Ontology.Proto.SigningInput
94809
+ * @instance
94810
+ */
94811
+ SigningInput.prototype.ownerPrivateKey = $util.newBuffer([]);
94812
+
94813
+ /**
94814
+ * SigningInput toAddress.
94815
+ * @member {string} toAddress
94816
+ * @memberof TW.Ontology.Proto.SigningInput
94817
+ * @instance
94818
+ */
94819
+ SigningInput.prototype.toAddress = "";
94820
+
94821
+ /**
94822
+ * SigningInput amount.
94823
+ * @member {Long} amount
94824
+ * @memberof TW.Ontology.Proto.SigningInput
94825
+ * @instance
94826
+ */
94827
+ SigningInput.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
94828
+
94829
+ /**
94830
+ * SigningInput payerPrivateKey.
94831
+ * @member {Uint8Array} payerPrivateKey
94832
+ * @memberof TW.Ontology.Proto.SigningInput
94833
+ * @instance
94834
+ */
94835
+ SigningInput.prototype.payerPrivateKey = $util.newBuffer([]);
94836
+
94837
+ /**
94838
+ * SigningInput gasPrice.
94839
+ * @member {Long} gasPrice
94840
+ * @memberof TW.Ontology.Proto.SigningInput
94841
+ * @instance
94842
+ */
94843
+ SigningInput.prototype.gasPrice = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
94844
+
94845
+ /**
94846
+ * SigningInput gasLimit.
94847
+ * @member {Long} gasLimit
94848
+ * @memberof TW.Ontology.Proto.SigningInput
94849
+ * @instance
94850
+ */
94851
+ SigningInput.prototype.gasLimit = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
94852
+
94853
+ /**
94854
+ * SigningInput queryAddress.
94855
+ * @member {string} queryAddress
94856
+ * @memberof TW.Ontology.Proto.SigningInput
94857
+ * @instance
94858
+ */
94859
+ SigningInput.prototype.queryAddress = "";
94860
+
94861
+ /**
94862
+ * SigningInput nonce.
94863
+ * @member {number} nonce
94864
+ * @memberof TW.Ontology.Proto.SigningInput
94865
+ * @instance
94866
+ */
94867
+ SigningInput.prototype.nonce = 0;
94868
+
94869
+ /**
94870
+ * SigningInput ownerAddress.
94871
+ * @member {string} ownerAddress
94872
+ * @memberof TW.Ontology.Proto.SigningInput
94873
+ * @instance
94874
+ */
94875
+ SigningInput.prototype.ownerAddress = "";
94876
+
94877
+ /**
94878
+ * SigningInput payerAddress.
94879
+ * @member {string} payerAddress
94880
+ * @memberof TW.Ontology.Proto.SigningInput
94881
+ * @instance
94882
+ */
94883
+ SigningInput.prototype.payerAddress = "";
94884
+
94885
+ /**
94886
+ * Creates a new SigningInput instance using the specified properties.
94887
+ * @function create
94888
+ * @memberof TW.Ontology.Proto.SigningInput
94889
+ * @static
94890
+ * @param {TW.Ontology.Proto.ISigningInput=} [properties] Properties to set
94891
+ * @returns {TW.Ontology.Proto.SigningInput} SigningInput instance
94892
+ */
94893
+ SigningInput.create = function create(properties) {
94894
+ return new SigningInput(properties);
94895
+ };
94896
+
94897
+ /**
94898
+ * Encodes the specified SigningInput message. Does not implicitly {@link TW.Ontology.Proto.SigningInput.verify|verify} messages.
94899
+ * @function encode
94900
+ * @memberof TW.Ontology.Proto.SigningInput
94901
+ * @static
94902
+ * @param {TW.Ontology.Proto.ISigningInput} message SigningInput message or plain object to encode
94903
+ * @param {$protobuf.Writer} [writer] Writer to encode to
94904
+ * @returns {$protobuf.Writer} Writer
94905
+ */
94906
+ SigningInput.encode = function encode(message, writer) {
94907
+ if (!writer)
94908
+ writer = $Writer.create();
94909
+ if (message.contract != null && Object.hasOwnProperty.call(message, "contract"))
94910
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.contract);
94911
+ if (message.method != null && Object.hasOwnProperty.call(message, "method"))
94912
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.method);
94913
+ if (message.ownerPrivateKey != null && Object.hasOwnProperty.call(message, "ownerPrivateKey"))
94914
+ writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.ownerPrivateKey);
94915
+ if (message.toAddress != null && Object.hasOwnProperty.call(message, "toAddress"))
94916
+ writer.uint32(/* id 4, wireType 2 =*/34).string(message.toAddress);
94917
+ if (message.amount != null && Object.hasOwnProperty.call(message, "amount"))
94918
+ writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.amount);
94919
+ if (message.payerPrivateKey != null && Object.hasOwnProperty.call(message, "payerPrivateKey"))
94920
+ writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.payerPrivateKey);
94921
+ if (message.gasPrice != null && Object.hasOwnProperty.call(message, "gasPrice"))
94922
+ writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.gasPrice);
94923
+ if (message.gasLimit != null && Object.hasOwnProperty.call(message, "gasLimit"))
94924
+ writer.uint32(/* id 8, wireType 0 =*/64).uint64(message.gasLimit);
94925
+ if (message.queryAddress != null && Object.hasOwnProperty.call(message, "queryAddress"))
94926
+ writer.uint32(/* id 9, wireType 2 =*/74).string(message.queryAddress);
94927
+ if (message.nonce != null && Object.hasOwnProperty.call(message, "nonce"))
94928
+ writer.uint32(/* id 10, wireType 0 =*/80).uint32(message.nonce);
94929
+ if (message.ownerAddress != null && Object.hasOwnProperty.call(message, "ownerAddress"))
94930
+ writer.uint32(/* id 11, wireType 2 =*/90).string(message.ownerAddress);
94931
+ if (message.payerAddress != null && Object.hasOwnProperty.call(message, "payerAddress"))
94932
+ writer.uint32(/* id 12, wireType 2 =*/98).string(message.payerAddress);
94933
+ return writer;
94934
+ };
94935
+
94936
+ /**
94937
+ * Decodes a SigningInput message from the specified reader or buffer.
94938
+ * @function decode
94939
+ * @memberof TW.Ontology.Proto.SigningInput
94940
+ * @static
94941
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
94942
+ * @param {number} [length] Message length if known beforehand
94943
+ * @returns {TW.Ontology.Proto.SigningInput} SigningInput
94944
+ * @throws {Error} If the payload is not a reader or valid buffer
94945
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
94946
+ */
94947
+ SigningInput.decode = function decode(reader, length) {
94948
+ if (!(reader instanceof $Reader))
94949
+ reader = $Reader.create(reader);
94950
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Ontology.Proto.SigningInput();
94951
+ while (reader.pos < end) {
94952
+ var tag = reader.uint32();
94953
+ switch (tag >>> 3) {
94954
+ case 1:
94955
+ message.contract = reader.string();
94956
+ break;
94957
+ case 2:
94958
+ message.method = reader.string();
94959
+ break;
94960
+ case 3:
94961
+ message.ownerPrivateKey = reader.bytes();
94962
+ break;
94963
+ case 4:
94964
+ message.toAddress = reader.string();
94965
+ break;
94966
+ case 5:
94967
+ message.amount = reader.uint64();
94968
+ break;
94969
+ case 6:
94970
+ message.payerPrivateKey = reader.bytes();
94971
+ break;
94972
+ case 7:
94973
+ message.gasPrice = reader.uint64();
94974
+ break;
94975
+ case 8:
94976
+ message.gasLimit = reader.uint64();
94977
+ break;
94978
+ case 9:
94979
+ message.queryAddress = reader.string();
94980
+ break;
94981
+ case 10:
94982
+ message.nonce = reader.uint32();
94983
+ break;
94984
+ case 11:
94985
+ message.ownerAddress = reader.string();
94986
+ break;
94987
+ case 12:
94988
+ message.payerAddress = reader.string();
94989
+ break;
94990
+ default:
94991
+ reader.skipType(tag & 7);
94992
+ break;
94993
+ }
94994
+ }
94995
+ return message;
94996
+ };
94997
+
94998
+ /**
94999
+ * Verifies a SigningInput message.
95000
+ * @function verify
95001
+ * @memberof TW.Ontology.Proto.SigningInput
95002
+ * @static
95003
+ * @param {Object.<string,*>} message Plain object to verify
95004
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
95005
+ */
95006
+ SigningInput.verify = function verify(message) {
95007
+ if (typeof message !== "object" || message === null)
95008
+ return "object expected";
95009
+ if (message.contract != null && message.hasOwnProperty("contract"))
95010
+ if (!$util.isString(message.contract))
95011
+ return "contract: string expected";
95012
+ if (message.method != null && message.hasOwnProperty("method"))
95013
+ if (!$util.isString(message.method))
95014
+ return "method: string expected";
95015
+ if (message.ownerPrivateKey != null && message.hasOwnProperty("ownerPrivateKey"))
95016
+ if (!(message.ownerPrivateKey && typeof message.ownerPrivateKey.length === "number" || $util.isString(message.ownerPrivateKey)))
95017
+ return "ownerPrivateKey: buffer expected";
95018
+ if (message.toAddress != null && message.hasOwnProperty("toAddress"))
95019
+ if (!$util.isString(message.toAddress))
95020
+ return "toAddress: string expected";
95021
+ if (message.amount != null && message.hasOwnProperty("amount"))
95022
+ if (!$util.isInteger(message.amount) && !(message.amount && $util.isInteger(message.amount.low) && $util.isInteger(message.amount.high)))
95023
+ return "amount: integer|Long expected";
95024
+ if (message.payerPrivateKey != null && message.hasOwnProperty("payerPrivateKey"))
95025
+ if (!(message.payerPrivateKey && typeof message.payerPrivateKey.length === "number" || $util.isString(message.payerPrivateKey)))
95026
+ return "payerPrivateKey: buffer expected";
95027
+ if (message.gasPrice != null && message.hasOwnProperty("gasPrice"))
95028
+ if (!$util.isInteger(message.gasPrice) && !(message.gasPrice && $util.isInteger(message.gasPrice.low) && $util.isInteger(message.gasPrice.high)))
95029
+ return "gasPrice: integer|Long expected";
95030
+ if (message.gasLimit != null && message.hasOwnProperty("gasLimit"))
95031
+ if (!$util.isInteger(message.gasLimit) && !(message.gasLimit && $util.isInteger(message.gasLimit.low) && $util.isInteger(message.gasLimit.high)))
95032
+ return "gasLimit: integer|Long expected";
95033
+ if (message.queryAddress != null && message.hasOwnProperty("queryAddress"))
95034
+ if (!$util.isString(message.queryAddress))
95035
+ return "queryAddress: string expected";
95036
+ if (message.nonce != null && message.hasOwnProperty("nonce"))
95037
+ if (!$util.isInteger(message.nonce))
95038
+ return "nonce: integer expected";
95039
+ if (message.ownerAddress != null && message.hasOwnProperty("ownerAddress"))
95040
+ if (!$util.isString(message.ownerAddress))
95041
+ return "ownerAddress: string expected";
95042
+ if (message.payerAddress != null && message.hasOwnProperty("payerAddress"))
95043
+ if (!$util.isString(message.payerAddress))
95044
+ return "payerAddress: string expected";
95045
+ return null;
95046
+ };
95047
+
95048
+ /**
95049
+ * Creates a SigningInput message from a plain object. Also converts values to their respective internal types.
95050
+ * @function fromObject
95051
+ * @memberof TW.Ontology.Proto.SigningInput
95052
+ * @static
95053
+ * @param {Object.<string,*>} object Plain object
95054
+ * @returns {TW.Ontology.Proto.SigningInput} SigningInput
95055
+ */
95056
+ SigningInput.fromObject = function fromObject(object) {
95057
+ if (object instanceof $root.TW.Ontology.Proto.SigningInput)
95058
+ return object;
95059
+ var message = new $root.TW.Ontology.Proto.SigningInput();
95060
+ if (object.contract != null)
95061
+ message.contract = String(object.contract);
95062
+ if (object.method != null)
95063
+ message.method = String(object.method);
95064
+ if (object.ownerPrivateKey != null)
95065
+ if (typeof object.ownerPrivateKey === "string")
95066
+ $util.base64.decode(object.ownerPrivateKey, message.ownerPrivateKey = $util.newBuffer($util.base64.length(object.ownerPrivateKey)), 0);
95067
+ else if (object.ownerPrivateKey.length)
95068
+ message.ownerPrivateKey = object.ownerPrivateKey;
95069
+ if (object.toAddress != null)
95070
+ message.toAddress = String(object.toAddress);
95071
+ if (object.amount != null)
95072
+ if ($util.Long)
95073
+ (message.amount = $util.Long.fromValue(object.amount)).unsigned = true;
95074
+ else if (typeof object.amount === "string")
95075
+ message.amount = parseInt(object.amount, 10);
95076
+ else if (typeof object.amount === "number")
95077
+ message.amount = object.amount;
95078
+ else if (typeof object.amount === "object")
95079
+ message.amount = new $util.LongBits(object.amount.low >>> 0, object.amount.high >>> 0).toNumber(true);
95080
+ if (object.payerPrivateKey != null)
95081
+ if (typeof object.payerPrivateKey === "string")
95082
+ $util.base64.decode(object.payerPrivateKey, message.payerPrivateKey = $util.newBuffer($util.base64.length(object.payerPrivateKey)), 0);
95083
+ else if (object.payerPrivateKey.length)
95084
+ message.payerPrivateKey = object.payerPrivateKey;
95085
+ if (object.gasPrice != null)
95086
+ if ($util.Long)
95087
+ (message.gasPrice = $util.Long.fromValue(object.gasPrice)).unsigned = true;
95088
+ else if (typeof object.gasPrice === "string")
95089
+ message.gasPrice = parseInt(object.gasPrice, 10);
95090
+ else if (typeof object.gasPrice === "number")
95091
+ message.gasPrice = object.gasPrice;
95092
+ else if (typeof object.gasPrice === "object")
95093
+ message.gasPrice = new $util.LongBits(object.gasPrice.low >>> 0, object.gasPrice.high >>> 0).toNumber(true);
95094
+ if (object.gasLimit != null)
95095
+ if ($util.Long)
95096
+ (message.gasLimit = $util.Long.fromValue(object.gasLimit)).unsigned = true;
95097
+ else if (typeof object.gasLimit === "string")
95098
+ message.gasLimit = parseInt(object.gasLimit, 10);
95099
+ else if (typeof object.gasLimit === "number")
95100
+ message.gasLimit = object.gasLimit;
95101
+ else if (typeof object.gasLimit === "object")
95102
+ message.gasLimit = new $util.LongBits(object.gasLimit.low >>> 0, object.gasLimit.high >>> 0).toNumber(true);
95103
+ if (object.queryAddress != null)
95104
+ message.queryAddress = String(object.queryAddress);
95105
+ if (object.nonce != null)
95106
+ message.nonce = object.nonce >>> 0;
95107
+ if (object.ownerAddress != null)
95108
+ message.ownerAddress = String(object.ownerAddress);
95109
+ if (object.payerAddress != null)
95110
+ message.payerAddress = String(object.payerAddress);
95111
+ return message;
95112
+ };
95113
+
95114
+ /**
95115
+ * Creates a plain object from a SigningInput message. Also converts values to other types if specified.
95116
+ * @function toObject
95117
+ * @memberof TW.Ontology.Proto.SigningInput
95118
+ * @static
95119
+ * @param {TW.Ontology.Proto.SigningInput} message SigningInput
95120
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
95121
+ * @returns {Object.<string,*>} Plain object
95122
+ */
95123
+ SigningInput.toObject = function toObject(message, options) {
95124
+ if (!options)
95125
+ options = {};
95126
+ var object = {};
95127
+ if (options.defaults) {
95128
+ object.contract = "";
95129
+ object.method = "";
95130
+ if (options.bytes === String)
95131
+ object.ownerPrivateKey = "";
95132
+ else {
95133
+ object.ownerPrivateKey = [];
95134
+ if (options.bytes !== Array)
95135
+ object.ownerPrivateKey = $util.newBuffer(object.ownerPrivateKey);
95136
+ }
95137
+ object.toAddress = "";
95138
+ if ($util.Long) {
95139
+ var long = new $util.Long(0, 0, true);
95140
+ object.amount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
95141
+ } else
95142
+ object.amount = options.longs === String ? "0" : 0;
95143
+ if (options.bytes === String)
95144
+ object.payerPrivateKey = "";
95145
+ else {
95146
+ object.payerPrivateKey = [];
95147
+ if (options.bytes !== Array)
95148
+ object.payerPrivateKey = $util.newBuffer(object.payerPrivateKey);
95149
+ }
95150
+ if ($util.Long) {
95151
+ var long = new $util.Long(0, 0, true);
95152
+ object.gasPrice = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
95153
+ } else
95154
+ object.gasPrice = options.longs === String ? "0" : 0;
95155
+ if ($util.Long) {
95156
+ var long = new $util.Long(0, 0, true);
95157
+ object.gasLimit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
95158
+ } else
95159
+ object.gasLimit = options.longs === String ? "0" : 0;
95160
+ object.queryAddress = "";
95161
+ object.nonce = 0;
95162
+ object.ownerAddress = "";
95163
+ object.payerAddress = "";
95164
+ }
95165
+ if (message.contract != null && message.hasOwnProperty("contract"))
95166
+ object.contract = message.contract;
95167
+ if (message.method != null && message.hasOwnProperty("method"))
95168
+ object.method = message.method;
95169
+ if (message.ownerPrivateKey != null && message.hasOwnProperty("ownerPrivateKey"))
95170
+ object.ownerPrivateKey = options.bytes === String ? $util.base64.encode(message.ownerPrivateKey, 0, message.ownerPrivateKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.ownerPrivateKey) : message.ownerPrivateKey;
95171
+ if (message.toAddress != null && message.hasOwnProperty("toAddress"))
95172
+ object.toAddress = message.toAddress;
95173
+ if (message.amount != null && message.hasOwnProperty("amount"))
95174
+ if (typeof message.amount === "number")
95175
+ object.amount = options.longs === String ? String(message.amount) : message.amount;
95176
+ else
95177
+ object.amount = options.longs === String ? $util.Long.prototype.toString.call(message.amount) : options.longs === Number ? new $util.LongBits(message.amount.low >>> 0, message.amount.high >>> 0).toNumber(true) : message.amount;
95178
+ if (message.payerPrivateKey != null && message.hasOwnProperty("payerPrivateKey"))
95179
+ object.payerPrivateKey = options.bytes === String ? $util.base64.encode(message.payerPrivateKey, 0, message.payerPrivateKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.payerPrivateKey) : message.payerPrivateKey;
95180
+ if (message.gasPrice != null && message.hasOwnProperty("gasPrice"))
95181
+ if (typeof message.gasPrice === "number")
95182
+ object.gasPrice = options.longs === String ? String(message.gasPrice) : message.gasPrice;
95183
+ else
95184
+ object.gasPrice = options.longs === String ? $util.Long.prototype.toString.call(message.gasPrice) : options.longs === Number ? new $util.LongBits(message.gasPrice.low >>> 0, message.gasPrice.high >>> 0).toNumber(true) : message.gasPrice;
95185
+ if (message.gasLimit != null && message.hasOwnProperty("gasLimit"))
95186
+ if (typeof message.gasLimit === "number")
95187
+ object.gasLimit = options.longs === String ? String(message.gasLimit) : message.gasLimit;
95188
+ else
95189
+ object.gasLimit = options.longs === String ? $util.Long.prototype.toString.call(message.gasLimit) : options.longs === Number ? new $util.LongBits(message.gasLimit.low >>> 0, message.gasLimit.high >>> 0).toNumber(true) : message.gasLimit;
95190
+ if (message.queryAddress != null && message.hasOwnProperty("queryAddress"))
95191
+ object.queryAddress = message.queryAddress;
95192
+ if (message.nonce != null && message.hasOwnProperty("nonce"))
95193
+ object.nonce = message.nonce;
95194
+ if (message.ownerAddress != null && message.hasOwnProperty("ownerAddress"))
95195
+ object.ownerAddress = message.ownerAddress;
95196
+ if (message.payerAddress != null && message.hasOwnProperty("payerAddress"))
95197
+ object.payerAddress = message.payerAddress;
95198
+ return object;
95199
+ };
95200
+
95201
+ /**
95202
+ * Converts this SigningInput to JSON.
95203
+ * @function toJSON
95204
+ * @memberof TW.Ontology.Proto.SigningInput
95205
+ * @instance
95206
+ * @returns {Object.<string,*>} JSON object
95207
+ */
95208
+ SigningInput.prototype.toJSON = function toJSON() {
95209
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
95210
+ };
95211
+
95212
+ return SigningInput;
95213
+ })();
95214
+
95215
+ Proto.SigningOutput = (function() {
95216
+
95217
+ /**
95218
+ * Properties of a SigningOutput.
95219
+ * @memberof TW.Ontology.Proto
95220
+ * @interface ISigningOutput
95221
+ * @property {Uint8Array|null} [encoded] SigningOutput encoded
95222
+ * @property {TW.Common.Proto.SigningError|null} [error] SigningOutput error
95223
+ * @property {string|null} [errorMessage] SigningOutput errorMessage
95224
+ */
95225
+
95226
+ /**
95227
+ * Constructs a new SigningOutput.
95228
+ * @memberof TW.Ontology.Proto
95229
+ * @classdesc Represents a SigningOutput.
95230
+ * @implements ISigningOutput
95231
+ * @constructor
95232
+ * @param {TW.Ontology.Proto.ISigningOutput=} [properties] Properties to set
95233
+ */
95234
+ function SigningOutput(properties) {
95235
+ if (properties)
95236
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
95237
+ if (properties[keys[i]] != null)
95238
+ this[keys[i]] = properties[keys[i]];
95239
+ }
95240
+
95241
+ /**
95242
+ * SigningOutput encoded.
95243
+ * @member {Uint8Array} encoded
95244
+ * @memberof TW.Ontology.Proto.SigningOutput
95245
+ * @instance
95246
+ */
95247
+ SigningOutput.prototype.encoded = $util.newBuffer([]);
95248
+
95249
+ /**
95250
+ * SigningOutput error.
95251
+ * @member {TW.Common.Proto.SigningError} error
95252
+ * @memberof TW.Ontology.Proto.SigningOutput
95253
+ * @instance
95254
+ */
95255
+ SigningOutput.prototype.error = 0;
95256
+
95257
+ /**
95258
+ * SigningOutput errorMessage.
95259
+ * @member {string} errorMessage
95260
+ * @memberof TW.Ontology.Proto.SigningOutput
95261
+ * @instance
95262
+ */
95263
+ SigningOutput.prototype.errorMessage = "";
95264
+
95265
+ /**
95266
+ * Creates a new SigningOutput instance using the specified properties.
95267
+ * @function create
95268
+ * @memberof TW.Ontology.Proto.SigningOutput
95269
+ * @static
95270
+ * @param {TW.Ontology.Proto.ISigningOutput=} [properties] Properties to set
95271
+ * @returns {TW.Ontology.Proto.SigningOutput} SigningOutput instance
95272
+ */
95273
+ SigningOutput.create = function create(properties) {
95274
+ return new SigningOutput(properties);
95275
+ };
95276
+
95277
+ /**
95278
+ * Encodes the specified SigningOutput message. Does not implicitly {@link TW.Ontology.Proto.SigningOutput.verify|verify} messages.
95279
+ * @function encode
95280
+ * @memberof TW.Ontology.Proto.SigningOutput
95281
+ * @static
95282
+ * @param {TW.Ontology.Proto.ISigningOutput} message SigningOutput message or plain object to encode
95283
+ * @param {$protobuf.Writer} [writer] Writer to encode to
95284
+ * @returns {$protobuf.Writer} Writer
95285
+ */
95286
+ SigningOutput.encode = function encode(message, writer) {
95287
+ if (!writer)
95288
+ writer = $Writer.create();
95289
+ if (message.encoded != null && Object.hasOwnProperty.call(message, "encoded"))
95290
+ writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.encoded);
95291
+ if (message.error != null && Object.hasOwnProperty.call(message, "error"))
95292
+ writer.uint32(/* id 2, wireType 0 =*/16).int32(message.error);
95293
+ if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage"))
95294
+ writer.uint32(/* id 3, wireType 2 =*/26).string(message.errorMessage);
95295
+ return writer;
95296
+ };
95297
+
95298
+ /**
95299
+ * Decodes a SigningOutput message from the specified reader or buffer.
95300
+ * @function decode
95301
+ * @memberof TW.Ontology.Proto.SigningOutput
95302
+ * @static
95303
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
95304
+ * @param {number} [length] Message length if known beforehand
95305
+ * @returns {TW.Ontology.Proto.SigningOutput} SigningOutput
95306
+ * @throws {Error} If the payload is not a reader or valid buffer
95307
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
95308
+ */
95309
+ SigningOutput.decode = function decode(reader, length) {
95310
+ if (!(reader instanceof $Reader))
95311
+ reader = $Reader.create(reader);
95312
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Ontology.Proto.SigningOutput();
95313
+ while (reader.pos < end) {
95314
+ var tag = reader.uint32();
95315
+ switch (tag >>> 3) {
95316
+ case 1:
95317
+ message.encoded = reader.bytes();
95318
+ break;
95319
+ case 2:
95320
+ message.error = reader.int32();
95321
+ break;
95322
+ case 3:
95323
+ message.errorMessage = reader.string();
95324
+ break;
95325
+ default:
95326
+ reader.skipType(tag & 7);
95327
+ break;
95328
+ }
95329
+ }
95330
+ return message;
95331
+ };
95332
+
95333
+ /**
95334
+ * Verifies a SigningOutput message.
95335
+ * @function verify
95336
+ * @memberof TW.Ontology.Proto.SigningOutput
95337
+ * @static
95338
+ * @param {Object.<string,*>} message Plain object to verify
95339
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
95340
+ */
95341
+ SigningOutput.verify = function verify(message) {
95342
+ if (typeof message !== "object" || message === null)
95343
+ return "object expected";
95344
+ if (message.encoded != null && message.hasOwnProperty("encoded"))
95345
+ if (!(message.encoded && typeof message.encoded.length === "number" || $util.isString(message.encoded)))
95346
+ return "encoded: buffer expected";
95347
+ if (message.error != null && message.hasOwnProperty("error"))
95348
+ switch (message.error) {
95349
+ default:
95350
+ return "error: enum value expected";
95351
+ case 0:
95352
+ case 1:
95353
+ case 2:
95354
+ case 3:
95355
+ case 4:
95356
+ case 5:
95357
+ case 15:
95358
+ case 16:
95359
+ case 17:
95360
+ case 18:
95361
+ case 6:
95362
+ case 7:
95363
+ case 8:
95364
+ case 9:
95365
+ case 10:
95366
+ case 11:
95367
+ case 12:
95368
+ case 13:
95369
+ case 14:
95370
+ case 19:
95371
+ case 20:
95372
+ case 21:
95373
+ case 22:
95374
+ case 23:
95375
+ case 24:
95376
+ case 25:
95377
+ break;
95378
+ }
95379
+ if (message.errorMessage != null && message.hasOwnProperty("errorMessage"))
95380
+ if (!$util.isString(message.errorMessage))
95381
+ return "errorMessage: string expected";
95382
+ return null;
95383
+ };
95384
+
95385
+ /**
95386
+ * Creates a SigningOutput message from a plain object. Also converts values to their respective internal types.
95387
+ * @function fromObject
95388
+ * @memberof TW.Ontology.Proto.SigningOutput
95389
+ * @static
95390
+ * @param {Object.<string,*>} object Plain object
95391
+ * @returns {TW.Ontology.Proto.SigningOutput} SigningOutput
95392
+ */
95393
+ SigningOutput.fromObject = function fromObject(object) {
95394
+ if (object instanceof $root.TW.Ontology.Proto.SigningOutput)
95395
+ return object;
95396
+ var message = new $root.TW.Ontology.Proto.SigningOutput();
95397
+ if (object.encoded != null)
95398
+ if (typeof object.encoded === "string")
95399
+ $util.base64.decode(object.encoded, message.encoded = $util.newBuffer($util.base64.length(object.encoded)), 0);
95400
+ else if (object.encoded.length)
95401
+ message.encoded = object.encoded;
95402
+ switch (object.error) {
95403
+ case "OK":
95404
+ case 0:
95405
+ message.error = 0;
95406
+ break;
95407
+ case "Error_general":
95408
+ case 1:
95409
+ message.error = 1;
95410
+ break;
95411
+ case "Error_internal":
95412
+ case 2:
95413
+ message.error = 2;
95414
+ break;
95415
+ case "Error_low_balance":
95416
+ case 3:
95417
+ message.error = 3;
95418
+ break;
95419
+ case "Error_zero_amount_requested":
95420
+ case 4:
95421
+ message.error = 4;
95422
+ break;
95423
+ case "Error_missing_private_key":
95424
+ case 5:
95425
+ message.error = 5;
95426
+ break;
95427
+ case "Error_invalid_private_key":
95428
+ case 15:
95429
+ message.error = 15;
95430
+ break;
95431
+ case "Error_invalid_address":
95432
+ case 16:
95433
+ message.error = 16;
95434
+ break;
95435
+ case "Error_invalid_utxo":
95436
+ case 17:
95437
+ message.error = 17;
95438
+ break;
95439
+ case "Error_invalid_utxo_amount":
95440
+ case 18:
95441
+ message.error = 18;
95442
+ break;
95443
+ case "Error_wrong_fee":
95444
+ case 6:
95445
+ message.error = 6;
95446
+ break;
95447
+ case "Error_signing":
95448
+ case 7:
95449
+ message.error = 7;
95450
+ break;
95451
+ case "Error_tx_too_big":
95452
+ case 8:
95453
+ message.error = 8;
95454
+ break;
95455
+ case "Error_missing_input_utxos":
95456
+ case 9:
95457
+ message.error = 9;
95458
+ break;
95459
+ case "Error_not_enough_utxos":
95460
+ case 10:
95461
+ message.error = 10;
95462
+ break;
95463
+ case "Error_script_redeem":
95464
+ case 11:
95465
+ message.error = 11;
95466
+ break;
95467
+ case "Error_script_output":
95468
+ case 12:
95469
+ message.error = 12;
95470
+ break;
95471
+ case "Error_script_witness_program":
95472
+ case 13:
95473
+ message.error = 13;
95474
+ break;
95475
+ case "Error_invalid_memo":
95476
+ case 14:
95477
+ message.error = 14;
95478
+ break;
95479
+ case "Error_input_parse":
95480
+ case 19:
95481
+ message.error = 19;
95482
+ break;
95483
+ case "Error_no_support_n2n":
95484
+ case 20:
95485
+ message.error = 20;
95486
+ break;
95487
+ case "Error_signatures_count":
95488
+ case 21:
95489
+ message.error = 21;
95490
+ break;
95491
+ case "Error_invalid_params":
95492
+ case 22:
95493
+ message.error = 22;
95494
+ break;
95495
+ case "Error_invalid_requested_token_amount":
95496
+ case 23:
95497
+ message.error = 23;
95498
+ break;
95499
+ case "Error_not_supported":
95500
+ case 24:
95501
+ message.error = 24;
95502
+ break;
95503
+ case "Error_dust_amount_requested":
95504
+ case 25:
95505
+ message.error = 25;
95506
+ break;
95507
+ }
95508
+ if (object.errorMessage != null)
95509
+ message.errorMessage = String(object.errorMessage);
95510
+ return message;
95511
+ };
95512
+
95513
+ /**
95514
+ * Creates a plain object from a SigningOutput message. Also converts values to other types if specified.
95515
+ * @function toObject
95516
+ * @memberof TW.Ontology.Proto.SigningOutput
95517
+ * @static
95518
+ * @param {TW.Ontology.Proto.SigningOutput} message SigningOutput
95519
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
95520
+ * @returns {Object.<string,*>} Plain object
95521
+ */
95522
+ SigningOutput.toObject = function toObject(message, options) {
95523
+ if (!options)
95524
+ options = {};
95525
+ var object = {};
95526
+ if (options.defaults) {
95527
+ if (options.bytes === String)
95528
+ object.encoded = "";
95529
+ else {
95530
+ object.encoded = [];
95531
+ if (options.bytes !== Array)
95532
+ object.encoded = $util.newBuffer(object.encoded);
95533
+ }
95534
+ object.error = options.enums === String ? "OK" : 0;
95535
+ object.errorMessage = "";
95536
+ }
95537
+ if (message.encoded != null && message.hasOwnProperty("encoded"))
95538
+ object.encoded = options.bytes === String ? $util.base64.encode(message.encoded, 0, message.encoded.length) : options.bytes === Array ? Array.prototype.slice.call(message.encoded) : message.encoded;
95539
+ if (message.error != null && message.hasOwnProperty("error"))
95540
+ object.error = options.enums === String ? $root.TW.Common.Proto.SigningError[message.error] : message.error;
95541
+ if (message.errorMessage != null && message.hasOwnProperty("errorMessage"))
95542
+ object.errorMessage = message.errorMessage;
95543
+ return object;
95544
+ };
95545
+
95546
+ /**
95547
+ * Converts this SigningOutput to JSON.
95548
+ * @function toJSON
95549
+ * @memberof TW.Ontology.Proto.SigningOutput
95550
+ * @instance
95551
+ * @returns {Object.<string,*>} JSON object
95552
+ */
95553
+ SigningOutput.prototype.toJSON = function toJSON() {
95554
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
95555
+ };
95556
+
95557
+ return SigningOutput;
95558
+ })();
95559
+
95560
+ return Proto;
95561
+ })();
95562
+
95563
+ return Ontology;
95564
+ })();
95565
+
95566
+ TW.Pactus = (function() {
95567
+
95568
+ /**
95569
+ * Namespace Pactus.
95570
+ * @memberof TW
95571
+ * @namespace
95572
+ */
95573
+ var Pactus = {};
95574
+
95575
+ Pactus.Proto = (function() {
95576
+
95577
+ /**
95578
+ * Namespace Proto.
95579
+ * @memberof TW.Pactus
95580
+ * @namespace
95581
+ */
95582
+ var Proto = {};
95583
+
95584
+ Proto.TransactionMessage = (function() {
95585
+
95586
+ /**
95587
+ * Properties of a TransactionMessage.
95588
+ * @memberof TW.Pactus.Proto
95589
+ * @interface ITransactionMessage
95590
+ * @property {number|null} [lockTime] TransactionMessage lockTime
95591
+ * @property {Long|null} [fee] TransactionMessage fee
95592
+ * @property {string|null} [memo] TransactionMessage memo
95593
+ * @property {TW.Pactus.Proto.ITransferPayload|null} [transfer] TransactionMessage transfer
95594
+ * @property {TW.Pactus.Proto.IBondPayload|null} [bond] TransactionMessage bond
95595
+ */
95596
+
95597
+ /**
95598
+ * Constructs a new TransactionMessage.
95599
+ * @memberof TW.Pactus.Proto
95600
+ * @classdesc Represents a TransactionMessage.
95601
+ * @implements ITransactionMessage
95602
+ * @constructor
95603
+ * @param {TW.Pactus.Proto.ITransactionMessage=} [properties] Properties to set
95604
+ */
95605
+ function TransactionMessage(properties) {
95606
+ if (properties)
95607
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
95608
+ if (properties[keys[i]] != null)
95609
+ this[keys[i]] = properties[keys[i]];
95610
+ }
95611
+
95612
+ /**
95613
+ * TransactionMessage lockTime.
95614
+ * @member {number} lockTime
95615
+ * @memberof TW.Pactus.Proto.TransactionMessage
95616
+ * @instance
95617
+ */
95618
+ TransactionMessage.prototype.lockTime = 0;
95619
+
95620
+ /**
95621
+ * TransactionMessage fee.
95622
+ * @member {Long} fee
95623
+ * @memberof TW.Pactus.Proto.TransactionMessage
95624
+ * @instance
95625
+ */
95626
+ TransactionMessage.prototype.fee = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
95627
+
95628
+ /**
95629
+ * TransactionMessage memo.
95630
+ * @member {string} memo
95631
+ * @memberof TW.Pactus.Proto.TransactionMessage
95632
+ * @instance
95633
+ */
95634
+ TransactionMessage.prototype.memo = "";
95635
+
95636
+ /**
95637
+ * TransactionMessage transfer.
95638
+ * @member {TW.Pactus.Proto.ITransferPayload|null|undefined} transfer
95639
+ * @memberof TW.Pactus.Proto.TransactionMessage
95640
+ * @instance
95641
+ */
95642
+ TransactionMessage.prototype.transfer = null;
95643
+
95644
+ /**
95645
+ * TransactionMessage bond.
95646
+ * @member {TW.Pactus.Proto.IBondPayload|null|undefined} bond
95647
+ * @memberof TW.Pactus.Proto.TransactionMessage
95648
+ * @instance
95649
+ */
95650
+ TransactionMessage.prototype.bond = null;
95651
+
95652
+ // OneOf field names bound to virtual getters and setters
95653
+ var $oneOfFields;
95654
+
95655
+ /**
95656
+ * TransactionMessage payload.
95657
+ * @member {"transfer"|"bond"|undefined} payload
95658
+ * @memberof TW.Pactus.Proto.TransactionMessage
95659
+ * @instance
95660
+ */
95661
+ Object.defineProperty(TransactionMessage.prototype, "payload", {
95662
+ get: $util.oneOfGetter($oneOfFields = ["transfer", "bond"]),
95663
+ set: $util.oneOfSetter($oneOfFields)
95664
+ });
95665
+
95666
+ /**
95667
+ * Creates a new TransactionMessage instance using the specified properties.
95668
+ * @function create
95669
+ * @memberof TW.Pactus.Proto.TransactionMessage
95670
+ * @static
95671
+ * @param {TW.Pactus.Proto.ITransactionMessage=} [properties] Properties to set
95672
+ * @returns {TW.Pactus.Proto.TransactionMessage} TransactionMessage instance
95673
+ */
95674
+ TransactionMessage.create = function create(properties) {
95675
+ return new TransactionMessage(properties);
95676
+ };
95677
+
95678
+ /**
95679
+ * Encodes the specified TransactionMessage message. Does not implicitly {@link TW.Pactus.Proto.TransactionMessage.verify|verify} messages.
95680
+ * @function encode
95681
+ * @memberof TW.Pactus.Proto.TransactionMessage
95682
+ * @static
95683
+ * @param {TW.Pactus.Proto.ITransactionMessage} message TransactionMessage message or plain object to encode
95684
+ * @param {$protobuf.Writer} [writer] Writer to encode to
95685
+ * @returns {$protobuf.Writer} Writer
95686
+ */
95687
+ TransactionMessage.encode = function encode(message, writer) {
95688
+ if (!writer)
95689
+ writer = $Writer.create();
95690
+ if (message.lockTime != null && Object.hasOwnProperty.call(message, "lockTime"))
95691
+ writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.lockTime);
95692
+ if (message.fee != null && Object.hasOwnProperty.call(message, "fee"))
95693
+ writer.uint32(/* id 2, wireType 0 =*/16).int64(message.fee);
95694
+ if (message.memo != null && Object.hasOwnProperty.call(message, "memo"))
95695
+ writer.uint32(/* id 3, wireType 2 =*/26).string(message.memo);
95696
+ if (message.transfer != null && Object.hasOwnProperty.call(message, "transfer"))
95697
+ $root.TW.Pactus.Proto.TransferPayload.encode(message.transfer, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim();
95698
+ if (message.bond != null && Object.hasOwnProperty.call(message, "bond"))
95699
+ $root.TW.Pactus.Proto.BondPayload.encode(message.bond, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim();
95700
+ return writer;
95701
+ };
95702
+
95703
+ /**
95704
+ * Decodes a TransactionMessage message from the specified reader or buffer.
95705
+ * @function decode
95706
+ * @memberof TW.Pactus.Proto.TransactionMessage
95707
+ * @static
95708
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
95709
+ * @param {number} [length] Message length if known beforehand
95710
+ * @returns {TW.Pactus.Proto.TransactionMessage} TransactionMessage
95711
+ * @throws {Error} If the payload is not a reader or valid buffer
95712
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
95713
+ */
95714
+ TransactionMessage.decode = function decode(reader, length) {
95715
+ if (!(reader instanceof $Reader))
95716
+ reader = $Reader.create(reader);
95717
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Pactus.Proto.TransactionMessage();
95718
+ while (reader.pos < end) {
95719
+ var tag = reader.uint32();
95720
+ switch (tag >>> 3) {
95721
+ case 1:
95722
+ message.lockTime = reader.uint32();
95723
+ break;
95724
+ case 2:
95725
+ message.fee = reader.int64();
95726
+ break;
95727
+ case 3:
95728
+ message.memo = reader.string();
95729
+ break;
95730
+ case 10:
95731
+ message.transfer = $root.TW.Pactus.Proto.TransferPayload.decode(reader, reader.uint32());
95732
+ break;
95733
+ case 11:
95734
+ message.bond = $root.TW.Pactus.Proto.BondPayload.decode(reader, reader.uint32());
95735
+ break;
95736
+ default:
95737
+ reader.skipType(tag & 7);
95738
+ break;
95739
+ }
95740
+ }
95741
+ return message;
95742
+ };
95743
+
95744
+ /**
95745
+ * Verifies a TransactionMessage message.
95746
+ * @function verify
95747
+ * @memberof TW.Pactus.Proto.TransactionMessage
95748
+ * @static
95749
+ * @param {Object.<string,*>} message Plain object to verify
95750
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
95751
+ */
95752
+ TransactionMessage.verify = function verify(message) {
95753
+ if (typeof message !== "object" || message === null)
95754
+ return "object expected";
95755
+ var properties = {};
95756
+ if (message.lockTime != null && message.hasOwnProperty("lockTime"))
95757
+ if (!$util.isInteger(message.lockTime))
95758
+ return "lockTime: integer expected";
95759
+ if (message.fee != null && message.hasOwnProperty("fee"))
95760
+ if (!$util.isInteger(message.fee) && !(message.fee && $util.isInteger(message.fee.low) && $util.isInteger(message.fee.high)))
95761
+ return "fee: integer|Long expected";
95762
+ if (message.memo != null && message.hasOwnProperty("memo"))
95763
+ if (!$util.isString(message.memo))
95764
+ return "memo: string expected";
95765
+ if (message.transfer != null && message.hasOwnProperty("transfer")) {
95766
+ properties.payload = 1;
95767
+ {
95768
+ var error = $root.TW.Pactus.Proto.TransferPayload.verify(message.transfer);
95769
+ if (error)
95770
+ return "transfer." + error;
95771
+ }
95772
+ }
95773
+ if (message.bond != null && message.hasOwnProperty("bond")) {
95774
+ if (properties.payload === 1)
95775
+ return "payload: multiple values";
95776
+ properties.payload = 1;
95777
+ {
95778
+ var error = $root.TW.Pactus.Proto.BondPayload.verify(message.bond);
95779
+ if (error)
95780
+ return "bond." + error;
95781
+ }
95782
+ }
95783
+ return null;
95784
+ };
95785
+
95786
+ /**
95787
+ * Creates a TransactionMessage message from a plain object. Also converts values to their respective internal types.
95788
+ * @function fromObject
95789
+ * @memberof TW.Pactus.Proto.TransactionMessage
95790
+ * @static
95791
+ * @param {Object.<string,*>} object Plain object
95792
+ * @returns {TW.Pactus.Proto.TransactionMessage} TransactionMessage
95793
+ */
95794
+ TransactionMessage.fromObject = function fromObject(object) {
95795
+ if (object instanceof $root.TW.Pactus.Proto.TransactionMessage)
95796
+ return object;
95797
+ var message = new $root.TW.Pactus.Proto.TransactionMessage();
95798
+ if (object.lockTime != null)
95799
+ message.lockTime = object.lockTime >>> 0;
95800
+ if (object.fee != null)
95801
+ if ($util.Long)
95802
+ (message.fee = $util.Long.fromValue(object.fee)).unsigned = false;
95803
+ else if (typeof object.fee === "string")
95804
+ message.fee = parseInt(object.fee, 10);
95805
+ else if (typeof object.fee === "number")
95806
+ message.fee = object.fee;
95807
+ else if (typeof object.fee === "object")
95808
+ message.fee = new $util.LongBits(object.fee.low >>> 0, object.fee.high >>> 0).toNumber();
95809
+ if (object.memo != null)
95810
+ message.memo = String(object.memo);
95811
+ if (object.transfer != null) {
95812
+ if (typeof object.transfer !== "object")
95813
+ throw TypeError(".TW.Pactus.Proto.TransactionMessage.transfer: object expected");
95814
+ message.transfer = $root.TW.Pactus.Proto.TransferPayload.fromObject(object.transfer);
95815
+ }
95816
+ if (object.bond != null) {
95817
+ if (typeof object.bond !== "object")
95818
+ throw TypeError(".TW.Pactus.Proto.TransactionMessage.bond: object expected");
95819
+ message.bond = $root.TW.Pactus.Proto.BondPayload.fromObject(object.bond);
95820
+ }
95821
+ return message;
95822
+ };
95823
+
95824
+ /**
95825
+ * Creates a plain object from a TransactionMessage message. Also converts values to other types if specified.
95826
+ * @function toObject
95827
+ * @memberof TW.Pactus.Proto.TransactionMessage
95828
+ * @static
95829
+ * @param {TW.Pactus.Proto.TransactionMessage} message TransactionMessage
95830
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
95831
+ * @returns {Object.<string,*>} Plain object
95832
+ */
95833
+ TransactionMessage.toObject = function toObject(message, options) {
95834
+ if (!options)
95835
+ options = {};
95836
+ var object = {};
95837
+ if (options.defaults) {
95838
+ object.lockTime = 0;
95839
+ if ($util.Long) {
95840
+ var long = new $util.Long(0, 0, false);
95841
+ object.fee = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
95842
+ } else
95843
+ object.fee = options.longs === String ? "0" : 0;
95844
+ object.memo = "";
95845
+ }
95846
+ if (message.lockTime != null && message.hasOwnProperty("lockTime"))
95847
+ object.lockTime = message.lockTime;
95848
+ if (message.fee != null && message.hasOwnProperty("fee"))
95849
+ if (typeof message.fee === "number")
95850
+ object.fee = options.longs === String ? String(message.fee) : message.fee;
95851
+ else
95852
+ object.fee = options.longs === String ? $util.Long.prototype.toString.call(message.fee) : options.longs === Number ? new $util.LongBits(message.fee.low >>> 0, message.fee.high >>> 0).toNumber() : message.fee;
95853
+ if (message.memo != null && message.hasOwnProperty("memo"))
95854
+ object.memo = message.memo;
95855
+ if (message.transfer != null && message.hasOwnProperty("transfer")) {
95856
+ object.transfer = $root.TW.Pactus.Proto.TransferPayload.toObject(message.transfer, options);
95857
+ if (options.oneofs)
95858
+ object.payload = "transfer";
95859
+ }
95860
+ if (message.bond != null && message.hasOwnProperty("bond")) {
95861
+ object.bond = $root.TW.Pactus.Proto.BondPayload.toObject(message.bond, options);
95862
+ if (options.oneofs)
95863
+ object.payload = "bond";
95864
+ }
95865
+ return object;
95866
+ };
95867
+
95868
+ /**
95869
+ * Converts this TransactionMessage to JSON.
95870
+ * @function toJSON
95871
+ * @memberof TW.Pactus.Proto.TransactionMessage
95872
+ * @instance
95873
+ * @returns {Object.<string,*>} JSON object
95874
+ */
95875
+ TransactionMessage.prototype.toJSON = function toJSON() {
95876
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
95877
+ };
95878
+
95879
+ return TransactionMessage;
95880
+ })();
95881
+
95882
+ Proto.TransferPayload = (function() {
95883
+
95884
+ /**
95885
+ * Properties of a TransferPayload.
95886
+ * @memberof TW.Pactus.Proto
95887
+ * @interface ITransferPayload
95888
+ * @property {string|null} [sender] TransferPayload sender
95889
+ * @property {string|null} [receiver] TransferPayload receiver
95890
+ * @property {Long|null} [amount] TransferPayload amount
95891
+ */
95892
+
95893
+ /**
95894
+ * Constructs a new TransferPayload.
95895
+ * @memberof TW.Pactus.Proto
95896
+ * @classdesc Represents a TransferPayload.
95897
+ * @implements ITransferPayload
95898
+ * @constructor
95899
+ * @param {TW.Pactus.Proto.ITransferPayload=} [properties] Properties to set
95900
+ */
95901
+ function TransferPayload(properties) {
95902
+ if (properties)
95903
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
95904
+ if (properties[keys[i]] != null)
95905
+ this[keys[i]] = properties[keys[i]];
95906
+ }
95907
+
95908
+ /**
95909
+ * TransferPayload sender.
95910
+ * @member {string} sender
95911
+ * @memberof TW.Pactus.Proto.TransferPayload
95912
+ * @instance
95913
+ */
95914
+ TransferPayload.prototype.sender = "";
95915
+
95916
+ /**
95917
+ * TransferPayload receiver.
95918
+ * @member {string} receiver
95919
+ * @memberof TW.Pactus.Proto.TransferPayload
95920
+ * @instance
95921
+ */
95922
+ TransferPayload.prototype.receiver = "";
95923
+
95924
+ /**
95925
+ * TransferPayload amount.
95926
+ * @member {Long} amount
95927
+ * @memberof TW.Pactus.Proto.TransferPayload
95928
+ * @instance
95929
+ */
95930
+ TransferPayload.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
95931
+
95932
+ /**
95933
+ * Creates a new TransferPayload instance using the specified properties.
95934
+ * @function create
95935
+ * @memberof TW.Pactus.Proto.TransferPayload
95936
+ * @static
95937
+ * @param {TW.Pactus.Proto.ITransferPayload=} [properties] Properties to set
95938
+ * @returns {TW.Pactus.Proto.TransferPayload} TransferPayload instance
95939
+ */
95940
+ TransferPayload.create = function create(properties) {
95941
+ return new TransferPayload(properties);
95942
+ };
95943
+
95944
+ /**
95945
+ * Encodes the specified TransferPayload message. Does not implicitly {@link TW.Pactus.Proto.TransferPayload.verify|verify} messages.
95946
+ * @function encode
95947
+ * @memberof TW.Pactus.Proto.TransferPayload
95948
+ * @static
95949
+ * @param {TW.Pactus.Proto.ITransferPayload} message TransferPayload message or plain object to encode
95950
+ * @param {$protobuf.Writer} [writer] Writer to encode to
95951
+ * @returns {$protobuf.Writer} Writer
95952
+ */
95953
+ TransferPayload.encode = function encode(message, writer) {
95954
+ if (!writer)
95955
+ writer = $Writer.create();
95956
+ if (message.sender != null && Object.hasOwnProperty.call(message, "sender"))
95957
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.sender);
95958
+ if (message.receiver != null && Object.hasOwnProperty.call(message, "receiver"))
95959
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.receiver);
95960
+ if (message.amount != null && Object.hasOwnProperty.call(message, "amount"))
95961
+ writer.uint32(/* id 3, wireType 0 =*/24).int64(message.amount);
95962
+ return writer;
95963
+ };
95964
+
95965
+ /**
95966
+ * Decodes a TransferPayload message from the specified reader or buffer.
95967
+ * @function decode
95968
+ * @memberof TW.Pactus.Proto.TransferPayload
95969
+ * @static
95970
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
95971
+ * @param {number} [length] Message length if known beforehand
95972
+ * @returns {TW.Pactus.Proto.TransferPayload} TransferPayload
95973
+ * @throws {Error} If the payload is not a reader or valid buffer
95974
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
95975
+ */
95976
+ TransferPayload.decode = function decode(reader, length) {
95977
+ if (!(reader instanceof $Reader))
95978
+ reader = $Reader.create(reader);
95979
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Pactus.Proto.TransferPayload();
95980
+ while (reader.pos < end) {
95981
+ var tag = reader.uint32();
95982
+ switch (tag >>> 3) {
95983
+ case 1:
95984
+ message.sender = reader.string();
95985
+ break;
95986
+ case 2:
95987
+ message.receiver = reader.string();
95988
+ break;
95989
+ case 3:
95990
+ message.amount = reader.int64();
95991
+ break;
95992
+ default:
95993
+ reader.skipType(tag & 7);
95994
+ break;
95995
+ }
95996
+ }
95997
+ return message;
95998
+ };
95999
+
96000
+ /**
96001
+ * Verifies a TransferPayload message.
96002
+ * @function verify
96003
+ * @memberof TW.Pactus.Proto.TransferPayload
96004
+ * @static
96005
+ * @param {Object.<string,*>} message Plain object to verify
96006
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
96007
+ */
96008
+ TransferPayload.verify = function verify(message) {
96009
+ if (typeof message !== "object" || message === null)
96010
+ return "object expected";
96011
+ if (message.sender != null && message.hasOwnProperty("sender"))
96012
+ if (!$util.isString(message.sender))
96013
+ return "sender: string expected";
96014
+ if (message.receiver != null && message.hasOwnProperty("receiver"))
96015
+ if (!$util.isString(message.receiver))
96016
+ return "receiver: string expected";
96017
+ if (message.amount != null && message.hasOwnProperty("amount"))
96018
+ if (!$util.isInteger(message.amount) && !(message.amount && $util.isInteger(message.amount.low) && $util.isInteger(message.amount.high)))
96019
+ return "amount: integer|Long expected";
96020
+ return null;
96021
+ };
96022
+
96023
+ /**
96024
+ * Creates a TransferPayload message from a plain object. Also converts values to their respective internal types.
96025
+ * @function fromObject
96026
+ * @memberof TW.Pactus.Proto.TransferPayload
96027
+ * @static
96028
+ * @param {Object.<string,*>} object Plain object
96029
+ * @returns {TW.Pactus.Proto.TransferPayload} TransferPayload
96030
+ */
96031
+ TransferPayload.fromObject = function fromObject(object) {
96032
+ if (object instanceof $root.TW.Pactus.Proto.TransferPayload)
96033
+ return object;
96034
+ var message = new $root.TW.Pactus.Proto.TransferPayload();
96035
+ if (object.sender != null)
96036
+ message.sender = String(object.sender);
96037
+ if (object.receiver != null)
96038
+ message.receiver = String(object.receiver);
96039
+ if (object.amount != null)
96040
+ if ($util.Long)
96041
+ (message.amount = $util.Long.fromValue(object.amount)).unsigned = false;
96042
+ else if (typeof object.amount === "string")
96043
+ message.amount = parseInt(object.amount, 10);
96044
+ else if (typeof object.amount === "number")
96045
+ message.amount = object.amount;
96046
+ else if (typeof object.amount === "object")
96047
+ message.amount = new $util.LongBits(object.amount.low >>> 0, object.amount.high >>> 0).toNumber();
96048
+ return message;
96049
+ };
96050
+
96051
+ /**
96052
+ * Creates a plain object from a TransferPayload message. Also converts values to other types if specified.
96053
+ * @function toObject
96054
+ * @memberof TW.Pactus.Proto.TransferPayload
96055
+ * @static
96056
+ * @param {TW.Pactus.Proto.TransferPayload} message TransferPayload
96057
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
96058
+ * @returns {Object.<string,*>} Plain object
96059
+ */
96060
+ TransferPayload.toObject = function toObject(message, options) {
96061
+ if (!options)
96062
+ options = {};
96063
+ var object = {};
96064
+ if (options.defaults) {
96065
+ object.sender = "";
96066
+ object.receiver = "";
96067
+ if ($util.Long) {
96068
+ var long = new $util.Long(0, 0, false);
96069
+ object.amount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
96070
+ } else
96071
+ object.amount = options.longs === String ? "0" : 0;
96072
+ }
96073
+ if (message.sender != null && message.hasOwnProperty("sender"))
96074
+ object.sender = message.sender;
96075
+ if (message.receiver != null && message.hasOwnProperty("receiver"))
96076
+ object.receiver = message.receiver;
96077
+ if (message.amount != null && message.hasOwnProperty("amount"))
96078
+ if (typeof message.amount === "number")
96079
+ object.amount = options.longs === String ? String(message.amount) : message.amount;
96080
+ else
96081
+ object.amount = options.longs === String ? $util.Long.prototype.toString.call(message.amount) : options.longs === Number ? new $util.LongBits(message.amount.low >>> 0, message.amount.high >>> 0).toNumber() : message.amount;
96082
+ return object;
96083
+ };
96084
+
96085
+ /**
96086
+ * Converts this TransferPayload to JSON.
96087
+ * @function toJSON
96088
+ * @memberof TW.Pactus.Proto.TransferPayload
96089
+ * @instance
96090
+ * @returns {Object.<string,*>} JSON object
96091
+ */
96092
+ TransferPayload.prototype.toJSON = function toJSON() {
96093
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
96094
+ };
96095
+
96096
+ return TransferPayload;
96097
+ })();
96098
+
96099
+ Proto.BondPayload = (function() {
96100
+
96101
+ /**
96102
+ * Properties of a BondPayload.
96103
+ * @memberof TW.Pactus.Proto
96104
+ * @interface IBondPayload
96105
+ * @property {string|null} [sender] BondPayload sender
96106
+ * @property {string|null} [receiver] BondPayload receiver
96107
+ * @property {Long|null} [stake] BondPayload stake
96108
+ * @property {string|null} [publicKey] BondPayload publicKey
96109
+ */
96110
+
96111
+ /**
96112
+ * Constructs a new BondPayload.
96113
+ * @memberof TW.Pactus.Proto
96114
+ * @classdesc Represents a BondPayload.
96115
+ * @implements IBondPayload
96116
+ * @constructor
96117
+ * @param {TW.Pactus.Proto.IBondPayload=} [properties] Properties to set
96118
+ */
96119
+ function BondPayload(properties) {
96120
+ if (properties)
96121
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
96122
+ if (properties[keys[i]] != null)
96123
+ this[keys[i]] = properties[keys[i]];
96124
+ }
96125
+
96126
+ /**
96127
+ * BondPayload sender.
96128
+ * @member {string} sender
96129
+ * @memberof TW.Pactus.Proto.BondPayload
96130
+ * @instance
96131
+ */
96132
+ BondPayload.prototype.sender = "";
96133
+
96134
+ /**
96135
+ * BondPayload receiver.
96136
+ * @member {string} receiver
96137
+ * @memberof TW.Pactus.Proto.BondPayload
96138
+ * @instance
96139
+ */
96140
+ BondPayload.prototype.receiver = "";
96141
+
96142
+ /**
96143
+ * BondPayload stake.
96144
+ * @member {Long} stake
96145
+ * @memberof TW.Pactus.Proto.BondPayload
96146
+ * @instance
96147
+ */
96148
+ BondPayload.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
96149
+
96150
+ /**
96151
+ * BondPayload publicKey.
96152
+ * @member {string} publicKey
96153
+ * @memberof TW.Pactus.Proto.BondPayload
96154
+ * @instance
96155
+ */
96156
+ BondPayload.prototype.publicKey = "";
96157
+
96158
+ /**
96159
+ * Creates a new BondPayload instance using the specified properties.
96160
+ * @function create
96161
+ * @memberof TW.Pactus.Proto.BondPayload
96162
+ * @static
96163
+ * @param {TW.Pactus.Proto.IBondPayload=} [properties] Properties to set
96164
+ * @returns {TW.Pactus.Proto.BondPayload} BondPayload instance
96165
+ */
96166
+ BondPayload.create = function create(properties) {
96167
+ return new BondPayload(properties);
96168
+ };
96169
+
96170
+ /**
96171
+ * Encodes the specified BondPayload message. Does not implicitly {@link TW.Pactus.Proto.BondPayload.verify|verify} messages.
96172
+ * @function encode
96173
+ * @memberof TW.Pactus.Proto.BondPayload
96174
+ * @static
96175
+ * @param {TW.Pactus.Proto.IBondPayload} message BondPayload message or plain object to encode
96176
+ * @param {$protobuf.Writer} [writer] Writer to encode to
96177
+ * @returns {$protobuf.Writer} Writer
96178
+ */
96179
+ BondPayload.encode = function encode(message, writer) {
96180
+ if (!writer)
96181
+ writer = $Writer.create();
96182
+ if (message.sender != null && Object.hasOwnProperty.call(message, "sender"))
96183
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.sender);
96184
+ if (message.receiver != null && Object.hasOwnProperty.call(message, "receiver"))
96185
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.receiver);
96186
+ if (message.stake != null && Object.hasOwnProperty.call(message, "stake"))
96187
+ writer.uint32(/* id 3, wireType 0 =*/24).int64(message.stake);
96188
+ if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey"))
96189
+ writer.uint32(/* id 4, wireType 2 =*/34).string(message.publicKey);
96190
+ return writer;
96191
+ };
96192
+
96193
+ /**
96194
+ * Decodes a BondPayload message from the specified reader or buffer.
96195
+ * @function decode
96196
+ * @memberof TW.Pactus.Proto.BondPayload
96197
+ * @static
96198
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
96199
+ * @param {number} [length] Message length if known beforehand
96200
+ * @returns {TW.Pactus.Proto.BondPayload} BondPayload
96201
+ * @throws {Error} If the payload is not a reader or valid buffer
96202
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
96203
+ */
96204
+ BondPayload.decode = function decode(reader, length) {
96205
+ if (!(reader instanceof $Reader))
96206
+ reader = $Reader.create(reader);
96207
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Pactus.Proto.BondPayload();
96208
+ while (reader.pos < end) {
96209
+ var tag = reader.uint32();
96210
+ switch (tag >>> 3) {
96211
+ case 1:
96212
+ message.sender = reader.string();
96213
+ break;
96214
+ case 2:
96215
+ message.receiver = reader.string();
96216
+ break;
96217
+ case 3:
96218
+ message.stake = reader.int64();
96219
+ break;
96220
+ case 4:
96221
+ message.publicKey = reader.string();
96222
+ break;
96223
+ default:
96224
+ reader.skipType(tag & 7);
96225
+ break;
96226
+ }
96227
+ }
96228
+ return message;
96229
+ };
96230
+
96231
+ /**
96232
+ * Verifies a BondPayload message.
96233
+ * @function verify
96234
+ * @memberof TW.Pactus.Proto.BondPayload
96235
+ * @static
96236
+ * @param {Object.<string,*>} message Plain object to verify
96237
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
96238
+ */
96239
+ BondPayload.verify = function verify(message) {
96240
+ if (typeof message !== "object" || message === null)
96241
+ return "object expected";
96242
+ if (message.sender != null && message.hasOwnProperty("sender"))
96243
+ if (!$util.isString(message.sender))
96244
+ return "sender: string expected";
96245
+ if (message.receiver != null && message.hasOwnProperty("receiver"))
96246
+ if (!$util.isString(message.receiver))
96247
+ return "receiver: string expected";
96248
+ if (message.stake != null && message.hasOwnProperty("stake"))
96249
+ if (!$util.isInteger(message.stake) && !(message.stake && $util.isInteger(message.stake.low) && $util.isInteger(message.stake.high)))
96250
+ return "stake: integer|Long expected";
96251
+ if (message.publicKey != null && message.hasOwnProperty("publicKey"))
96252
+ if (!$util.isString(message.publicKey))
96253
+ return "publicKey: string expected";
96254
+ return null;
96255
+ };
96256
+
96257
+ /**
96258
+ * Creates a BondPayload message from a plain object. Also converts values to their respective internal types.
96259
+ * @function fromObject
96260
+ * @memberof TW.Pactus.Proto.BondPayload
96261
+ * @static
96262
+ * @param {Object.<string,*>} object Plain object
96263
+ * @returns {TW.Pactus.Proto.BondPayload} BondPayload
96264
+ */
96265
+ BondPayload.fromObject = function fromObject(object) {
96266
+ if (object instanceof $root.TW.Pactus.Proto.BondPayload)
96267
+ return object;
96268
+ var message = new $root.TW.Pactus.Proto.BondPayload();
96269
+ if (object.sender != null)
96270
+ message.sender = String(object.sender);
96271
+ if (object.receiver != null)
96272
+ message.receiver = String(object.receiver);
96273
+ if (object.stake != null)
96274
+ if ($util.Long)
96275
+ (message.stake = $util.Long.fromValue(object.stake)).unsigned = false;
96276
+ else if (typeof object.stake === "string")
96277
+ message.stake = parseInt(object.stake, 10);
96278
+ else if (typeof object.stake === "number")
96279
+ message.stake = object.stake;
96280
+ else if (typeof object.stake === "object")
96281
+ message.stake = new $util.LongBits(object.stake.low >>> 0, object.stake.high >>> 0).toNumber();
96282
+ if (object.publicKey != null)
96283
+ message.publicKey = String(object.publicKey);
96284
+ return message;
96285
+ };
96286
+
96287
+ /**
96288
+ * Creates a plain object from a BondPayload message. Also converts values to other types if specified.
96289
+ * @function toObject
96290
+ * @memberof TW.Pactus.Proto.BondPayload
96291
+ * @static
96292
+ * @param {TW.Pactus.Proto.BondPayload} message BondPayload
96293
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
96294
+ * @returns {Object.<string,*>} Plain object
96295
+ */
96296
+ BondPayload.toObject = function toObject(message, options) {
96297
+ if (!options)
96298
+ options = {};
96299
+ var object = {};
96300
+ if (options.defaults) {
96301
+ object.sender = "";
96302
+ object.receiver = "";
96303
+ if ($util.Long) {
96304
+ var long = new $util.Long(0, 0, false);
96305
+ object.stake = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
96306
+ } else
96307
+ object.stake = options.longs === String ? "0" : 0;
96308
+ object.publicKey = "";
96309
+ }
96310
+ if (message.sender != null && message.hasOwnProperty("sender"))
96311
+ object.sender = message.sender;
96312
+ if (message.receiver != null && message.hasOwnProperty("receiver"))
96313
+ object.receiver = message.receiver;
96314
+ if (message.stake != null && message.hasOwnProperty("stake"))
96315
+ if (typeof message.stake === "number")
96316
+ object.stake = options.longs === String ? String(message.stake) : message.stake;
96317
+ else
96318
+ object.stake = options.longs === String ? $util.Long.prototype.toString.call(message.stake) : options.longs === Number ? new $util.LongBits(message.stake.low >>> 0, message.stake.high >>> 0).toNumber() : message.stake;
96319
+ if (message.publicKey != null && message.hasOwnProperty("publicKey"))
96320
+ object.publicKey = message.publicKey;
96321
+ return object;
96322
+ };
96323
+
96324
+ /**
96325
+ * Converts this BondPayload to JSON.
94662
96326
  * @function toJSON
94663
- * @memberof TW.Oasis.Proto.SigningOutput
96327
+ * @memberof TW.Pactus.Proto.BondPayload
94664
96328
  * @instance
94665
96329
  * @returns {Object.<string,*>} JSON object
94666
96330
  */
94667
- SigningOutput.prototype.toJSON = function toJSON() {
96331
+ BondPayload.prototype.toJSON = function toJSON() {
94668
96332
  return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
94669
96333
  };
94670
96334
 
94671
- return SigningOutput;
96335
+ return BondPayload;
94672
96336
  })();
94673
96337
 
94674
- return Proto;
94675
- })();
94676
-
94677
- return Oasis;
94678
- })();
94679
-
94680
- TW.Ontology = (function() {
94681
-
94682
- /**
94683
- * Namespace Ontology.
94684
- * @memberof TW
94685
- * @namespace
94686
- */
94687
- var Ontology = {};
94688
-
94689
- Ontology.Proto = (function() {
94690
-
94691
- /**
94692
- * Namespace Proto.
94693
- * @memberof TW.Ontology
94694
- * @namespace
94695
- */
94696
- var Proto = {};
94697
-
94698
96338
  Proto.SigningInput = (function() {
94699
96339
 
94700
96340
  /**
94701
96341
  * Properties of a SigningInput.
94702
- * @memberof TW.Ontology.Proto
96342
+ * @memberof TW.Pactus.Proto
94703
96343
  * @interface ISigningInput
94704
- * @property {string|null} [contract] SigningInput contract
94705
- * @property {string|null} [method] SigningInput method
94706
- * @property {Uint8Array|null} [ownerPrivateKey] SigningInput ownerPrivateKey
94707
- * @property {string|null} [toAddress] SigningInput toAddress
94708
- * @property {Long|null} [amount] SigningInput amount
94709
- * @property {Uint8Array|null} [payerPrivateKey] SigningInput payerPrivateKey
94710
- * @property {Long|null} [gasPrice] SigningInput gasPrice
94711
- * @property {Long|null} [gasLimit] SigningInput gasLimit
94712
- * @property {string|null} [queryAddress] SigningInput queryAddress
94713
- * @property {number|null} [nonce] SigningInput nonce
94714
- * @property {string|null} [ownerAddress] SigningInput ownerAddress
94715
- * @property {string|null} [payerAddress] SigningInput payerAddress
96344
+ * @property {Uint8Array|null} [privateKey] SigningInput privateKey
96345
+ * @property {TW.Pactus.Proto.ITransactionMessage|null} [transaction] SigningInput transaction
94716
96346
  */
94717
96347
 
94718
96348
  /**
94719
96349
  * Constructs a new SigningInput.
94720
- * @memberof TW.Ontology.Proto
96350
+ * @memberof TW.Pactus.Proto
94721
96351
  * @classdesc Represents a SigningInput.
94722
96352
  * @implements ISigningInput
94723
96353
  * @constructor
94724
- * @param {TW.Ontology.Proto.ISigningInput=} [properties] Properties to set
96354
+ * @param {TW.Pactus.Proto.ISigningInput=} [properties] Properties to set
94725
96355
  */
94726
96356
  function SigningInput(properties) {
94727
96357
  if (properties)
@@ -94731,205 +96361,75 @@
94731
96361
  }
94732
96362
 
94733
96363
  /**
94734
- * SigningInput contract.
94735
- * @member {string} contract
94736
- * @memberof TW.Ontology.Proto.SigningInput
94737
- * @instance
94738
- */
94739
- SigningInput.prototype.contract = "";
94740
-
94741
- /**
94742
- * SigningInput method.
94743
- * @member {string} method
94744
- * @memberof TW.Ontology.Proto.SigningInput
94745
- * @instance
94746
- */
94747
- SigningInput.prototype.method = "";
94748
-
94749
- /**
94750
- * SigningInput ownerPrivateKey.
94751
- * @member {Uint8Array} ownerPrivateKey
94752
- * @memberof TW.Ontology.Proto.SigningInput
94753
- * @instance
94754
- */
94755
- SigningInput.prototype.ownerPrivateKey = $util.newBuffer([]);
94756
-
94757
- /**
94758
- * SigningInput toAddress.
94759
- * @member {string} toAddress
94760
- * @memberof TW.Ontology.Proto.SigningInput
94761
- * @instance
94762
- */
94763
- SigningInput.prototype.toAddress = "";
94764
-
94765
- /**
94766
- * SigningInput amount.
94767
- * @member {Long} amount
94768
- * @memberof TW.Ontology.Proto.SigningInput
94769
- * @instance
94770
- */
94771
- SigningInput.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
94772
-
94773
- /**
94774
- * SigningInput payerPrivateKey.
94775
- * @member {Uint8Array} payerPrivateKey
94776
- * @memberof TW.Ontology.Proto.SigningInput
94777
- * @instance
94778
- */
94779
- SigningInput.prototype.payerPrivateKey = $util.newBuffer([]);
94780
-
94781
- /**
94782
- * SigningInput gasPrice.
94783
- * @member {Long} gasPrice
94784
- * @memberof TW.Ontology.Proto.SigningInput
94785
- * @instance
94786
- */
94787
- SigningInput.prototype.gasPrice = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
94788
-
94789
- /**
94790
- * SigningInput gasLimit.
94791
- * @member {Long} gasLimit
94792
- * @memberof TW.Ontology.Proto.SigningInput
94793
- * @instance
94794
- */
94795
- SigningInput.prototype.gasLimit = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
94796
-
94797
- /**
94798
- * SigningInput queryAddress.
94799
- * @member {string} queryAddress
94800
- * @memberof TW.Ontology.Proto.SigningInput
94801
- * @instance
94802
- */
94803
- SigningInput.prototype.queryAddress = "";
94804
-
94805
- /**
94806
- * SigningInput nonce.
94807
- * @member {number} nonce
94808
- * @memberof TW.Ontology.Proto.SigningInput
94809
- * @instance
94810
- */
94811
- SigningInput.prototype.nonce = 0;
94812
-
94813
- /**
94814
- * SigningInput ownerAddress.
94815
- * @member {string} ownerAddress
94816
- * @memberof TW.Ontology.Proto.SigningInput
96364
+ * SigningInput privateKey.
96365
+ * @member {Uint8Array} privateKey
96366
+ * @memberof TW.Pactus.Proto.SigningInput
94817
96367
  * @instance
94818
96368
  */
94819
- SigningInput.prototype.ownerAddress = "";
96369
+ SigningInput.prototype.privateKey = $util.newBuffer([]);
94820
96370
 
94821
96371
  /**
94822
- * SigningInput payerAddress.
94823
- * @member {string} payerAddress
94824
- * @memberof TW.Ontology.Proto.SigningInput
96372
+ * SigningInput transaction.
96373
+ * @member {TW.Pactus.Proto.ITransactionMessage|null|undefined} transaction
96374
+ * @memberof TW.Pactus.Proto.SigningInput
94825
96375
  * @instance
94826
96376
  */
94827
- SigningInput.prototype.payerAddress = "";
96377
+ SigningInput.prototype.transaction = null;
94828
96378
 
94829
96379
  /**
94830
96380
  * Creates a new SigningInput instance using the specified properties.
94831
96381
  * @function create
94832
- * @memberof TW.Ontology.Proto.SigningInput
96382
+ * @memberof TW.Pactus.Proto.SigningInput
94833
96383
  * @static
94834
- * @param {TW.Ontology.Proto.ISigningInput=} [properties] Properties to set
94835
- * @returns {TW.Ontology.Proto.SigningInput} SigningInput instance
96384
+ * @param {TW.Pactus.Proto.ISigningInput=} [properties] Properties to set
96385
+ * @returns {TW.Pactus.Proto.SigningInput} SigningInput instance
94836
96386
  */
94837
96387
  SigningInput.create = function create(properties) {
94838
96388
  return new SigningInput(properties);
94839
96389
  };
94840
96390
 
94841
96391
  /**
94842
- * Encodes the specified SigningInput message. Does not implicitly {@link TW.Ontology.Proto.SigningInput.verify|verify} messages.
96392
+ * Encodes the specified SigningInput message. Does not implicitly {@link TW.Pactus.Proto.SigningInput.verify|verify} messages.
94843
96393
  * @function encode
94844
- * @memberof TW.Ontology.Proto.SigningInput
96394
+ * @memberof TW.Pactus.Proto.SigningInput
94845
96395
  * @static
94846
- * @param {TW.Ontology.Proto.ISigningInput} message SigningInput message or plain object to encode
96396
+ * @param {TW.Pactus.Proto.ISigningInput} message SigningInput message or plain object to encode
94847
96397
  * @param {$protobuf.Writer} [writer] Writer to encode to
94848
96398
  * @returns {$protobuf.Writer} Writer
94849
96399
  */
94850
96400
  SigningInput.encode = function encode(message, writer) {
94851
96401
  if (!writer)
94852
96402
  writer = $Writer.create();
94853
- if (message.contract != null && Object.hasOwnProperty.call(message, "contract"))
94854
- writer.uint32(/* id 1, wireType 2 =*/10).string(message.contract);
94855
- if (message.method != null && Object.hasOwnProperty.call(message, "method"))
94856
- writer.uint32(/* id 2, wireType 2 =*/18).string(message.method);
94857
- if (message.ownerPrivateKey != null && Object.hasOwnProperty.call(message, "ownerPrivateKey"))
94858
- writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.ownerPrivateKey);
94859
- if (message.toAddress != null && Object.hasOwnProperty.call(message, "toAddress"))
94860
- writer.uint32(/* id 4, wireType 2 =*/34).string(message.toAddress);
94861
- if (message.amount != null && Object.hasOwnProperty.call(message, "amount"))
94862
- writer.uint32(/* id 5, wireType 0 =*/40).uint64(message.amount);
94863
- if (message.payerPrivateKey != null && Object.hasOwnProperty.call(message, "payerPrivateKey"))
94864
- writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.payerPrivateKey);
94865
- if (message.gasPrice != null && Object.hasOwnProperty.call(message, "gasPrice"))
94866
- writer.uint32(/* id 7, wireType 0 =*/56).uint64(message.gasPrice);
94867
- if (message.gasLimit != null && Object.hasOwnProperty.call(message, "gasLimit"))
94868
- writer.uint32(/* id 8, wireType 0 =*/64).uint64(message.gasLimit);
94869
- if (message.queryAddress != null && Object.hasOwnProperty.call(message, "queryAddress"))
94870
- writer.uint32(/* id 9, wireType 2 =*/74).string(message.queryAddress);
94871
- if (message.nonce != null && Object.hasOwnProperty.call(message, "nonce"))
94872
- writer.uint32(/* id 10, wireType 0 =*/80).uint32(message.nonce);
94873
- if (message.ownerAddress != null && Object.hasOwnProperty.call(message, "ownerAddress"))
94874
- writer.uint32(/* id 11, wireType 2 =*/90).string(message.ownerAddress);
94875
- if (message.payerAddress != null && Object.hasOwnProperty.call(message, "payerAddress"))
94876
- writer.uint32(/* id 12, wireType 2 =*/98).string(message.payerAddress);
96403
+ if (message.privateKey != null && Object.hasOwnProperty.call(message, "privateKey"))
96404
+ writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.privateKey);
96405
+ if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction"))
96406
+ $root.TW.Pactus.Proto.TransactionMessage.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
94877
96407
  return writer;
94878
96408
  };
94879
96409
 
94880
96410
  /**
94881
96411
  * Decodes a SigningInput message from the specified reader or buffer.
94882
96412
  * @function decode
94883
- * @memberof TW.Ontology.Proto.SigningInput
96413
+ * @memberof TW.Pactus.Proto.SigningInput
94884
96414
  * @static
94885
96415
  * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
94886
96416
  * @param {number} [length] Message length if known beforehand
94887
- * @returns {TW.Ontology.Proto.SigningInput} SigningInput
96417
+ * @returns {TW.Pactus.Proto.SigningInput} SigningInput
94888
96418
  * @throws {Error} If the payload is not a reader or valid buffer
94889
96419
  * @throws {$protobuf.util.ProtocolError} If required fields are missing
94890
96420
  */
94891
96421
  SigningInput.decode = function decode(reader, length) {
94892
96422
  if (!(reader instanceof $Reader))
94893
96423
  reader = $Reader.create(reader);
94894
- var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Ontology.Proto.SigningInput();
96424
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Pactus.Proto.SigningInput();
94895
96425
  while (reader.pos < end) {
94896
96426
  var tag = reader.uint32();
94897
96427
  switch (tag >>> 3) {
94898
96428
  case 1:
94899
- message.contract = reader.string();
96429
+ message.privateKey = reader.bytes();
94900
96430
  break;
94901
96431
  case 2:
94902
- message.method = reader.string();
94903
- break;
94904
- case 3:
94905
- message.ownerPrivateKey = reader.bytes();
94906
- break;
94907
- case 4:
94908
- message.toAddress = reader.string();
94909
- break;
94910
- case 5:
94911
- message.amount = reader.uint64();
94912
- break;
94913
- case 6:
94914
- message.payerPrivateKey = reader.bytes();
94915
- break;
94916
- case 7:
94917
- message.gasPrice = reader.uint64();
94918
- break;
94919
- case 8:
94920
- message.gasLimit = reader.uint64();
94921
- break;
94922
- case 9:
94923
- message.queryAddress = reader.string();
94924
- break;
94925
- case 10:
94926
- message.nonce = reader.uint32();
94927
- break;
94928
- case 11:
94929
- message.ownerAddress = reader.string();
94930
- break;
94931
- case 12:
94932
- message.payerAddress = reader.string();
96432
+ message.transaction = $root.TW.Pactus.Proto.TransactionMessage.decode(reader, reader.uint32());
94933
96433
  break;
94934
96434
  default:
94935
96435
  reader.skipType(tag & 7);
@@ -94942,7 +96442,7 @@
94942
96442
  /**
94943
96443
  * Verifies a SigningInput message.
94944
96444
  * @function verify
94945
- * @memberof TW.Ontology.Proto.SigningInput
96445
+ * @memberof TW.Pactus.Proto.SigningInput
94946
96446
  * @static
94947
96447
  * @param {Object.<string,*>} message Plain object to verify
94948
96448
  * @returns {string|null} `null` if valid, otherwise the reason why it is not
@@ -94950,117 +96450,48 @@
94950
96450
  SigningInput.verify = function verify(message) {
94951
96451
  if (typeof message !== "object" || message === null)
94952
96452
  return "object expected";
94953
- if (message.contract != null && message.hasOwnProperty("contract"))
94954
- if (!$util.isString(message.contract))
94955
- return "contract: string expected";
94956
- if (message.method != null && message.hasOwnProperty("method"))
94957
- if (!$util.isString(message.method))
94958
- return "method: string expected";
94959
- if (message.ownerPrivateKey != null && message.hasOwnProperty("ownerPrivateKey"))
94960
- if (!(message.ownerPrivateKey && typeof message.ownerPrivateKey.length === "number" || $util.isString(message.ownerPrivateKey)))
94961
- return "ownerPrivateKey: buffer expected";
94962
- if (message.toAddress != null && message.hasOwnProperty("toAddress"))
94963
- if (!$util.isString(message.toAddress))
94964
- return "toAddress: string expected";
94965
- if (message.amount != null && message.hasOwnProperty("amount"))
94966
- if (!$util.isInteger(message.amount) && !(message.amount && $util.isInteger(message.amount.low) && $util.isInteger(message.amount.high)))
94967
- return "amount: integer|Long expected";
94968
- if (message.payerPrivateKey != null && message.hasOwnProperty("payerPrivateKey"))
94969
- if (!(message.payerPrivateKey && typeof message.payerPrivateKey.length === "number" || $util.isString(message.payerPrivateKey)))
94970
- return "payerPrivateKey: buffer expected";
94971
- if (message.gasPrice != null && message.hasOwnProperty("gasPrice"))
94972
- if (!$util.isInteger(message.gasPrice) && !(message.gasPrice && $util.isInteger(message.gasPrice.low) && $util.isInteger(message.gasPrice.high)))
94973
- return "gasPrice: integer|Long expected";
94974
- if (message.gasLimit != null && message.hasOwnProperty("gasLimit"))
94975
- if (!$util.isInteger(message.gasLimit) && !(message.gasLimit && $util.isInteger(message.gasLimit.low) && $util.isInteger(message.gasLimit.high)))
94976
- return "gasLimit: integer|Long expected";
94977
- if (message.queryAddress != null && message.hasOwnProperty("queryAddress"))
94978
- if (!$util.isString(message.queryAddress))
94979
- return "queryAddress: string expected";
94980
- if (message.nonce != null && message.hasOwnProperty("nonce"))
94981
- if (!$util.isInteger(message.nonce))
94982
- return "nonce: integer expected";
94983
- if (message.ownerAddress != null && message.hasOwnProperty("ownerAddress"))
94984
- if (!$util.isString(message.ownerAddress))
94985
- return "ownerAddress: string expected";
94986
- if (message.payerAddress != null && message.hasOwnProperty("payerAddress"))
94987
- if (!$util.isString(message.payerAddress))
94988
- return "payerAddress: string expected";
96453
+ if (message.privateKey != null && message.hasOwnProperty("privateKey"))
96454
+ if (!(message.privateKey && typeof message.privateKey.length === "number" || $util.isString(message.privateKey)))
96455
+ return "privateKey: buffer expected";
96456
+ if (message.transaction != null && message.hasOwnProperty("transaction")) {
96457
+ var error = $root.TW.Pactus.Proto.TransactionMessage.verify(message.transaction);
96458
+ if (error)
96459
+ return "transaction." + error;
96460
+ }
94989
96461
  return null;
94990
96462
  };
94991
96463
 
94992
96464
  /**
94993
96465
  * Creates a SigningInput message from a plain object. Also converts values to their respective internal types.
94994
96466
  * @function fromObject
94995
- * @memberof TW.Ontology.Proto.SigningInput
96467
+ * @memberof TW.Pactus.Proto.SigningInput
94996
96468
  * @static
94997
96469
  * @param {Object.<string,*>} object Plain object
94998
- * @returns {TW.Ontology.Proto.SigningInput} SigningInput
96470
+ * @returns {TW.Pactus.Proto.SigningInput} SigningInput
94999
96471
  */
95000
96472
  SigningInput.fromObject = function fromObject(object) {
95001
- if (object instanceof $root.TW.Ontology.Proto.SigningInput)
96473
+ if (object instanceof $root.TW.Pactus.Proto.SigningInput)
95002
96474
  return object;
95003
- var message = new $root.TW.Ontology.Proto.SigningInput();
95004
- if (object.contract != null)
95005
- message.contract = String(object.contract);
95006
- if (object.method != null)
95007
- message.method = String(object.method);
95008
- if (object.ownerPrivateKey != null)
95009
- if (typeof object.ownerPrivateKey === "string")
95010
- $util.base64.decode(object.ownerPrivateKey, message.ownerPrivateKey = $util.newBuffer($util.base64.length(object.ownerPrivateKey)), 0);
95011
- else if (object.ownerPrivateKey.length)
95012
- message.ownerPrivateKey = object.ownerPrivateKey;
95013
- if (object.toAddress != null)
95014
- message.toAddress = String(object.toAddress);
95015
- if (object.amount != null)
95016
- if ($util.Long)
95017
- (message.amount = $util.Long.fromValue(object.amount)).unsigned = true;
95018
- else if (typeof object.amount === "string")
95019
- message.amount = parseInt(object.amount, 10);
95020
- else if (typeof object.amount === "number")
95021
- message.amount = object.amount;
95022
- else if (typeof object.amount === "object")
95023
- message.amount = new $util.LongBits(object.amount.low >>> 0, object.amount.high >>> 0).toNumber(true);
95024
- if (object.payerPrivateKey != null)
95025
- if (typeof object.payerPrivateKey === "string")
95026
- $util.base64.decode(object.payerPrivateKey, message.payerPrivateKey = $util.newBuffer($util.base64.length(object.payerPrivateKey)), 0);
95027
- else if (object.payerPrivateKey.length)
95028
- message.payerPrivateKey = object.payerPrivateKey;
95029
- if (object.gasPrice != null)
95030
- if ($util.Long)
95031
- (message.gasPrice = $util.Long.fromValue(object.gasPrice)).unsigned = true;
95032
- else if (typeof object.gasPrice === "string")
95033
- message.gasPrice = parseInt(object.gasPrice, 10);
95034
- else if (typeof object.gasPrice === "number")
95035
- message.gasPrice = object.gasPrice;
95036
- else if (typeof object.gasPrice === "object")
95037
- message.gasPrice = new $util.LongBits(object.gasPrice.low >>> 0, object.gasPrice.high >>> 0).toNumber(true);
95038
- if (object.gasLimit != null)
95039
- if ($util.Long)
95040
- (message.gasLimit = $util.Long.fromValue(object.gasLimit)).unsigned = true;
95041
- else if (typeof object.gasLimit === "string")
95042
- message.gasLimit = parseInt(object.gasLimit, 10);
95043
- else if (typeof object.gasLimit === "number")
95044
- message.gasLimit = object.gasLimit;
95045
- else if (typeof object.gasLimit === "object")
95046
- message.gasLimit = new $util.LongBits(object.gasLimit.low >>> 0, object.gasLimit.high >>> 0).toNumber(true);
95047
- if (object.queryAddress != null)
95048
- message.queryAddress = String(object.queryAddress);
95049
- if (object.nonce != null)
95050
- message.nonce = object.nonce >>> 0;
95051
- if (object.ownerAddress != null)
95052
- message.ownerAddress = String(object.ownerAddress);
95053
- if (object.payerAddress != null)
95054
- message.payerAddress = String(object.payerAddress);
96475
+ var message = new $root.TW.Pactus.Proto.SigningInput();
96476
+ if (object.privateKey != null)
96477
+ if (typeof object.privateKey === "string")
96478
+ $util.base64.decode(object.privateKey, message.privateKey = $util.newBuffer($util.base64.length(object.privateKey)), 0);
96479
+ else if (object.privateKey.length)
96480
+ message.privateKey = object.privateKey;
96481
+ if (object.transaction != null) {
96482
+ if (typeof object.transaction !== "object")
96483
+ throw TypeError(".TW.Pactus.Proto.SigningInput.transaction: object expected");
96484
+ message.transaction = $root.TW.Pactus.Proto.TransactionMessage.fromObject(object.transaction);
96485
+ }
95055
96486
  return message;
95056
96487
  };
95057
96488
 
95058
96489
  /**
95059
96490
  * Creates a plain object from a SigningInput message. Also converts values to other types if specified.
95060
96491
  * @function toObject
95061
- * @memberof TW.Ontology.Proto.SigningInput
96492
+ * @memberof TW.Pactus.Proto.SigningInput
95062
96493
  * @static
95063
- * @param {TW.Ontology.Proto.SigningInput} message SigningInput
96494
+ * @param {TW.Pactus.Proto.SigningInput} message SigningInput
95064
96495
  * @param {$protobuf.IConversionOptions} [options] Conversion options
95065
96496
  * @returns {Object.<string,*>} Plain object
95066
96497
  */
@@ -95069,83 +96500,26 @@
95069
96500
  options = {};
95070
96501
  var object = {};
95071
96502
  if (options.defaults) {
95072
- object.contract = "";
95073
- object.method = "";
95074
- if (options.bytes === String)
95075
- object.ownerPrivateKey = "";
95076
- else {
95077
- object.ownerPrivateKey = [];
95078
- if (options.bytes !== Array)
95079
- object.ownerPrivateKey = $util.newBuffer(object.ownerPrivateKey);
95080
- }
95081
- object.toAddress = "";
95082
- if ($util.Long) {
95083
- var long = new $util.Long(0, 0, true);
95084
- object.amount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
95085
- } else
95086
- object.amount = options.longs === String ? "0" : 0;
95087
96503
  if (options.bytes === String)
95088
- object.payerPrivateKey = "";
96504
+ object.privateKey = "";
95089
96505
  else {
95090
- object.payerPrivateKey = [];
96506
+ object.privateKey = [];
95091
96507
  if (options.bytes !== Array)
95092
- object.payerPrivateKey = $util.newBuffer(object.payerPrivateKey);
96508
+ object.privateKey = $util.newBuffer(object.privateKey);
95093
96509
  }
95094
- if ($util.Long) {
95095
- var long = new $util.Long(0, 0, true);
95096
- object.gasPrice = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
95097
- } else
95098
- object.gasPrice = options.longs === String ? "0" : 0;
95099
- if ($util.Long) {
95100
- var long = new $util.Long(0, 0, true);
95101
- object.gasLimit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
95102
- } else
95103
- object.gasLimit = options.longs === String ? "0" : 0;
95104
- object.queryAddress = "";
95105
- object.nonce = 0;
95106
- object.ownerAddress = "";
95107
- object.payerAddress = "";
96510
+ object.transaction = null;
95108
96511
  }
95109
- if (message.contract != null && message.hasOwnProperty("contract"))
95110
- object.contract = message.contract;
95111
- if (message.method != null && message.hasOwnProperty("method"))
95112
- object.method = message.method;
95113
- if (message.ownerPrivateKey != null && message.hasOwnProperty("ownerPrivateKey"))
95114
- object.ownerPrivateKey = options.bytes === String ? $util.base64.encode(message.ownerPrivateKey, 0, message.ownerPrivateKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.ownerPrivateKey) : message.ownerPrivateKey;
95115
- if (message.toAddress != null && message.hasOwnProperty("toAddress"))
95116
- object.toAddress = message.toAddress;
95117
- if (message.amount != null && message.hasOwnProperty("amount"))
95118
- if (typeof message.amount === "number")
95119
- object.amount = options.longs === String ? String(message.amount) : message.amount;
95120
- else
95121
- object.amount = options.longs === String ? $util.Long.prototype.toString.call(message.amount) : options.longs === Number ? new $util.LongBits(message.amount.low >>> 0, message.amount.high >>> 0).toNumber(true) : message.amount;
95122
- if (message.payerPrivateKey != null && message.hasOwnProperty("payerPrivateKey"))
95123
- object.payerPrivateKey = options.bytes === String ? $util.base64.encode(message.payerPrivateKey, 0, message.payerPrivateKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.payerPrivateKey) : message.payerPrivateKey;
95124
- if (message.gasPrice != null && message.hasOwnProperty("gasPrice"))
95125
- if (typeof message.gasPrice === "number")
95126
- object.gasPrice = options.longs === String ? String(message.gasPrice) : message.gasPrice;
95127
- else
95128
- object.gasPrice = options.longs === String ? $util.Long.prototype.toString.call(message.gasPrice) : options.longs === Number ? new $util.LongBits(message.gasPrice.low >>> 0, message.gasPrice.high >>> 0).toNumber(true) : message.gasPrice;
95129
- if (message.gasLimit != null && message.hasOwnProperty("gasLimit"))
95130
- if (typeof message.gasLimit === "number")
95131
- object.gasLimit = options.longs === String ? String(message.gasLimit) : message.gasLimit;
95132
- else
95133
- object.gasLimit = options.longs === String ? $util.Long.prototype.toString.call(message.gasLimit) : options.longs === Number ? new $util.LongBits(message.gasLimit.low >>> 0, message.gasLimit.high >>> 0).toNumber(true) : message.gasLimit;
95134
- if (message.queryAddress != null && message.hasOwnProperty("queryAddress"))
95135
- object.queryAddress = message.queryAddress;
95136
- if (message.nonce != null && message.hasOwnProperty("nonce"))
95137
- object.nonce = message.nonce;
95138
- if (message.ownerAddress != null && message.hasOwnProperty("ownerAddress"))
95139
- object.ownerAddress = message.ownerAddress;
95140
- if (message.payerAddress != null && message.hasOwnProperty("payerAddress"))
95141
- object.payerAddress = message.payerAddress;
96512
+ if (message.privateKey != null && message.hasOwnProperty("privateKey"))
96513
+ object.privateKey = options.bytes === String ? $util.base64.encode(message.privateKey, 0, message.privateKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.privateKey) : message.privateKey;
96514
+ if (message.transaction != null && message.hasOwnProperty("transaction"))
96515
+ object.transaction = $root.TW.Pactus.Proto.TransactionMessage.toObject(message.transaction, options);
95142
96516
  return object;
95143
96517
  };
95144
96518
 
95145
96519
  /**
95146
96520
  * Converts this SigningInput to JSON.
95147
96521
  * @function toJSON
95148
- * @memberof TW.Ontology.Proto.SigningInput
96522
+ * @memberof TW.Pactus.Proto.SigningInput
95149
96523
  * @instance
95150
96524
  * @returns {Object.<string,*>} JSON object
95151
96525
  */
@@ -95160,20 +96534,22 @@
95160
96534
 
95161
96535
  /**
95162
96536
  * Properties of a SigningOutput.
95163
- * @memberof TW.Ontology.Proto
96537
+ * @memberof TW.Pactus.Proto
95164
96538
  * @interface ISigningOutput
95165
- * @property {Uint8Array|null} [encoded] SigningOutput encoded
96539
+ * @property {Uint8Array|null} [transactionId] SigningOutput transactionId
96540
+ * @property {Uint8Array|null} [signedTransactionData] SigningOutput signedTransactionData
96541
+ * @property {Uint8Array|null} [signature] SigningOutput signature
95166
96542
  * @property {TW.Common.Proto.SigningError|null} [error] SigningOutput error
95167
96543
  * @property {string|null} [errorMessage] SigningOutput errorMessage
95168
96544
  */
95169
96545
 
95170
96546
  /**
95171
96547
  * Constructs a new SigningOutput.
95172
- * @memberof TW.Ontology.Proto
96548
+ * @memberof TW.Pactus.Proto
95173
96549
  * @classdesc Represents a SigningOutput.
95174
96550
  * @implements ISigningOutput
95175
96551
  * @constructor
95176
- * @param {TW.Ontology.Proto.ISigningOutput=} [properties] Properties to set
96552
+ * @param {TW.Pactus.Proto.ISigningOutput=} [properties] Properties to set
95177
96553
  */
95178
96554
  function SigningOutput(properties) {
95179
96555
  if (properties)
@@ -95183,17 +96559,33 @@
95183
96559
  }
95184
96560
 
95185
96561
  /**
95186
- * SigningOutput encoded.
95187
- * @member {Uint8Array} encoded
95188
- * @memberof TW.Ontology.Proto.SigningOutput
96562
+ * SigningOutput transactionId.
96563
+ * @member {Uint8Array} transactionId
96564
+ * @memberof TW.Pactus.Proto.SigningOutput
95189
96565
  * @instance
95190
96566
  */
95191
- SigningOutput.prototype.encoded = $util.newBuffer([]);
96567
+ SigningOutput.prototype.transactionId = $util.newBuffer([]);
96568
+
96569
+ /**
96570
+ * SigningOutput signedTransactionData.
96571
+ * @member {Uint8Array} signedTransactionData
96572
+ * @memberof TW.Pactus.Proto.SigningOutput
96573
+ * @instance
96574
+ */
96575
+ SigningOutput.prototype.signedTransactionData = $util.newBuffer([]);
96576
+
96577
+ /**
96578
+ * SigningOutput signature.
96579
+ * @member {Uint8Array} signature
96580
+ * @memberof TW.Pactus.Proto.SigningOutput
96581
+ * @instance
96582
+ */
96583
+ SigningOutput.prototype.signature = $util.newBuffer([]);
95192
96584
 
95193
96585
  /**
95194
96586
  * SigningOutput error.
95195
96587
  * @member {TW.Common.Proto.SigningError} error
95196
- * @memberof TW.Ontology.Proto.SigningOutput
96588
+ * @memberof TW.Pactus.Proto.SigningOutput
95197
96589
  * @instance
95198
96590
  */
95199
96591
  SigningOutput.prototype.error = 0;
@@ -95201,7 +96593,7 @@
95201
96593
  /**
95202
96594
  * SigningOutput errorMessage.
95203
96595
  * @member {string} errorMessage
95204
- * @memberof TW.Ontology.Proto.SigningOutput
96596
+ * @memberof TW.Pactus.Proto.SigningOutput
95205
96597
  * @instance
95206
96598
  */
95207
96599
  SigningOutput.prototype.errorMessage = "";
@@ -95209,61 +96601,71 @@
95209
96601
  /**
95210
96602
  * Creates a new SigningOutput instance using the specified properties.
95211
96603
  * @function create
95212
- * @memberof TW.Ontology.Proto.SigningOutput
96604
+ * @memberof TW.Pactus.Proto.SigningOutput
95213
96605
  * @static
95214
- * @param {TW.Ontology.Proto.ISigningOutput=} [properties] Properties to set
95215
- * @returns {TW.Ontology.Proto.SigningOutput} SigningOutput instance
96606
+ * @param {TW.Pactus.Proto.ISigningOutput=} [properties] Properties to set
96607
+ * @returns {TW.Pactus.Proto.SigningOutput} SigningOutput instance
95216
96608
  */
95217
96609
  SigningOutput.create = function create(properties) {
95218
96610
  return new SigningOutput(properties);
95219
96611
  };
95220
96612
 
95221
96613
  /**
95222
- * Encodes the specified SigningOutput message. Does not implicitly {@link TW.Ontology.Proto.SigningOutput.verify|verify} messages.
96614
+ * Encodes the specified SigningOutput message. Does not implicitly {@link TW.Pactus.Proto.SigningOutput.verify|verify} messages.
95223
96615
  * @function encode
95224
- * @memberof TW.Ontology.Proto.SigningOutput
96616
+ * @memberof TW.Pactus.Proto.SigningOutput
95225
96617
  * @static
95226
- * @param {TW.Ontology.Proto.ISigningOutput} message SigningOutput message or plain object to encode
96618
+ * @param {TW.Pactus.Proto.ISigningOutput} message SigningOutput message or plain object to encode
95227
96619
  * @param {$protobuf.Writer} [writer] Writer to encode to
95228
96620
  * @returns {$protobuf.Writer} Writer
95229
96621
  */
95230
96622
  SigningOutput.encode = function encode(message, writer) {
95231
96623
  if (!writer)
95232
96624
  writer = $Writer.create();
95233
- if (message.encoded != null && Object.hasOwnProperty.call(message, "encoded"))
95234
- writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.encoded);
96625
+ if (message.transactionId != null && Object.hasOwnProperty.call(message, "transactionId"))
96626
+ writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.transactionId);
96627
+ if (message.signedTransactionData != null && Object.hasOwnProperty.call(message, "signedTransactionData"))
96628
+ writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.signedTransactionData);
96629
+ if (message.signature != null && Object.hasOwnProperty.call(message, "signature"))
96630
+ writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.signature);
95235
96631
  if (message.error != null && Object.hasOwnProperty.call(message, "error"))
95236
- writer.uint32(/* id 2, wireType 0 =*/16).int32(message.error);
96632
+ writer.uint32(/* id 4, wireType 0 =*/32).int32(message.error);
95237
96633
  if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage"))
95238
- writer.uint32(/* id 3, wireType 2 =*/26).string(message.errorMessage);
96634
+ writer.uint32(/* id 5, wireType 2 =*/42).string(message.errorMessage);
95239
96635
  return writer;
95240
96636
  };
95241
96637
 
95242
96638
  /**
95243
96639
  * Decodes a SigningOutput message from the specified reader or buffer.
95244
96640
  * @function decode
95245
- * @memberof TW.Ontology.Proto.SigningOutput
96641
+ * @memberof TW.Pactus.Proto.SigningOutput
95246
96642
  * @static
95247
96643
  * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
95248
96644
  * @param {number} [length] Message length if known beforehand
95249
- * @returns {TW.Ontology.Proto.SigningOutput} SigningOutput
96645
+ * @returns {TW.Pactus.Proto.SigningOutput} SigningOutput
95250
96646
  * @throws {Error} If the payload is not a reader or valid buffer
95251
96647
  * @throws {$protobuf.util.ProtocolError} If required fields are missing
95252
96648
  */
95253
96649
  SigningOutput.decode = function decode(reader, length) {
95254
96650
  if (!(reader instanceof $Reader))
95255
96651
  reader = $Reader.create(reader);
95256
- var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Ontology.Proto.SigningOutput();
96652
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Pactus.Proto.SigningOutput();
95257
96653
  while (reader.pos < end) {
95258
96654
  var tag = reader.uint32();
95259
96655
  switch (tag >>> 3) {
95260
96656
  case 1:
95261
- message.encoded = reader.bytes();
96657
+ message.transactionId = reader.bytes();
95262
96658
  break;
95263
96659
  case 2:
95264
- message.error = reader.int32();
96660
+ message.signedTransactionData = reader.bytes();
95265
96661
  break;
95266
96662
  case 3:
96663
+ message.signature = reader.bytes();
96664
+ break;
96665
+ case 4:
96666
+ message.error = reader.int32();
96667
+ break;
96668
+ case 5:
95267
96669
  message.errorMessage = reader.string();
95268
96670
  break;
95269
96671
  default:
@@ -95277,7 +96679,7 @@
95277
96679
  /**
95278
96680
  * Verifies a SigningOutput message.
95279
96681
  * @function verify
95280
- * @memberof TW.Ontology.Proto.SigningOutput
96682
+ * @memberof TW.Pactus.Proto.SigningOutput
95281
96683
  * @static
95282
96684
  * @param {Object.<string,*>} message Plain object to verify
95283
96685
  * @returns {string|null} `null` if valid, otherwise the reason why it is not
@@ -95285,9 +96687,15 @@
95285
96687
  SigningOutput.verify = function verify(message) {
95286
96688
  if (typeof message !== "object" || message === null)
95287
96689
  return "object expected";
95288
- if (message.encoded != null && message.hasOwnProperty("encoded"))
95289
- if (!(message.encoded && typeof message.encoded.length === "number" || $util.isString(message.encoded)))
95290
- return "encoded: buffer expected";
96690
+ if (message.transactionId != null && message.hasOwnProperty("transactionId"))
96691
+ if (!(message.transactionId && typeof message.transactionId.length === "number" || $util.isString(message.transactionId)))
96692
+ return "transactionId: buffer expected";
96693
+ if (message.signedTransactionData != null && message.hasOwnProperty("signedTransactionData"))
96694
+ if (!(message.signedTransactionData && typeof message.signedTransactionData.length === "number" || $util.isString(message.signedTransactionData)))
96695
+ return "signedTransactionData: buffer expected";
96696
+ if (message.signature != null && message.hasOwnProperty("signature"))
96697
+ if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature)))
96698
+ return "signature: buffer expected";
95291
96699
  if (message.error != null && message.hasOwnProperty("error"))
95292
96700
  switch (message.error) {
95293
96701
  default:
@@ -95329,20 +96737,30 @@
95329
96737
  /**
95330
96738
  * Creates a SigningOutput message from a plain object. Also converts values to their respective internal types.
95331
96739
  * @function fromObject
95332
- * @memberof TW.Ontology.Proto.SigningOutput
96740
+ * @memberof TW.Pactus.Proto.SigningOutput
95333
96741
  * @static
95334
96742
  * @param {Object.<string,*>} object Plain object
95335
- * @returns {TW.Ontology.Proto.SigningOutput} SigningOutput
96743
+ * @returns {TW.Pactus.Proto.SigningOutput} SigningOutput
95336
96744
  */
95337
96745
  SigningOutput.fromObject = function fromObject(object) {
95338
- if (object instanceof $root.TW.Ontology.Proto.SigningOutput)
96746
+ if (object instanceof $root.TW.Pactus.Proto.SigningOutput)
95339
96747
  return object;
95340
- var message = new $root.TW.Ontology.Proto.SigningOutput();
95341
- if (object.encoded != null)
95342
- if (typeof object.encoded === "string")
95343
- $util.base64.decode(object.encoded, message.encoded = $util.newBuffer($util.base64.length(object.encoded)), 0);
95344
- else if (object.encoded.length)
95345
- message.encoded = object.encoded;
96748
+ var message = new $root.TW.Pactus.Proto.SigningOutput();
96749
+ if (object.transactionId != null)
96750
+ if (typeof object.transactionId === "string")
96751
+ $util.base64.decode(object.transactionId, message.transactionId = $util.newBuffer($util.base64.length(object.transactionId)), 0);
96752
+ else if (object.transactionId.length)
96753
+ message.transactionId = object.transactionId;
96754
+ if (object.signedTransactionData != null)
96755
+ if (typeof object.signedTransactionData === "string")
96756
+ $util.base64.decode(object.signedTransactionData, message.signedTransactionData = $util.newBuffer($util.base64.length(object.signedTransactionData)), 0);
96757
+ else if (object.signedTransactionData.length)
96758
+ message.signedTransactionData = object.signedTransactionData;
96759
+ if (object.signature != null)
96760
+ if (typeof object.signature === "string")
96761
+ $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0);
96762
+ else if (object.signature.length)
96763
+ message.signature = object.signature;
95346
96764
  switch (object.error) {
95347
96765
  case "OK":
95348
96766
  case 0:
@@ -95457,9 +96875,9 @@
95457
96875
  /**
95458
96876
  * Creates a plain object from a SigningOutput message. Also converts values to other types if specified.
95459
96877
  * @function toObject
95460
- * @memberof TW.Ontology.Proto.SigningOutput
96878
+ * @memberof TW.Pactus.Proto.SigningOutput
95461
96879
  * @static
95462
- * @param {TW.Ontology.Proto.SigningOutput} message SigningOutput
96880
+ * @param {TW.Pactus.Proto.SigningOutput} message SigningOutput
95463
96881
  * @param {$protobuf.IConversionOptions} [options] Conversion options
95464
96882
  * @returns {Object.<string,*>} Plain object
95465
96883
  */
@@ -95469,17 +96887,35 @@
95469
96887
  var object = {};
95470
96888
  if (options.defaults) {
95471
96889
  if (options.bytes === String)
95472
- object.encoded = "";
96890
+ object.transactionId = "";
95473
96891
  else {
95474
- object.encoded = [];
96892
+ object.transactionId = [];
95475
96893
  if (options.bytes !== Array)
95476
- object.encoded = $util.newBuffer(object.encoded);
96894
+ object.transactionId = $util.newBuffer(object.transactionId);
96895
+ }
96896
+ if (options.bytes === String)
96897
+ object.signedTransactionData = "";
96898
+ else {
96899
+ object.signedTransactionData = [];
96900
+ if (options.bytes !== Array)
96901
+ object.signedTransactionData = $util.newBuffer(object.signedTransactionData);
96902
+ }
96903
+ if (options.bytes === String)
96904
+ object.signature = "";
96905
+ else {
96906
+ object.signature = [];
96907
+ if (options.bytes !== Array)
96908
+ object.signature = $util.newBuffer(object.signature);
95477
96909
  }
95478
96910
  object.error = options.enums === String ? "OK" : 0;
95479
96911
  object.errorMessage = "";
95480
96912
  }
95481
- if (message.encoded != null && message.hasOwnProperty("encoded"))
95482
- object.encoded = options.bytes === String ? $util.base64.encode(message.encoded, 0, message.encoded.length) : options.bytes === Array ? Array.prototype.slice.call(message.encoded) : message.encoded;
96913
+ if (message.transactionId != null && message.hasOwnProperty("transactionId"))
96914
+ object.transactionId = options.bytes === String ? $util.base64.encode(message.transactionId, 0, message.transactionId.length) : options.bytes === Array ? Array.prototype.slice.call(message.transactionId) : message.transactionId;
96915
+ if (message.signedTransactionData != null && message.hasOwnProperty("signedTransactionData"))
96916
+ object.signedTransactionData = options.bytes === String ? $util.base64.encode(message.signedTransactionData, 0, message.signedTransactionData.length) : options.bytes === Array ? Array.prototype.slice.call(message.signedTransactionData) : message.signedTransactionData;
96917
+ if (message.signature != null && message.hasOwnProperty("signature"))
96918
+ object.signature = options.bytes === String ? $util.base64.encode(message.signature, 0, message.signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.signature) : message.signature;
95483
96919
  if (message.error != null && message.hasOwnProperty("error"))
95484
96920
  object.error = options.enums === String ? $root.TW.Common.Proto.SigningError[message.error] : message.error;
95485
96921
  if (message.errorMessage != null && message.hasOwnProperty("errorMessage"))
@@ -95490,7 +96926,7 @@
95490
96926
  /**
95491
96927
  * Converts this SigningOutput to JSON.
95492
96928
  * @function toJSON
95493
- * @memberof TW.Ontology.Proto.SigningOutput
96929
+ * @memberof TW.Pactus.Proto.SigningOutput
95494
96930
  * @instance
95495
96931
  * @returns {Object.<string,*>} JSON object
95496
96932
  */
@@ -95504,7 +96940,7 @@
95504
96940
  return Proto;
95505
96941
  })();
95506
96942
 
95507
- return Ontology;
96943
+ return Pactus;
95508
96944
  })();
95509
96945
 
95510
96946
  TW.Polkadot = (function() {
@@ -128934,6 +130370,7 @@
128934
130370
  * @property {Long|null} [expiration] Transaction expiration
128935
130371
  * @property {TW.Tron.Proto.IBlockHeader|null} [blockHeader] Transaction blockHeader
128936
130372
  * @property {Long|null} [feeLimit] Transaction feeLimit
130373
+ * @property {string|null} [memo] Transaction memo
128937
130374
  * @property {TW.Tron.Proto.ITransferContract|null} [transfer] Transaction transfer
128938
130375
  * @property {TW.Tron.Proto.ITransferAssetContract|null} [transferAsset] Transaction transferAsset
128939
130376
  * @property {TW.Tron.Proto.IFreezeBalanceContract|null} [freezeBalance] Transaction freezeBalance
@@ -128998,6 +130435,14 @@
128998
130435
  */
128999
130436
  Transaction.prototype.feeLimit = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
129000
130437
 
130438
+ /**
130439
+ * Transaction memo.
130440
+ * @member {string} memo
130441
+ * @memberof TW.Tron.Proto.Transaction
130442
+ * @instance
130443
+ */
130444
+ Transaction.prototype.memo = "";
130445
+
129001
130446
  /**
129002
130447
  * Transaction transfer.
129003
130448
  * @member {TW.Tron.Proto.ITransferContract|null|undefined} transfer
@@ -129164,6 +130609,8 @@
129164
130609
  $root.TW.Tron.Proto.BlockHeader.encode(message.blockHeader, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
129165
130610
  if (message.feeLimit != null && Object.hasOwnProperty.call(message, "feeLimit"))
129166
130611
  writer.uint32(/* id 4, wireType 0 =*/32).int64(message.feeLimit);
130612
+ if (message.memo != null && Object.hasOwnProperty.call(message, "memo"))
130613
+ writer.uint32(/* id 5, wireType 2 =*/42).string(message.memo);
129167
130614
  if (message.transfer != null && Object.hasOwnProperty.call(message, "transfer"))
129168
130615
  $root.TW.Tron.Proto.TransferContract.encode(message.transfer, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim();
129169
130616
  if (message.transferAsset != null && Object.hasOwnProperty.call(message, "transferAsset"))
@@ -129227,6 +130674,9 @@
129227
130674
  case 4:
129228
130675
  message.feeLimit = reader.int64();
129229
130676
  break;
130677
+ case 5:
130678
+ message.memo = reader.string();
130679
+ break;
129230
130680
  case 10:
129231
130681
  message.transfer = $root.TW.Tron.Proto.TransferContract.decode(reader, reader.uint32());
129232
130682
  break;
@@ -129306,6 +130756,9 @@
129306
130756
  if (message.feeLimit != null && message.hasOwnProperty("feeLimit"))
129307
130757
  if (!$util.isInteger(message.feeLimit) && !(message.feeLimit && $util.isInteger(message.feeLimit.low) && $util.isInteger(message.feeLimit.high)))
129308
130758
  return "feeLimit: integer|Long expected";
130759
+ if (message.memo != null && message.hasOwnProperty("memo"))
130760
+ if (!$util.isString(message.memo))
130761
+ return "memo: string expected";
129309
130762
  if (message.transfer != null && message.hasOwnProperty("transfer")) {
129310
130763
  properties.contractOneof = 1;
129311
130764
  {
@@ -129501,6 +130954,8 @@
129501
130954
  message.feeLimit = object.feeLimit;
129502
130955
  else if (typeof object.feeLimit === "object")
129503
130956
  message.feeLimit = new $util.LongBits(object.feeLimit.low >>> 0, object.feeLimit.high >>> 0).toNumber();
130957
+ if (object.memo != null)
130958
+ message.memo = String(object.memo);
129504
130959
  if (object.transfer != null) {
129505
130960
  if (typeof object.transfer !== "object")
129506
130961
  throw TypeError(".TW.Tron.Proto.Transaction.transfer: object expected");
@@ -129609,6 +131064,7 @@
129609
131064
  object.feeLimit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
129610
131065
  } else
129611
131066
  object.feeLimit = options.longs === String ? "0" : 0;
131067
+ object.memo = "";
129612
131068
  }
129613
131069
  if (message.timestamp != null && message.hasOwnProperty("timestamp"))
129614
131070
  if (typeof message.timestamp === "number")
@@ -129627,6 +131083,8 @@
129627
131083
  object.feeLimit = options.longs === String ? String(message.feeLimit) : message.feeLimit;
129628
131084
  else
129629
131085
  object.feeLimit = options.longs === String ? $util.Long.prototype.toString.call(message.feeLimit) : options.longs === Number ? new $util.LongBits(message.feeLimit.low >>> 0, message.feeLimit.high >>> 0).toNumber() : message.feeLimit;
131086
+ if (message.memo != null && message.hasOwnProperty("memo"))
131087
+ object.memo = message.memo;
129630
131088
  if (message.transfer != null && message.hasOwnProperty("transfer")) {
129631
131089
  object.transfer = $root.TW.Tron.Proto.TransferContract.toObject(message.transfer, options);
129632
131090
  if (options.oneofs)