@trustwallet/wallet-core 4.1.15 → 4.1.17

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.
@@ -95507,6 +95507,1386 @@
95507
95507
  return Ontology;
95508
95508
  })();
95509
95509
 
95510
+ TW.Pactus = (function() {
95511
+
95512
+ /**
95513
+ * Namespace Pactus.
95514
+ * @memberof TW
95515
+ * @namespace
95516
+ */
95517
+ var Pactus = {};
95518
+
95519
+ Pactus.Proto = (function() {
95520
+
95521
+ /**
95522
+ * Namespace Proto.
95523
+ * @memberof TW.Pactus
95524
+ * @namespace
95525
+ */
95526
+ var Proto = {};
95527
+
95528
+ Proto.TransactionMessage = (function() {
95529
+
95530
+ /**
95531
+ * Properties of a TransactionMessage.
95532
+ * @memberof TW.Pactus.Proto
95533
+ * @interface ITransactionMessage
95534
+ * @property {number|null} [lockTime] TransactionMessage lockTime
95535
+ * @property {Long|null} [fee] TransactionMessage fee
95536
+ * @property {string|null} [memo] TransactionMessage memo
95537
+ * @property {TW.Pactus.Proto.ITransferPayload|null} [transfer] TransactionMessage transfer
95538
+ * @property {TW.Pactus.Proto.IBondPayload|null} [bond] TransactionMessage bond
95539
+ */
95540
+
95541
+ /**
95542
+ * Constructs a new TransactionMessage.
95543
+ * @memberof TW.Pactus.Proto
95544
+ * @classdesc Represents a TransactionMessage.
95545
+ * @implements ITransactionMessage
95546
+ * @constructor
95547
+ * @param {TW.Pactus.Proto.ITransactionMessage=} [properties] Properties to set
95548
+ */
95549
+ function TransactionMessage(properties) {
95550
+ if (properties)
95551
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
95552
+ if (properties[keys[i]] != null)
95553
+ this[keys[i]] = properties[keys[i]];
95554
+ }
95555
+
95556
+ /**
95557
+ * TransactionMessage lockTime.
95558
+ * @member {number} lockTime
95559
+ * @memberof TW.Pactus.Proto.TransactionMessage
95560
+ * @instance
95561
+ */
95562
+ TransactionMessage.prototype.lockTime = 0;
95563
+
95564
+ /**
95565
+ * TransactionMessage fee.
95566
+ * @member {Long} fee
95567
+ * @memberof TW.Pactus.Proto.TransactionMessage
95568
+ * @instance
95569
+ */
95570
+ TransactionMessage.prototype.fee = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
95571
+
95572
+ /**
95573
+ * TransactionMessage memo.
95574
+ * @member {string} memo
95575
+ * @memberof TW.Pactus.Proto.TransactionMessage
95576
+ * @instance
95577
+ */
95578
+ TransactionMessage.prototype.memo = "";
95579
+
95580
+ /**
95581
+ * TransactionMessage transfer.
95582
+ * @member {TW.Pactus.Proto.ITransferPayload|null|undefined} transfer
95583
+ * @memberof TW.Pactus.Proto.TransactionMessage
95584
+ * @instance
95585
+ */
95586
+ TransactionMessage.prototype.transfer = null;
95587
+
95588
+ /**
95589
+ * TransactionMessage bond.
95590
+ * @member {TW.Pactus.Proto.IBondPayload|null|undefined} bond
95591
+ * @memberof TW.Pactus.Proto.TransactionMessage
95592
+ * @instance
95593
+ */
95594
+ TransactionMessage.prototype.bond = null;
95595
+
95596
+ // OneOf field names bound to virtual getters and setters
95597
+ var $oneOfFields;
95598
+
95599
+ /**
95600
+ * TransactionMessage payload.
95601
+ * @member {"transfer"|"bond"|undefined} payload
95602
+ * @memberof TW.Pactus.Proto.TransactionMessage
95603
+ * @instance
95604
+ */
95605
+ Object.defineProperty(TransactionMessage.prototype, "payload", {
95606
+ get: $util.oneOfGetter($oneOfFields = ["transfer", "bond"]),
95607
+ set: $util.oneOfSetter($oneOfFields)
95608
+ });
95609
+
95610
+ /**
95611
+ * Creates a new TransactionMessage instance using the specified properties.
95612
+ * @function create
95613
+ * @memberof TW.Pactus.Proto.TransactionMessage
95614
+ * @static
95615
+ * @param {TW.Pactus.Proto.ITransactionMessage=} [properties] Properties to set
95616
+ * @returns {TW.Pactus.Proto.TransactionMessage} TransactionMessage instance
95617
+ */
95618
+ TransactionMessage.create = function create(properties) {
95619
+ return new TransactionMessage(properties);
95620
+ };
95621
+
95622
+ /**
95623
+ * Encodes the specified TransactionMessage message. Does not implicitly {@link TW.Pactus.Proto.TransactionMessage.verify|verify} messages.
95624
+ * @function encode
95625
+ * @memberof TW.Pactus.Proto.TransactionMessage
95626
+ * @static
95627
+ * @param {TW.Pactus.Proto.ITransactionMessage} message TransactionMessage message or plain object to encode
95628
+ * @param {$protobuf.Writer} [writer] Writer to encode to
95629
+ * @returns {$protobuf.Writer} Writer
95630
+ */
95631
+ TransactionMessage.encode = function encode(message, writer) {
95632
+ if (!writer)
95633
+ writer = $Writer.create();
95634
+ if (message.lockTime != null && Object.hasOwnProperty.call(message, "lockTime"))
95635
+ writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.lockTime);
95636
+ if (message.fee != null && Object.hasOwnProperty.call(message, "fee"))
95637
+ writer.uint32(/* id 2, wireType 0 =*/16).int64(message.fee);
95638
+ if (message.memo != null && Object.hasOwnProperty.call(message, "memo"))
95639
+ writer.uint32(/* id 3, wireType 2 =*/26).string(message.memo);
95640
+ if (message.transfer != null && Object.hasOwnProperty.call(message, "transfer"))
95641
+ $root.TW.Pactus.Proto.TransferPayload.encode(message.transfer, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim();
95642
+ if (message.bond != null && Object.hasOwnProperty.call(message, "bond"))
95643
+ $root.TW.Pactus.Proto.BondPayload.encode(message.bond, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim();
95644
+ return writer;
95645
+ };
95646
+
95647
+ /**
95648
+ * Decodes a TransactionMessage message from the specified reader or buffer.
95649
+ * @function decode
95650
+ * @memberof TW.Pactus.Proto.TransactionMessage
95651
+ * @static
95652
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
95653
+ * @param {number} [length] Message length if known beforehand
95654
+ * @returns {TW.Pactus.Proto.TransactionMessage} TransactionMessage
95655
+ * @throws {Error} If the payload is not a reader or valid buffer
95656
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
95657
+ */
95658
+ TransactionMessage.decode = function decode(reader, length) {
95659
+ if (!(reader instanceof $Reader))
95660
+ reader = $Reader.create(reader);
95661
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Pactus.Proto.TransactionMessage();
95662
+ while (reader.pos < end) {
95663
+ var tag = reader.uint32();
95664
+ switch (tag >>> 3) {
95665
+ case 1:
95666
+ message.lockTime = reader.uint32();
95667
+ break;
95668
+ case 2:
95669
+ message.fee = reader.int64();
95670
+ break;
95671
+ case 3:
95672
+ message.memo = reader.string();
95673
+ break;
95674
+ case 10:
95675
+ message.transfer = $root.TW.Pactus.Proto.TransferPayload.decode(reader, reader.uint32());
95676
+ break;
95677
+ case 11:
95678
+ message.bond = $root.TW.Pactus.Proto.BondPayload.decode(reader, reader.uint32());
95679
+ break;
95680
+ default:
95681
+ reader.skipType(tag & 7);
95682
+ break;
95683
+ }
95684
+ }
95685
+ return message;
95686
+ };
95687
+
95688
+ /**
95689
+ * Verifies a TransactionMessage message.
95690
+ * @function verify
95691
+ * @memberof TW.Pactus.Proto.TransactionMessage
95692
+ * @static
95693
+ * @param {Object.<string,*>} message Plain object to verify
95694
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
95695
+ */
95696
+ TransactionMessage.verify = function verify(message) {
95697
+ if (typeof message !== "object" || message === null)
95698
+ return "object expected";
95699
+ var properties = {};
95700
+ if (message.lockTime != null && message.hasOwnProperty("lockTime"))
95701
+ if (!$util.isInteger(message.lockTime))
95702
+ return "lockTime: integer expected";
95703
+ if (message.fee != null && message.hasOwnProperty("fee"))
95704
+ if (!$util.isInteger(message.fee) && !(message.fee && $util.isInteger(message.fee.low) && $util.isInteger(message.fee.high)))
95705
+ return "fee: integer|Long expected";
95706
+ if (message.memo != null && message.hasOwnProperty("memo"))
95707
+ if (!$util.isString(message.memo))
95708
+ return "memo: string expected";
95709
+ if (message.transfer != null && message.hasOwnProperty("transfer")) {
95710
+ properties.payload = 1;
95711
+ {
95712
+ var error = $root.TW.Pactus.Proto.TransferPayload.verify(message.transfer);
95713
+ if (error)
95714
+ return "transfer." + error;
95715
+ }
95716
+ }
95717
+ if (message.bond != null && message.hasOwnProperty("bond")) {
95718
+ if (properties.payload === 1)
95719
+ return "payload: multiple values";
95720
+ properties.payload = 1;
95721
+ {
95722
+ var error = $root.TW.Pactus.Proto.BondPayload.verify(message.bond);
95723
+ if (error)
95724
+ return "bond." + error;
95725
+ }
95726
+ }
95727
+ return null;
95728
+ };
95729
+
95730
+ /**
95731
+ * Creates a TransactionMessage message from a plain object. Also converts values to their respective internal types.
95732
+ * @function fromObject
95733
+ * @memberof TW.Pactus.Proto.TransactionMessage
95734
+ * @static
95735
+ * @param {Object.<string,*>} object Plain object
95736
+ * @returns {TW.Pactus.Proto.TransactionMessage} TransactionMessage
95737
+ */
95738
+ TransactionMessage.fromObject = function fromObject(object) {
95739
+ if (object instanceof $root.TW.Pactus.Proto.TransactionMessage)
95740
+ return object;
95741
+ var message = new $root.TW.Pactus.Proto.TransactionMessage();
95742
+ if (object.lockTime != null)
95743
+ message.lockTime = object.lockTime >>> 0;
95744
+ if (object.fee != null)
95745
+ if ($util.Long)
95746
+ (message.fee = $util.Long.fromValue(object.fee)).unsigned = false;
95747
+ else if (typeof object.fee === "string")
95748
+ message.fee = parseInt(object.fee, 10);
95749
+ else if (typeof object.fee === "number")
95750
+ message.fee = object.fee;
95751
+ else if (typeof object.fee === "object")
95752
+ message.fee = new $util.LongBits(object.fee.low >>> 0, object.fee.high >>> 0).toNumber();
95753
+ if (object.memo != null)
95754
+ message.memo = String(object.memo);
95755
+ if (object.transfer != null) {
95756
+ if (typeof object.transfer !== "object")
95757
+ throw TypeError(".TW.Pactus.Proto.TransactionMessage.transfer: object expected");
95758
+ message.transfer = $root.TW.Pactus.Proto.TransferPayload.fromObject(object.transfer);
95759
+ }
95760
+ if (object.bond != null) {
95761
+ if (typeof object.bond !== "object")
95762
+ throw TypeError(".TW.Pactus.Proto.TransactionMessage.bond: object expected");
95763
+ message.bond = $root.TW.Pactus.Proto.BondPayload.fromObject(object.bond);
95764
+ }
95765
+ return message;
95766
+ };
95767
+
95768
+ /**
95769
+ * Creates a plain object from a TransactionMessage message. Also converts values to other types if specified.
95770
+ * @function toObject
95771
+ * @memberof TW.Pactus.Proto.TransactionMessage
95772
+ * @static
95773
+ * @param {TW.Pactus.Proto.TransactionMessage} message TransactionMessage
95774
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
95775
+ * @returns {Object.<string,*>} Plain object
95776
+ */
95777
+ TransactionMessage.toObject = function toObject(message, options) {
95778
+ if (!options)
95779
+ options = {};
95780
+ var object = {};
95781
+ if (options.defaults) {
95782
+ object.lockTime = 0;
95783
+ if ($util.Long) {
95784
+ var long = new $util.Long(0, 0, false);
95785
+ object.fee = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
95786
+ } else
95787
+ object.fee = options.longs === String ? "0" : 0;
95788
+ object.memo = "";
95789
+ }
95790
+ if (message.lockTime != null && message.hasOwnProperty("lockTime"))
95791
+ object.lockTime = message.lockTime;
95792
+ if (message.fee != null && message.hasOwnProperty("fee"))
95793
+ if (typeof message.fee === "number")
95794
+ object.fee = options.longs === String ? String(message.fee) : message.fee;
95795
+ else
95796
+ 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;
95797
+ if (message.memo != null && message.hasOwnProperty("memo"))
95798
+ object.memo = message.memo;
95799
+ if (message.transfer != null && message.hasOwnProperty("transfer")) {
95800
+ object.transfer = $root.TW.Pactus.Proto.TransferPayload.toObject(message.transfer, options);
95801
+ if (options.oneofs)
95802
+ object.payload = "transfer";
95803
+ }
95804
+ if (message.bond != null && message.hasOwnProperty("bond")) {
95805
+ object.bond = $root.TW.Pactus.Proto.BondPayload.toObject(message.bond, options);
95806
+ if (options.oneofs)
95807
+ object.payload = "bond";
95808
+ }
95809
+ return object;
95810
+ };
95811
+
95812
+ /**
95813
+ * Converts this TransactionMessage to JSON.
95814
+ * @function toJSON
95815
+ * @memberof TW.Pactus.Proto.TransactionMessage
95816
+ * @instance
95817
+ * @returns {Object.<string,*>} JSON object
95818
+ */
95819
+ TransactionMessage.prototype.toJSON = function toJSON() {
95820
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
95821
+ };
95822
+
95823
+ return TransactionMessage;
95824
+ })();
95825
+
95826
+ Proto.TransferPayload = (function() {
95827
+
95828
+ /**
95829
+ * Properties of a TransferPayload.
95830
+ * @memberof TW.Pactus.Proto
95831
+ * @interface ITransferPayload
95832
+ * @property {string|null} [sender] TransferPayload sender
95833
+ * @property {string|null} [receiver] TransferPayload receiver
95834
+ * @property {Long|null} [amount] TransferPayload amount
95835
+ */
95836
+
95837
+ /**
95838
+ * Constructs a new TransferPayload.
95839
+ * @memberof TW.Pactus.Proto
95840
+ * @classdesc Represents a TransferPayload.
95841
+ * @implements ITransferPayload
95842
+ * @constructor
95843
+ * @param {TW.Pactus.Proto.ITransferPayload=} [properties] Properties to set
95844
+ */
95845
+ function TransferPayload(properties) {
95846
+ if (properties)
95847
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
95848
+ if (properties[keys[i]] != null)
95849
+ this[keys[i]] = properties[keys[i]];
95850
+ }
95851
+
95852
+ /**
95853
+ * TransferPayload sender.
95854
+ * @member {string} sender
95855
+ * @memberof TW.Pactus.Proto.TransferPayload
95856
+ * @instance
95857
+ */
95858
+ TransferPayload.prototype.sender = "";
95859
+
95860
+ /**
95861
+ * TransferPayload receiver.
95862
+ * @member {string} receiver
95863
+ * @memberof TW.Pactus.Proto.TransferPayload
95864
+ * @instance
95865
+ */
95866
+ TransferPayload.prototype.receiver = "";
95867
+
95868
+ /**
95869
+ * TransferPayload amount.
95870
+ * @member {Long} amount
95871
+ * @memberof TW.Pactus.Proto.TransferPayload
95872
+ * @instance
95873
+ */
95874
+ TransferPayload.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
95875
+
95876
+ /**
95877
+ * Creates a new TransferPayload instance using the specified properties.
95878
+ * @function create
95879
+ * @memberof TW.Pactus.Proto.TransferPayload
95880
+ * @static
95881
+ * @param {TW.Pactus.Proto.ITransferPayload=} [properties] Properties to set
95882
+ * @returns {TW.Pactus.Proto.TransferPayload} TransferPayload instance
95883
+ */
95884
+ TransferPayload.create = function create(properties) {
95885
+ return new TransferPayload(properties);
95886
+ };
95887
+
95888
+ /**
95889
+ * Encodes the specified TransferPayload message. Does not implicitly {@link TW.Pactus.Proto.TransferPayload.verify|verify} messages.
95890
+ * @function encode
95891
+ * @memberof TW.Pactus.Proto.TransferPayload
95892
+ * @static
95893
+ * @param {TW.Pactus.Proto.ITransferPayload} message TransferPayload message or plain object to encode
95894
+ * @param {$protobuf.Writer} [writer] Writer to encode to
95895
+ * @returns {$protobuf.Writer} Writer
95896
+ */
95897
+ TransferPayload.encode = function encode(message, writer) {
95898
+ if (!writer)
95899
+ writer = $Writer.create();
95900
+ if (message.sender != null && Object.hasOwnProperty.call(message, "sender"))
95901
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.sender);
95902
+ if (message.receiver != null && Object.hasOwnProperty.call(message, "receiver"))
95903
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.receiver);
95904
+ if (message.amount != null && Object.hasOwnProperty.call(message, "amount"))
95905
+ writer.uint32(/* id 3, wireType 0 =*/24).int64(message.amount);
95906
+ return writer;
95907
+ };
95908
+
95909
+ /**
95910
+ * Decodes a TransferPayload message from the specified reader or buffer.
95911
+ * @function decode
95912
+ * @memberof TW.Pactus.Proto.TransferPayload
95913
+ * @static
95914
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
95915
+ * @param {number} [length] Message length if known beforehand
95916
+ * @returns {TW.Pactus.Proto.TransferPayload} TransferPayload
95917
+ * @throws {Error} If the payload is not a reader or valid buffer
95918
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
95919
+ */
95920
+ TransferPayload.decode = function decode(reader, length) {
95921
+ if (!(reader instanceof $Reader))
95922
+ reader = $Reader.create(reader);
95923
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Pactus.Proto.TransferPayload();
95924
+ while (reader.pos < end) {
95925
+ var tag = reader.uint32();
95926
+ switch (tag >>> 3) {
95927
+ case 1:
95928
+ message.sender = reader.string();
95929
+ break;
95930
+ case 2:
95931
+ message.receiver = reader.string();
95932
+ break;
95933
+ case 3:
95934
+ message.amount = reader.int64();
95935
+ break;
95936
+ default:
95937
+ reader.skipType(tag & 7);
95938
+ break;
95939
+ }
95940
+ }
95941
+ return message;
95942
+ };
95943
+
95944
+ /**
95945
+ * Verifies a TransferPayload message.
95946
+ * @function verify
95947
+ * @memberof TW.Pactus.Proto.TransferPayload
95948
+ * @static
95949
+ * @param {Object.<string,*>} message Plain object to verify
95950
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
95951
+ */
95952
+ TransferPayload.verify = function verify(message) {
95953
+ if (typeof message !== "object" || message === null)
95954
+ return "object expected";
95955
+ if (message.sender != null && message.hasOwnProperty("sender"))
95956
+ if (!$util.isString(message.sender))
95957
+ return "sender: string expected";
95958
+ if (message.receiver != null && message.hasOwnProperty("receiver"))
95959
+ if (!$util.isString(message.receiver))
95960
+ return "receiver: string expected";
95961
+ if (message.amount != null && message.hasOwnProperty("amount"))
95962
+ if (!$util.isInteger(message.amount) && !(message.amount && $util.isInteger(message.amount.low) && $util.isInteger(message.amount.high)))
95963
+ return "amount: integer|Long expected";
95964
+ return null;
95965
+ };
95966
+
95967
+ /**
95968
+ * Creates a TransferPayload message from a plain object. Also converts values to their respective internal types.
95969
+ * @function fromObject
95970
+ * @memberof TW.Pactus.Proto.TransferPayload
95971
+ * @static
95972
+ * @param {Object.<string,*>} object Plain object
95973
+ * @returns {TW.Pactus.Proto.TransferPayload} TransferPayload
95974
+ */
95975
+ TransferPayload.fromObject = function fromObject(object) {
95976
+ if (object instanceof $root.TW.Pactus.Proto.TransferPayload)
95977
+ return object;
95978
+ var message = new $root.TW.Pactus.Proto.TransferPayload();
95979
+ if (object.sender != null)
95980
+ message.sender = String(object.sender);
95981
+ if (object.receiver != null)
95982
+ message.receiver = String(object.receiver);
95983
+ if (object.amount != null)
95984
+ if ($util.Long)
95985
+ (message.amount = $util.Long.fromValue(object.amount)).unsigned = false;
95986
+ else if (typeof object.amount === "string")
95987
+ message.amount = parseInt(object.amount, 10);
95988
+ else if (typeof object.amount === "number")
95989
+ message.amount = object.amount;
95990
+ else if (typeof object.amount === "object")
95991
+ message.amount = new $util.LongBits(object.amount.low >>> 0, object.amount.high >>> 0).toNumber();
95992
+ return message;
95993
+ };
95994
+
95995
+ /**
95996
+ * Creates a plain object from a TransferPayload message. Also converts values to other types if specified.
95997
+ * @function toObject
95998
+ * @memberof TW.Pactus.Proto.TransferPayload
95999
+ * @static
96000
+ * @param {TW.Pactus.Proto.TransferPayload} message TransferPayload
96001
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
96002
+ * @returns {Object.<string,*>} Plain object
96003
+ */
96004
+ TransferPayload.toObject = function toObject(message, options) {
96005
+ if (!options)
96006
+ options = {};
96007
+ var object = {};
96008
+ if (options.defaults) {
96009
+ object.sender = "";
96010
+ object.receiver = "";
96011
+ if ($util.Long) {
96012
+ var long = new $util.Long(0, 0, false);
96013
+ object.amount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
96014
+ } else
96015
+ object.amount = options.longs === String ? "0" : 0;
96016
+ }
96017
+ if (message.sender != null && message.hasOwnProperty("sender"))
96018
+ object.sender = message.sender;
96019
+ if (message.receiver != null && message.hasOwnProperty("receiver"))
96020
+ object.receiver = message.receiver;
96021
+ if (message.amount != null && message.hasOwnProperty("amount"))
96022
+ if (typeof message.amount === "number")
96023
+ object.amount = options.longs === String ? String(message.amount) : message.amount;
96024
+ else
96025
+ 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;
96026
+ return object;
96027
+ };
96028
+
96029
+ /**
96030
+ * Converts this TransferPayload to JSON.
96031
+ * @function toJSON
96032
+ * @memberof TW.Pactus.Proto.TransferPayload
96033
+ * @instance
96034
+ * @returns {Object.<string,*>} JSON object
96035
+ */
96036
+ TransferPayload.prototype.toJSON = function toJSON() {
96037
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
96038
+ };
96039
+
96040
+ return TransferPayload;
96041
+ })();
96042
+
96043
+ Proto.BondPayload = (function() {
96044
+
96045
+ /**
96046
+ * Properties of a BondPayload.
96047
+ * @memberof TW.Pactus.Proto
96048
+ * @interface IBondPayload
96049
+ * @property {string|null} [sender] BondPayload sender
96050
+ * @property {string|null} [receiver] BondPayload receiver
96051
+ * @property {Long|null} [stake] BondPayload stake
96052
+ * @property {string|null} [publicKey] BondPayload publicKey
96053
+ */
96054
+
96055
+ /**
96056
+ * Constructs a new BondPayload.
96057
+ * @memberof TW.Pactus.Proto
96058
+ * @classdesc Represents a BondPayload.
96059
+ * @implements IBondPayload
96060
+ * @constructor
96061
+ * @param {TW.Pactus.Proto.IBondPayload=} [properties] Properties to set
96062
+ */
96063
+ function BondPayload(properties) {
96064
+ if (properties)
96065
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
96066
+ if (properties[keys[i]] != null)
96067
+ this[keys[i]] = properties[keys[i]];
96068
+ }
96069
+
96070
+ /**
96071
+ * BondPayload sender.
96072
+ * @member {string} sender
96073
+ * @memberof TW.Pactus.Proto.BondPayload
96074
+ * @instance
96075
+ */
96076
+ BondPayload.prototype.sender = "";
96077
+
96078
+ /**
96079
+ * BondPayload receiver.
96080
+ * @member {string} receiver
96081
+ * @memberof TW.Pactus.Proto.BondPayload
96082
+ * @instance
96083
+ */
96084
+ BondPayload.prototype.receiver = "";
96085
+
96086
+ /**
96087
+ * BondPayload stake.
96088
+ * @member {Long} stake
96089
+ * @memberof TW.Pactus.Proto.BondPayload
96090
+ * @instance
96091
+ */
96092
+ BondPayload.prototype.stake = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
96093
+
96094
+ /**
96095
+ * BondPayload publicKey.
96096
+ * @member {string} publicKey
96097
+ * @memberof TW.Pactus.Proto.BondPayload
96098
+ * @instance
96099
+ */
96100
+ BondPayload.prototype.publicKey = "";
96101
+
96102
+ /**
96103
+ * Creates a new BondPayload instance using the specified properties.
96104
+ * @function create
96105
+ * @memberof TW.Pactus.Proto.BondPayload
96106
+ * @static
96107
+ * @param {TW.Pactus.Proto.IBondPayload=} [properties] Properties to set
96108
+ * @returns {TW.Pactus.Proto.BondPayload} BondPayload instance
96109
+ */
96110
+ BondPayload.create = function create(properties) {
96111
+ return new BondPayload(properties);
96112
+ };
96113
+
96114
+ /**
96115
+ * Encodes the specified BondPayload message. Does not implicitly {@link TW.Pactus.Proto.BondPayload.verify|verify} messages.
96116
+ * @function encode
96117
+ * @memberof TW.Pactus.Proto.BondPayload
96118
+ * @static
96119
+ * @param {TW.Pactus.Proto.IBondPayload} message BondPayload message or plain object to encode
96120
+ * @param {$protobuf.Writer} [writer] Writer to encode to
96121
+ * @returns {$protobuf.Writer} Writer
96122
+ */
96123
+ BondPayload.encode = function encode(message, writer) {
96124
+ if (!writer)
96125
+ writer = $Writer.create();
96126
+ if (message.sender != null && Object.hasOwnProperty.call(message, "sender"))
96127
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.sender);
96128
+ if (message.receiver != null && Object.hasOwnProperty.call(message, "receiver"))
96129
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.receiver);
96130
+ if (message.stake != null && Object.hasOwnProperty.call(message, "stake"))
96131
+ writer.uint32(/* id 3, wireType 0 =*/24).int64(message.stake);
96132
+ if (message.publicKey != null && Object.hasOwnProperty.call(message, "publicKey"))
96133
+ writer.uint32(/* id 4, wireType 2 =*/34).string(message.publicKey);
96134
+ return writer;
96135
+ };
96136
+
96137
+ /**
96138
+ * Decodes a BondPayload message from the specified reader or buffer.
96139
+ * @function decode
96140
+ * @memberof TW.Pactus.Proto.BondPayload
96141
+ * @static
96142
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
96143
+ * @param {number} [length] Message length if known beforehand
96144
+ * @returns {TW.Pactus.Proto.BondPayload} BondPayload
96145
+ * @throws {Error} If the payload is not a reader or valid buffer
96146
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
96147
+ */
96148
+ BondPayload.decode = function decode(reader, length) {
96149
+ if (!(reader instanceof $Reader))
96150
+ reader = $Reader.create(reader);
96151
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Pactus.Proto.BondPayload();
96152
+ while (reader.pos < end) {
96153
+ var tag = reader.uint32();
96154
+ switch (tag >>> 3) {
96155
+ case 1:
96156
+ message.sender = reader.string();
96157
+ break;
96158
+ case 2:
96159
+ message.receiver = reader.string();
96160
+ break;
96161
+ case 3:
96162
+ message.stake = reader.int64();
96163
+ break;
96164
+ case 4:
96165
+ message.publicKey = reader.string();
96166
+ break;
96167
+ default:
96168
+ reader.skipType(tag & 7);
96169
+ break;
96170
+ }
96171
+ }
96172
+ return message;
96173
+ };
96174
+
96175
+ /**
96176
+ * Verifies a BondPayload message.
96177
+ * @function verify
96178
+ * @memberof TW.Pactus.Proto.BondPayload
96179
+ * @static
96180
+ * @param {Object.<string,*>} message Plain object to verify
96181
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
96182
+ */
96183
+ BondPayload.verify = function verify(message) {
96184
+ if (typeof message !== "object" || message === null)
96185
+ return "object expected";
96186
+ if (message.sender != null && message.hasOwnProperty("sender"))
96187
+ if (!$util.isString(message.sender))
96188
+ return "sender: string expected";
96189
+ if (message.receiver != null && message.hasOwnProperty("receiver"))
96190
+ if (!$util.isString(message.receiver))
96191
+ return "receiver: string expected";
96192
+ if (message.stake != null && message.hasOwnProperty("stake"))
96193
+ if (!$util.isInteger(message.stake) && !(message.stake && $util.isInteger(message.stake.low) && $util.isInteger(message.stake.high)))
96194
+ return "stake: integer|Long expected";
96195
+ if (message.publicKey != null && message.hasOwnProperty("publicKey"))
96196
+ if (!$util.isString(message.publicKey))
96197
+ return "publicKey: string expected";
96198
+ return null;
96199
+ };
96200
+
96201
+ /**
96202
+ * Creates a BondPayload message from a plain object. Also converts values to their respective internal types.
96203
+ * @function fromObject
96204
+ * @memberof TW.Pactus.Proto.BondPayload
96205
+ * @static
96206
+ * @param {Object.<string,*>} object Plain object
96207
+ * @returns {TW.Pactus.Proto.BondPayload} BondPayload
96208
+ */
96209
+ BondPayload.fromObject = function fromObject(object) {
96210
+ if (object instanceof $root.TW.Pactus.Proto.BondPayload)
96211
+ return object;
96212
+ var message = new $root.TW.Pactus.Proto.BondPayload();
96213
+ if (object.sender != null)
96214
+ message.sender = String(object.sender);
96215
+ if (object.receiver != null)
96216
+ message.receiver = String(object.receiver);
96217
+ if (object.stake != null)
96218
+ if ($util.Long)
96219
+ (message.stake = $util.Long.fromValue(object.stake)).unsigned = false;
96220
+ else if (typeof object.stake === "string")
96221
+ message.stake = parseInt(object.stake, 10);
96222
+ else if (typeof object.stake === "number")
96223
+ message.stake = object.stake;
96224
+ else if (typeof object.stake === "object")
96225
+ message.stake = new $util.LongBits(object.stake.low >>> 0, object.stake.high >>> 0).toNumber();
96226
+ if (object.publicKey != null)
96227
+ message.publicKey = String(object.publicKey);
96228
+ return message;
96229
+ };
96230
+
96231
+ /**
96232
+ * Creates a plain object from a BondPayload message. Also converts values to other types if specified.
96233
+ * @function toObject
96234
+ * @memberof TW.Pactus.Proto.BondPayload
96235
+ * @static
96236
+ * @param {TW.Pactus.Proto.BondPayload} message BondPayload
96237
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
96238
+ * @returns {Object.<string,*>} Plain object
96239
+ */
96240
+ BondPayload.toObject = function toObject(message, options) {
96241
+ if (!options)
96242
+ options = {};
96243
+ var object = {};
96244
+ if (options.defaults) {
96245
+ object.sender = "";
96246
+ object.receiver = "";
96247
+ if ($util.Long) {
96248
+ var long = new $util.Long(0, 0, false);
96249
+ object.stake = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
96250
+ } else
96251
+ object.stake = options.longs === String ? "0" : 0;
96252
+ object.publicKey = "";
96253
+ }
96254
+ if (message.sender != null && message.hasOwnProperty("sender"))
96255
+ object.sender = message.sender;
96256
+ if (message.receiver != null && message.hasOwnProperty("receiver"))
96257
+ object.receiver = message.receiver;
96258
+ if (message.stake != null && message.hasOwnProperty("stake"))
96259
+ if (typeof message.stake === "number")
96260
+ object.stake = options.longs === String ? String(message.stake) : message.stake;
96261
+ else
96262
+ 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;
96263
+ if (message.publicKey != null && message.hasOwnProperty("publicKey"))
96264
+ object.publicKey = message.publicKey;
96265
+ return object;
96266
+ };
96267
+
96268
+ /**
96269
+ * Converts this BondPayload to JSON.
96270
+ * @function toJSON
96271
+ * @memberof TW.Pactus.Proto.BondPayload
96272
+ * @instance
96273
+ * @returns {Object.<string,*>} JSON object
96274
+ */
96275
+ BondPayload.prototype.toJSON = function toJSON() {
96276
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
96277
+ };
96278
+
96279
+ return BondPayload;
96280
+ })();
96281
+
96282
+ Proto.SigningInput = (function() {
96283
+
96284
+ /**
96285
+ * Properties of a SigningInput.
96286
+ * @memberof TW.Pactus.Proto
96287
+ * @interface ISigningInput
96288
+ * @property {Uint8Array|null} [privateKey] SigningInput privateKey
96289
+ * @property {TW.Pactus.Proto.ITransactionMessage|null} [transaction] SigningInput transaction
96290
+ */
96291
+
96292
+ /**
96293
+ * Constructs a new SigningInput.
96294
+ * @memberof TW.Pactus.Proto
96295
+ * @classdesc Represents a SigningInput.
96296
+ * @implements ISigningInput
96297
+ * @constructor
96298
+ * @param {TW.Pactus.Proto.ISigningInput=} [properties] Properties to set
96299
+ */
96300
+ function SigningInput(properties) {
96301
+ if (properties)
96302
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
96303
+ if (properties[keys[i]] != null)
96304
+ this[keys[i]] = properties[keys[i]];
96305
+ }
96306
+
96307
+ /**
96308
+ * SigningInput privateKey.
96309
+ * @member {Uint8Array} privateKey
96310
+ * @memberof TW.Pactus.Proto.SigningInput
96311
+ * @instance
96312
+ */
96313
+ SigningInput.prototype.privateKey = $util.newBuffer([]);
96314
+
96315
+ /**
96316
+ * SigningInput transaction.
96317
+ * @member {TW.Pactus.Proto.ITransactionMessage|null|undefined} transaction
96318
+ * @memberof TW.Pactus.Proto.SigningInput
96319
+ * @instance
96320
+ */
96321
+ SigningInput.prototype.transaction = null;
96322
+
96323
+ /**
96324
+ * Creates a new SigningInput instance using the specified properties.
96325
+ * @function create
96326
+ * @memberof TW.Pactus.Proto.SigningInput
96327
+ * @static
96328
+ * @param {TW.Pactus.Proto.ISigningInput=} [properties] Properties to set
96329
+ * @returns {TW.Pactus.Proto.SigningInput} SigningInput instance
96330
+ */
96331
+ SigningInput.create = function create(properties) {
96332
+ return new SigningInput(properties);
96333
+ };
96334
+
96335
+ /**
96336
+ * Encodes the specified SigningInput message. Does not implicitly {@link TW.Pactus.Proto.SigningInput.verify|verify} messages.
96337
+ * @function encode
96338
+ * @memberof TW.Pactus.Proto.SigningInput
96339
+ * @static
96340
+ * @param {TW.Pactus.Proto.ISigningInput} message SigningInput message or plain object to encode
96341
+ * @param {$protobuf.Writer} [writer] Writer to encode to
96342
+ * @returns {$protobuf.Writer} Writer
96343
+ */
96344
+ SigningInput.encode = function encode(message, writer) {
96345
+ if (!writer)
96346
+ writer = $Writer.create();
96347
+ if (message.privateKey != null && Object.hasOwnProperty.call(message, "privateKey"))
96348
+ writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.privateKey);
96349
+ if (message.transaction != null && Object.hasOwnProperty.call(message, "transaction"))
96350
+ $root.TW.Pactus.Proto.TransactionMessage.encode(message.transaction, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
96351
+ return writer;
96352
+ };
96353
+
96354
+ /**
96355
+ * Decodes a SigningInput message from the specified reader or buffer.
96356
+ * @function decode
96357
+ * @memberof TW.Pactus.Proto.SigningInput
96358
+ * @static
96359
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
96360
+ * @param {number} [length] Message length if known beforehand
96361
+ * @returns {TW.Pactus.Proto.SigningInput} SigningInput
96362
+ * @throws {Error} If the payload is not a reader or valid buffer
96363
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
96364
+ */
96365
+ SigningInput.decode = function decode(reader, length) {
96366
+ if (!(reader instanceof $Reader))
96367
+ reader = $Reader.create(reader);
96368
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Pactus.Proto.SigningInput();
96369
+ while (reader.pos < end) {
96370
+ var tag = reader.uint32();
96371
+ switch (tag >>> 3) {
96372
+ case 1:
96373
+ message.privateKey = reader.bytes();
96374
+ break;
96375
+ case 2:
96376
+ message.transaction = $root.TW.Pactus.Proto.TransactionMessage.decode(reader, reader.uint32());
96377
+ break;
96378
+ default:
96379
+ reader.skipType(tag & 7);
96380
+ break;
96381
+ }
96382
+ }
96383
+ return message;
96384
+ };
96385
+
96386
+ /**
96387
+ * Verifies a SigningInput message.
96388
+ * @function verify
96389
+ * @memberof TW.Pactus.Proto.SigningInput
96390
+ * @static
96391
+ * @param {Object.<string,*>} message Plain object to verify
96392
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
96393
+ */
96394
+ SigningInput.verify = function verify(message) {
96395
+ if (typeof message !== "object" || message === null)
96396
+ return "object expected";
96397
+ if (message.privateKey != null && message.hasOwnProperty("privateKey"))
96398
+ if (!(message.privateKey && typeof message.privateKey.length === "number" || $util.isString(message.privateKey)))
96399
+ return "privateKey: buffer expected";
96400
+ if (message.transaction != null && message.hasOwnProperty("transaction")) {
96401
+ var error = $root.TW.Pactus.Proto.TransactionMessage.verify(message.transaction);
96402
+ if (error)
96403
+ return "transaction." + error;
96404
+ }
96405
+ return null;
96406
+ };
96407
+
96408
+ /**
96409
+ * Creates a SigningInput message from a plain object. Also converts values to their respective internal types.
96410
+ * @function fromObject
96411
+ * @memberof TW.Pactus.Proto.SigningInput
96412
+ * @static
96413
+ * @param {Object.<string,*>} object Plain object
96414
+ * @returns {TW.Pactus.Proto.SigningInput} SigningInput
96415
+ */
96416
+ SigningInput.fromObject = function fromObject(object) {
96417
+ if (object instanceof $root.TW.Pactus.Proto.SigningInput)
96418
+ return object;
96419
+ var message = new $root.TW.Pactus.Proto.SigningInput();
96420
+ if (object.privateKey != null)
96421
+ if (typeof object.privateKey === "string")
96422
+ $util.base64.decode(object.privateKey, message.privateKey = $util.newBuffer($util.base64.length(object.privateKey)), 0);
96423
+ else if (object.privateKey.length)
96424
+ message.privateKey = object.privateKey;
96425
+ if (object.transaction != null) {
96426
+ if (typeof object.transaction !== "object")
96427
+ throw TypeError(".TW.Pactus.Proto.SigningInput.transaction: object expected");
96428
+ message.transaction = $root.TW.Pactus.Proto.TransactionMessage.fromObject(object.transaction);
96429
+ }
96430
+ return message;
96431
+ };
96432
+
96433
+ /**
96434
+ * Creates a plain object from a SigningInput message. Also converts values to other types if specified.
96435
+ * @function toObject
96436
+ * @memberof TW.Pactus.Proto.SigningInput
96437
+ * @static
96438
+ * @param {TW.Pactus.Proto.SigningInput} message SigningInput
96439
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
96440
+ * @returns {Object.<string,*>} Plain object
96441
+ */
96442
+ SigningInput.toObject = function toObject(message, options) {
96443
+ if (!options)
96444
+ options = {};
96445
+ var object = {};
96446
+ if (options.defaults) {
96447
+ if (options.bytes === String)
96448
+ object.privateKey = "";
96449
+ else {
96450
+ object.privateKey = [];
96451
+ if (options.bytes !== Array)
96452
+ object.privateKey = $util.newBuffer(object.privateKey);
96453
+ }
96454
+ object.transaction = null;
96455
+ }
96456
+ if (message.privateKey != null && message.hasOwnProperty("privateKey"))
96457
+ 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;
96458
+ if (message.transaction != null && message.hasOwnProperty("transaction"))
96459
+ object.transaction = $root.TW.Pactus.Proto.TransactionMessage.toObject(message.transaction, options);
96460
+ return object;
96461
+ };
96462
+
96463
+ /**
96464
+ * Converts this SigningInput to JSON.
96465
+ * @function toJSON
96466
+ * @memberof TW.Pactus.Proto.SigningInput
96467
+ * @instance
96468
+ * @returns {Object.<string,*>} JSON object
96469
+ */
96470
+ SigningInput.prototype.toJSON = function toJSON() {
96471
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
96472
+ };
96473
+
96474
+ return SigningInput;
96475
+ })();
96476
+
96477
+ Proto.SigningOutput = (function() {
96478
+
96479
+ /**
96480
+ * Properties of a SigningOutput.
96481
+ * @memberof TW.Pactus.Proto
96482
+ * @interface ISigningOutput
96483
+ * @property {Uint8Array|null} [transactionId] SigningOutput transactionId
96484
+ * @property {Uint8Array|null} [signedTransactionData] SigningOutput signedTransactionData
96485
+ * @property {Uint8Array|null} [signature] SigningOutput signature
96486
+ * @property {TW.Common.Proto.SigningError|null} [error] SigningOutput error
96487
+ * @property {string|null} [errorMessage] SigningOutput errorMessage
96488
+ */
96489
+
96490
+ /**
96491
+ * Constructs a new SigningOutput.
96492
+ * @memberof TW.Pactus.Proto
96493
+ * @classdesc Represents a SigningOutput.
96494
+ * @implements ISigningOutput
96495
+ * @constructor
96496
+ * @param {TW.Pactus.Proto.ISigningOutput=} [properties] Properties to set
96497
+ */
96498
+ function SigningOutput(properties) {
96499
+ if (properties)
96500
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
96501
+ if (properties[keys[i]] != null)
96502
+ this[keys[i]] = properties[keys[i]];
96503
+ }
96504
+
96505
+ /**
96506
+ * SigningOutput transactionId.
96507
+ * @member {Uint8Array} transactionId
96508
+ * @memberof TW.Pactus.Proto.SigningOutput
96509
+ * @instance
96510
+ */
96511
+ SigningOutput.prototype.transactionId = $util.newBuffer([]);
96512
+
96513
+ /**
96514
+ * SigningOutput signedTransactionData.
96515
+ * @member {Uint8Array} signedTransactionData
96516
+ * @memberof TW.Pactus.Proto.SigningOutput
96517
+ * @instance
96518
+ */
96519
+ SigningOutput.prototype.signedTransactionData = $util.newBuffer([]);
96520
+
96521
+ /**
96522
+ * SigningOutput signature.
96523
+ * @member {Uint8Array} signature
96524
+ * @memberof TW.Pactus.Proto.SigningOutput
96525
+ * @instance
96526
+ */
96527
+ SigningOutput.prototype.signature = $util.newBuffer([]);
96528
+
96529
+ /**
96530
+ * SigningOutput error.
96531
+ * @member {TW.Common.Proto.SigningError} error
96532
+ * @memberof TW.Pactus.Proto.SigningOutput
96533
+ * @instance
96534
+ */
96535
+ SigningOutput.prototype.error = 0;
96536
+
96537
+ /**
96538
+ * SigningOutput errorMessage.
96539
+ * @member {string} errorMessage
96540
+ * @memberof TW.Pactus.Proto.SigningOutput
96541
+ * @instance
96542
+ */
96543
+ SigningOutput.prototype.errorMessage = "";
96544
+
96545
+ /**
96546
+ * Creates a new SigningOutput instance using the specified properties.
96547
+ * @function create
96548
+ * @memberof TW.Pactus.Proto.SigningOutput
96549
+ * @static
96550
+ * @param {TW.Pactus.Proto.ISigningOutput=} [properties] Properties to set
96551
+ * @returns {TW.Pactus.Proto.SigningOutput} SigningOutput instance
96552
+ */
96553
+ SigningOutput.create = function create(properties) {
96554
+ return new SigningOutput(properties);
96555
+ };
96556
+
96557
+ /**
96558
+ * Encodes the specified SigningOutput message. Does not implicitly {@link TW.Pactus.Proto.SigningOutput.verify|verify} messages.
96559
+ * @function encode
96560
+ * @memberof TW.Pactus.Proto.SigningOutput
96561
+ * @static
96562
+ * @param {TW.Pactus.Proto.ISigningOutput} message SigningOutput message or plain object to encode
96563
+ * @param {$protobuf.Writer} [writer] Writer to encode to
96564
+ * @returns {$protobuf.Writer} Writer
96565
+ */
96566
+ SigningOutput.encode = function encode(message, writer) {
96567
+ if (!writer)
96568
+ writer = $Writer.create();
96569
+ if (message.transactionId != null && Object.hasOwnProperty.call(message, "transactionId"))
96570
+ writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.transactionId);
96571
+ if (message.signedTransactionData != null && Object.hasOwnProperty.call(message, "signedTransactionData"))
96572
+ writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.signedTransactionData);
96573
+ if (message.signature != null && Object.hasOwnProperty.call(message, "signature"))
96574
+ writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.signature);
96575
+ if (message.error != null && Object.hasOwnProperty.call(message, "error"))
96576
+ writer.uint32(/* id 4, wireType 0 =*/32).int32(message.error);
96577
+ if (message.errorMessage != null && Object.hasOwnProperty.call(message, "errorMessage"))
96578
+ writer.uint32(/* id 5, wireType 2 =*/42).string(message.errorMessage);
96579
+ return writer;
96580
+ };
96581
+
96582
+ /**
96583
+ * Decodes a SigningOutput message from the specified reader or buffer.
96584
+ * @function decode
96585
+ * @memberof TW.Pactus.Proto.SigningOutput
96586
+ * @static
96587
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
96588
+ * @param {number} [length] Message length if known beforehand
96589
+ * @returns {TW.Pactus.Proto.SigningOutput} SigningOutput
96590
+ * @throws {Error} If the payload is not a reader or valid buffer
96591
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
96592
+ */
96593
+ SigningOutput.decode = function decode(reader, length) {
96594
+ if (!(reader instanceof $Reader))
96595
+ reader = $Reader.create(reader);
96596
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.TW.Pactus.Proto.SigningOutput();
96597
+ while (reader.pos < end) {
96598
+ var tag = reader.uint32();
96599
+ switch (tag >>> 3) {
96600
+ case 1:
96601
+ message.transactionId = reader.bytes();
96602
+ break;
96603
+ case 2:
96604
+ message.signedTransactionData = reader.bytes();
96605
+ break;
96606
+ case 3:
96607
+ message.signature = reader.bytes();
96608
+ break;
96609
+ case 4:
96610
+ message.error = reader.int32();
96611
+ break;
96612
+ case 5:
96613
+ message.errorMessage = reader.string();
96614
+ break;
96615
+ default:
96616
+ reader.skipType(tag & 7);
96617
+ break;
96618
+ }
96619
+ }
96620
+ return message;
96621
+ };
96622
+
96623
+ /**
96624
+ * Verifies a SigningOutput message.
96625
+ * @function verify
96626
+ * @memberof TW.Pactus.Proto.SigningOutput
96627
+ * @static
96628
+ * @param {Object.<string,*>} message Plain object to verify
96629
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
96630
+ */
96631
+ SigningOutput.verify = function verify(message) {
96632
+ if (typeof message !== "object" || message === null)
96633
+ return "object expected";
96634
+ if (message.transactionId != null && message.hasOwnProperty("transactionId"))
96635
+ if (!(message.transactionId && typeof message.transactionId.length === "number" || $util.isString(message.transactionId)))
96636
+ return "transactionId: buffer expected";
96637
+ if (message.signedTransactionData != null && message.hasOwnProperty("signedTransactionData"))
96638
+ if (!(message.signedTransactionData && typeof message.signedTransactionData.length === "number" || $util.isString(message.signedTransactionData)))
96639
+ return "signedTransactionData: buffer expected";
96640
+ if (message.signature != null && message.hasOwnProperty("signature"))
96641
+ if (!(message.signature && typeof message.signature.length === "number" || $util.isString(message.signature)))
96642
+ return "signature: buffer expected";
96643
+ if (message.error != null && message.hasOwnProperty("error"))
96644
+ switch (message.error) {
96645
+ default:
96646
+ return "error: enum value expected";
96647
+ case 0:
96648
+ case 1:
96649
+ case 2:
96650
+ case 3:
96651
+ case 4:
96652
+ case 5:
96653
+ case 15:
96654
+ case 16:
96655
+ case 17:
96656
+ case 18:
96657
+ case 6:
96658
+ case 7:
96659
+ case 8:
96660
+ case 9:
96661
+ case 10:
96662
+ case 11:
96663
+ case 12:
96664
+ case 13:
96665
+ case 14:
96666
+ case 19:
96667
+ case 20:
96668
+ case 21:
96669
+ case 22:
96670
+ case 23:
96671
+ case 24:
96672
+ case 25:
96673
+ break;
96674
+ }
96675
+ if (message.errorMessage != null && message.hasOwnProperty("errorMessage"))
96676
+ if (!$util.isString(message.errorMessage))
96677
+ return "errorMessage: string expected";
96678
+ return null;
96679
+ };
96680
+
96681
+ /**
96682
+ * Creates a SigningOutput message from a plain object. Also converts values to their respective internal types.
96683
+ * @function fromObject
96684
+ * @memberof TW.Pactus.Proto.SigningOutput
96685
+ * @static
96686
+ * @param {Object.<string,*>} object Plain object
96687
+ * @returns {TW.Pactus.Proto.SigningOutput} SigningOutput
96688
+ */
96689
+ SigningOutput.fromObject = function fromObject(object) {
96690
+ if (object instanceof $root.TW.Pactus.Proto.SigningOutput)
96691
+ return object;
96692
+ var message = new $root.TW.Pactus.Proto.SigningOutput();
96693
+ if (object.transactionId != null)
96694
+ if (typeof object.transactionId === "string")
96695
+ $util.base64.decode(object.transactionId, message.transactionId = $util.newBuffer($util.base64.length(object.transactionId)), 0);
96696
+ else if (object.transactionId.length)
96697
+ message.transactionId = object.transactionId;
96698
+ if (object.signedTransactionData != null)
96699
+ if (typeof object.signedTransactionData === "string")
96700
+ $util.base64.decode(object.signedTransactionData, message.signedTransactionData = $util.newBuffer($util.base64.length(object.signedTransactionData)), 0);
96701
+ else if (object.signedTransactionData.length)
96702
+ message.signedTransactionData = object.signedTransactionData;
96703
+ if (object.signature != null)
96704
+ if (typeof object.signature === "string")
96705
+ $util.base64.decode(object.signature, message.signature = $util.newBuffer($util.base64.length(object.signature)), 0);
96706
+ else if (object.signature.length)
96707
+ message.signature = object.signature;
96708
+ switch (object.error) {
96709
+ case "OK":
96710
+ case 0:
96711
+ message.error = 0;
96712
+ break;
96713
+ case "Error_general":
96714
+ case 1:
96715
+ message.error = 1;
96716
+ break;
96717
+ case "Error_internal":
96718
+ case 2:
96719
+ message.error = 2;
96720
+ break;
96721
+ case "Error_low_balance":
96722
+ case 3:
96723
+ message.error = 3;
96724
+ break;
96725
+ case "Error_zero_amount_requested":
96726
+ case 4:
96727
+ message.error = 4;
96728
+ break;
96729
+ case "Error_missing_private_key":
96730
+ case 5:
96731
+ message.error = 5;
96732
+ break;
96733
+ case "Error_invalid_private_key":
96734
+ case 15:
96735
+ message.error = 15;
96736
+ break;
96737
+ case "Error_invalid_address":
96738
+ case 16:
96739
+ message.error = 16;
96740
+ break;
96741
+ case "Error_invalid_utxo":
96742
+ case 17:
96743
+ message.error = 17;
96744
+ break;
96745
+ case "Error_invalid_utxo_amount":
96746
+ case 18:
96747
+ message.error = 18;
96748
+ break;
96749
+ case "Error_wrong_fee":
96750
+ case 6:
96751
+ message.error = 6;
96752
+ break;
96753
+ case "Error_signing":
96754
+ case 7:
96755
+ message.error = 7;
96756
+ break;
96757
+ case "Error_tx_too_big":
96758
+ case 8:
96759
+ message.error = 8;
96760
+ break;
96761
+ case "Error_missing_input_utxos":
96762
+ case 9:
96763
+ message.error = 9;
96764
+ break;
96765
+ case "Error_not_enough_utxos":
96766
+ case 10:
96767
+ message.error = 10;
96768
+ break;
96769
+ case "Error_script_redeem":
96770
+ case 11:
96771
+ message.error = 11;
96772
+ break;
96773
+ case "Error_script_output":
96774
+ case 12:
96775
+ message.error = 12;
96776
+ break;
96777
+ case "Error_script_witness_program":
96778
+ case 13:
96779
+ message.error = 13;
96780
+ break;
96781
+ case "Error_invalid_memo":
96782
+ case 14:
96783
+ message.error = 14;
96784
+ break;
96785
+ case "Error_input_parse":
96786
+ case 19:
96787
+ message.error = 19;
96788
+ break;
96789
+ case "Error_no_support_n2n":
96790
+ case 20:
96791
+ message.error = 20;
96792
+ break;
96793
+ case "Error_signatures_count":
96794
+ case 21:
96795
+ message.error = 21;
96796
+ break;
96797
+ case "Error_invalid_params":
96798
+ case 22:
96799
+ message.error = 22;
96800
+ break;
96801
+ case "Error_invalid_requested_token_amount":
96802
+ case 23:
96803
+ message.error = 23;
96804
+ break;
96805
+ case "Error_not_supported":
96806
+ case 24:
96807
+ message.error = 24;
96808
+ break;
96809
+ case "Error_dust_amount_requested":
96810
+ case 25:
96811
+ message.error = 25;
96812
+ break;
96813
+ }
96814
+ if (object.errorMessage != null)
96815
+ message.errorMessage = String(object.errorMessage);
96816
+ return message;
96817
+ };
96818
+
96819
+ /**
96820
+ * Creates a plain object from a SigningOutput message. Also converts values to other types if specified.
96821
+ * @function toObject
96822
+ * @memberof TW.Pactus.Proto.SigningOutput
96823
+ * @static
96824
+ * @param {TW.Pactus.Proto.SigningOutput} message SigningOutput
96825
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
96826
+ * @returns {Object.<string,*>} Plain object
96827
+ */
96828
+ SigningOutput.toObject = function toObject(message, options) {
96829
+ if (!options)
96830
+ options = {};
96831
+ var object = {};
96832
+ if (options.defaults) {
96833
+ if (options.bytes === String)
96834
+ object.transactionId = "";
96835
+ else {
96836
+ object.transactionId = [];
96837
+ if (options.bytes !== Array)
96838
+ object.transactionId = $util.newBuffer(object.transactionId);
96839
+ }
96840
+ if (options.bytes === String)
96841
+ object.signedTransactionData = "";
96842
+ else {
96843
+ object.signedTransactionData = [];
96844
+ if (options.bytes !== Array)
96845
+ object.signedTransactionData = $util.newBuffer(object.signedTransactionData);
96846
+ }
96847
+ if (options.bytes === String)
96848
+ object.signature = "";
96849
+ else {
96850
+ object.signature = [];
96851
+ if (options.bytes !== Array)
96852
+ object.signature = $util.newBuffer(object.signature);
96853
+ }
96854
+ object.error = options.enums === String ? "OK" : 0;
96855
+ object.errorMessage = "";
96856
+ }
96857
+ if (message.transactionId != null && message.hasOwnProperty("transactionId"))
96858
+ 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;
96859
+ if (message.signedTransactionData != null && message.hasOwnProperty("signedTransactionData"))
96860
+ 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;
96861
+ if (message.signature != null && message.hasOwnProperty("signature"))
96862
+ 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;
96863
+ if (message.error != null && message.hasOwnProperty("error"))
96864
+ object.error = options.enums === String ? $root.TW.Common.Proto.SigningError[message.error] : message.error;
96865
+ if (message.errorMessage != null && message.hasOwnProperty("errorMessage"))
96866
+ object.errorMessage = message.errorMessage;
96867
+ return object;
96868
+ };
96869
+
96870
+ /**
96871
+ * Converts this SigningOutput to JSON.
96872
+ * @function toJSON
96873
+ * @memberof TW.Pactus.Proto.SigningOutput
96874
+ * @instance
96875
+ * @returns {Object.<string,*>} JSON object
96876
+ */
96877
+ SigningOutput.prototype.toJSON = function toJSON() {
96878
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
96879
+ };
96880
+
96881
+ return SigningOutput;
96882
+ })();
96883
+
96884
+ return Proto;
96885
+ })();
96886
+
96887
+ return Pactus;
96888
+ })();
96889
+
95510
96890
  TW.Polkadot = (function() {
95511
96891
 
95512
96892
  /**
@@ -128934,6 +130314,7 @@
128934
130314
  * @property {Long|null} [expiration] Transaction expiration
128935
130315
  * @property {TW.Tron.Proto.IBlockHeader|null} [blockHeader] Transaction blockHeader
128936
130316
  * @property {Long|null} [feeLimit] Transaction feeLimit
130317
+ * @property {string|null} [memo] Transaction memo
128937
130318
  * @property {TW.Tron.Proto.ITransferContract|null} [transfer] Transaction transfer
128938
130319
  * @property {TW.Tron.Proto.ITransferAssetContract|null} [transferAsset] Transaction transferAsset
128939
130320
  * @property {TW.Tron.Proto.IFreezeBalanceContract|null} [freezeBalance] Transaction freezeBalance
@@ -128998,6 +130379,14 @@
128998
130379
  */
128999
130380
  Transaction.prototype.feeLimit = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
129000
130381
 
130382
+ /**
130383
+ * Transaction memo.
130384
+ * @member {string} memo
130385
+ * @memberof TW.Tron.Proto.Transaction
130386
+ * @instance
130387
+ */
130388
+ Transaction.prototype.memo = "";
130389
+
129001
130390
  /**
129002
130391
  * Transaction transfer.
129003
130392
  * @member {TW.Tron.Proto.ITransferContract|null|undefined} transfer
@@ -129164,6 +130553,8 @@
129164
130553
  $root.TW.Tron.Proto.BlockHeader.encode(message.blockHeader, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
129165
130554
  if (message.feeLimit != null && Object.hasOwnProperty.call(message, "feeLimit"))
129166
130555
  writer.uint32(/* id 4, wireType 0 =*/32).int64(message.feeLimit);
130556
+ if (message.memo != null && Object.hasOwnProperty.call(message, "memo"))
130557
+ writer.uint32(/* id 5, wireType 2 =*/42).string(message.memo);
129167
130558
  if (message.transfer != null && Object.hasOwnProperty.call(message, "transfer"))
129168
130559
  $root.TW.Tron.Proto.TransferContract.encode(message.transfer, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim();
129169
130560
  if (message.transferAsset != null && Object.hasOwnProperty.call(message, "transferAsset"))
@@ -129227,6 +130618,9 @@
129227
130618
  case 4:
129228
130619
  message.feeLimit = reader.int64();
129229
130620
  break;
130621
+ case 5:
130622
+ message.memo = reader.string();
130623
+ break;
129230
130624
  case 10:
129231
130625
  message.transfer = $root.TW.Tron.Proto.TransferContract.decode(reader, reader.uint32());
129232
130626
  break;
@@ -129306,6 +130700,9 @@
129306
130700
  if (message.feeLimit != null && message.hasOwnProperty("feeLimit"))
129307
130701
  if (!$util.isInteger(message.feeLimit) && !(message.feeLimit && $util.isInteger(message.feeLimit.low) && $util.isInteger(message.feeLimit.high)))
129308
130702
  return "feeLimit: integer|Long expected";
130703
+ if (message.memo != null && message.hasOwnProperty("memo"))
130704
+ if (!$util.isString(message.memo))
130705
+ return "memo: string expected";
129309
130706
  if (message.transfer != null && message.hasOwnProperty("transfer")) {
129310
130707
  properties.contractOneof = 1;
129311
130708
  {
@@ -129501,6 +130898,8 @@
129501
130898
  message.feeLimit = object.feeLimit;
129502
130899
  else if (typeof object.feeLimit === "object")
129503
130900
  message.feeLimit = new $util.LongBits(object.feeLimit.low >>> 0, object.feeLimit.high >>> 0).toNumber();
130901
+ if (object.memo != null)
130902
+ message.memo = String(object.memo);
129504
130903
  if (object.transfer != null) {
129505
130904
  if (typeof object.transfer !== "object")
129506
130905
  throw TypeError(".TW.Tron.Proto.Transaction.transfer: object expected");
@@ -129609,6 +131008,7 @@
129609
131008
  object.feeLimit = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
129610
131009
  } else
129611
131010
  object.feeLimit = options.longs === String ? "0" : 0;
131011
+ object.memo = "";
129612
131012
  }
129613
131013
  if (message.timestamp != null && message.hasOwnProperty("timestamp"))
129614
131014
  if (typeof message.timestamp === "number")
@@ -129627,6 +131027,8 @@
129627
131027
  object.feeLimit = options.longs === String ? String(message.feeLimit) : message.feeLimit;
129628
131028
  else
129629
131029
  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;
131030
+ if (message.memo != null && message.hasOwnProperty("memo"))
131031
+ object.memo = message.memo;
129630
131032
  if (message.transfer != null && message.hasOwnProperty("transfer")) {
129631
131033
  object.transfer = $root.TW.Tron.Proto.TransferContract.toObject(message.transfer, options);
129632
131034
  if (options.oneofs)