@dashevo/dapi-grpc 2.1.0-dev.8 → 2.1.0-pr.2716.1

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.
@@ -562,6 +562,3427 @@ $root.org = (function() {
562
562
  */
563
563
  var v0 = {};
564
564
 
565
+ v0.PlatformEventsCommand = (function() {
566
+
567
+ /**
568
+ * Properties of a PlatformEventsCommand.
569
+ * @memberof org.dash.platform.dapi.v0
570
+ * @interface IPlatformEventsCommand
571
+ * @property {org.dash.platform.dapi.v0.PlatformEventsCommand.IPlatformEventsCommandV0|null} [v0] PlatformEventsCommand v0
572
+ */
573
+
574
+ /**
575
+ * Constructs a new PlatformEventsCommand.
576
+ * @memberof org.dash.platform.dapi.v0
577
+ * @classdesc Represents a PlatformEventsCommand.
578
+ * @implements IPlatformEventsCommand
579
+ * @constructor
580
+ * @param {org.dash.platform.dapi.v0.IPlatformEventsCommand=} [properties] Properties to set
581
+ */
582
+ function PlatformEventsCommand(properties) {
583
+ if (properties)
584
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
585
+ if (properties[keys[i]] != null)
586
+ this[keys[i]] = properties[keys[i]];
587
+ }
588
+
589
+ /**
590
+ * PlatformEventsCommand v0.
591
+ * @member {org.dash.platform.dapi.v0.PlatformEventsCommand.IPlatformEventsCommandV0|null|undefined} v0
592
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsCommand
593
+ * @instance
594
+ */
595
+ PlatformEventsCommand.prototype.v0 = null;
596
+
597
+ // OneOf field names bound to virtual getters and setters
598
+ var $oneOfFields;
599
+
600
+ /**
601
+ * PlatformEventsCommand version.
602
+ * @member {"v0"|undefined} version
603
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsCommand
604
+ * @instance
605
+ */
606
+ Object.defineProperty(PlatformEventsCommand.prototype, "version", {
607
+ get: $util.oneOfGetter($oneOfFields = ["v0"]),
608
+ set: $util.oneOfSetter($oneOfFields)
609
+ });
610
+
611
+ /**
612
+ * Creates a new PlatformEventsCommand instance using the specified properties.
613
+ * @function create
614
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsCommand
615
+ * @static
616
+ * @param {org.dash.platform.dapi.v0.IPlatformEventsCommand=} [properties] Properties to set
617
+ * @returns {org.dash.platform.dapi.v0.PlatformEventsCommand} PlatformEventsCommand instance
618
+ */
619
+ PlatformEventsCommand.create = function create(properties) {
620
+ return new PlatformEventsCommand(properties);
621
+ };
622
+
623
+ /**
624
+ * Encodes the specified PlatformEventsCommand message. Does not implicitly {@link org.dash.platform.dapi.v0.PlatformEventsCommand.verify|verify} messages.
625
+ * @function encode
626
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsCommand
627
+ * @static
628
+ * @param {org.dash.platform.dapi.v0.IPlatformEventsCommand} message PlatformEventsCommand message or plain object to encode
629
+ * @param {$protobuf.Writer} [writer] Writer to encode to
630
+ * @returns {$protobuf.Writer} Writer
631
+ */
632
+ PlatformEventsCommand.encode = function encode(message, writer) {
633
+ if (!writer)
634
+ writer = $Writer.create();
635
+ if (message.v0 != null && Object.hasOwnProperty.call(message, "v0"))
636
+ $root.org.dash.platform.dapi.v0.PlatformEventsCommand.PlatformEventsCommandV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
637
+ return writer;
638
+ };
639
+
640
+ /**
641
+ * Encodes the specified PlatformEventsCommand message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.PlatformEventsCommand.verify|verify} messages.
642
+ * @function encodeDelimited
643
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsCommand
644
+ * @static
645
+ * @param {org.dash.platform.dapi.v0.IPlatformEventsCommand} message PlatformEventsCommand message or plain object to encode
646
+ * @param {$protobuf.Writer} [writer] Writer to encode to
647
+ * @returns {$protobuf.Writer} Writer
648
+ */
649
+ PlatformEventsCommand.encodeDelimited = function encodeDelimited(message, writer) {
650
+ return this.encode(message, writer).ldelim();
651
+ };
652
+
653
+ /**
654
+ * Decodes a PlatformEventsCommand message from the specified reader or buffer.
655
+ * @function decode
656
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsCommand
657
+ * @static
658
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
659
+ * @param {number} [length] Message length if known beforehand
660
+ * @returns {org.dash.platform.dapi.v0.PlatformEventsCommand} PlatformEventsCommand
661
+ * @throws {Error} If the payload is not a reader or valid buffer
662
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
663
+ */
664
+ PlatformEventsCommand.decode = function decode(reader, length) {
665
+ if (!(reader instanceof $Reader))
666
+ reader = $Reader.create(reader);
667
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.PlatformEventsCommand();
668
+ while (reader.pos < end) {
669
+ var tag = reader.uint32();
670
+ switch (tag >>> 3) {
671
+ case 1:
672
+ message.v0 = $root.org.dash.platform.dapi.v0.PlatformEventsCommand.PlatformEventsCommandV0.decode(reader, reader.uint32());
673
+ break;
674
+ default:
675
+ reader.skipType(tag & 7);
676
+ break;
677
+ }
678
+ }
679
+ return message;
680
+ };
681
+
682
+ /**
683
+ * Decodes a PlatformEventsCommand message from the specified reader or buffer, length delimited.
684
+ * @function decodeDelimited
685
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsCommand
686
+ * @static
687
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
688
+ * @returns {org.dash.platform.dapi.v0.PlatformEventsCommand} PlatformEventsCommand
689
+ * @throws {Error} If the payload is not a reader or valid buffer
690
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
691
+ */
692
+ PlatformEventsCommand.decodeDelimited = function decodeDelimited(reader) {
693
+ if (!(reader instanceof $Reader))
694
+ reader = new $Reader(reader);
695
+ return this.decode(reader, reader.uint32());
696
+ };
697
+
698
+ /**
699
+ * Verifies a PlatformEventsCommand message.
700
+ * @function verify
701
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsCommand
702
+ * @static
703
+ * @param {Object.<string,*>} message Plain object to verify
704
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
705
+ */
706
+ PlatformEventsCommand.verify = function verify(message) {
707
+ if (typeof message !== "object" || message === null)
708
+ return "object expected";
709
+ var properties = {};
710
+ if (message.v0 != null && message.hasOwnProperty("v0")) {
711
+ properties.version = 1;
712
+ {
713
+ var error = $root.org.dash.platform.dapi.v0.PlatformEventsCommand.PlatformEventsCommandV0.verify(message.v0);
714
+ if (error)
715
+ return "v0." + error;
716
+ }
717
+ }
718
+ return null;
719
+ };
720
+
721
+ /**
722
+ * Creates a PlatformEventsCommand message from a plain object. Also converts values to their respective internal types.
723
+ * @function fromObject
724
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsCommand
725
+ * @static
726
+ * @param {Object.<string,*>} object Plain object
727
+ * @returns {org.dash.platform.dapi.v0.PlatformEventsCommand} PlatformEventsCommand
728
+ */
729
+ PlatformEventsCommand.fromObject = function fromObject(object) {
730
+ if (object instanceof $root.org.dash.platform.dapi.v0.PlatformEventsCommand)
731
+ return object;
732
+ var message = new $root.org.dash.platform.dapi.v0.PlatformEventsCommand();
733
+ if (object.v0 != null) {
734
+ if (typeof object.v0 !== "object")
735
+ throw TypeError(".org.dash.platform.dapi.v0.PlatformEventsCommand.v0: object expected");
736
+ message.v0 = $root.org.dash.platform.dapi.v0.PlatformEventsCommand.PlatformEventsCommandV0.fromObject(object.v0);
737
+ }
738
+ return message;
739
+ };
740
+
741
+ /**
742
+ * Creates a plain object from a PlatformEventsCommand message. Also converts values to other types if specified.
743
+ * @function toObject
744
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsCommand
745
+ * @static
746
+ * @param {org.dash.platform.dapi.v0.PlatformEventsCommand} message PlatformEventsCommand
747
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
748
+ * @returns {Object.<string,*>} Plain object
749
+ */
750
+ PlatformEventsCommand.toObject = function toObject(message, options) {
751
+ if (!options)
752
+ options = {};
753
+ var object = {};
754
+ if (message.v0 != null && message.hasOwnProperty("v0")) {
755
+ object.v0 = $root.org.dash.platform.dapi.v0.PlatformEventsCommand.PlatformEventsCommandV0.toObject(message.v0, options);
756
+ if (options.oneofs)
757
+ object.version = "v0";
758
+ }
759
+ return object;
760
+ };
761
+
762
+ /**
763
+ * Converts this PlatformEventsCommand to JSON.
764
+ * @function toJSON
765
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsCommand
766
+ * @instance
767
+ * @returns {Object.<string,*>} JSON object
768
+ */
769
+ PlatformEventsCommand.prototype.toJSON = function toJSON() {
770
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
771
+ };
772
+
773
+ PlatformEventsCommand.PlatformEventsCommandV0 = (function() {
774
+
775
+ /**
776
+ * Properties of a PlatformEventsCommandV0.
777
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsCommand
778
+ * @interface IPlatformEventsCommandV0
779
+ * @property {org.dash.platform.dapi.v0.IAddSubscriptionV0|null} [add] PlatformEventsCommandV0 add
780
+ * @property {org.dash.platform.dapi.v0.IRemoveSubscriptionV0|null} [remove] PlatformEventsCommandV0 remove
781
+ */
782
+
783
+ /**
784
+ * Constructs a new PlatformEventsCommandV0.
785
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsCommand
786
+ * @classdesc Represents a PlatformEventsCommandV0.
787
+ * @implements IPlatformEventsCommandV0
788
+ * @constructor
789
+ * @param {org.dash.platform.dapi.v0.PlatformEventsCommand.IPlatformEventsCommandV0=} [properties] Properties to set
790
+ */
791
+ function PlatformEventsCommandV0(properties) {
792
+ if (properties)
793
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
794
+ if (properties[keys[i]] != null)
795
+ this[keys[i]] = properties[keys[i]];
796
+ }
797
+
798
+ /**
799
+ * PlatformEventsCommandV0 add.
800
+ * @member {org.dash.platform.dapi.v0.IAddSubscriptionV0|null|undefined} add
801
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsCommand.PlatformEventsCommandV0
802
+ * @instance
803
+ */
804
+ PlatformEventsCommandV0.prototype.add = null;
805
+
806
+ /**
807
+ * PlatformEventsCommandV0 remove.
808
+ * @member {org.dash.platform.dapi.v0.IRemoveSubscriptionV0|null|undefined} remove
809
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsCommand.PlatformEventsCommandV0
810
+ * @instance
811
+ */
812
+ PlatformEventsCommandV0.prototype.remove = null;
813
+
814
+ // OneOf field names bound to virtual getters and setters
815
+ var $oneOfFields;
816
+
817
+ /**
818
+ * PlatformEventsCommandV0 command.
819
+ * @member {"add"|"remove"|undefined} command
820
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsCommand.PlatformEventsCommandV0
821
+ * @instance
822
+ */
823
+ Object.defineProperty(PlatformEventsCommandV0.prototype, "command", {
824
+ get: $util.oneOfGetter($oneOfFields = ["add", "remove"]),
825
+ set: $util.oneOfSetter($oneOfFields)
826
+ });
827
+
828
+ /**
829
+ * Creates a new PlatformEventsCommandV0 instance using the specified properties.
830
+ * @function create
831
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsCommand.PlatformEventsCommandV0
832
+ * @static
833
+ * @param {org.dash.platform.dapi.v0.PlatformEventsCommand.IPlatformEventsCommandV0=} [properties] Properties to set
834
+ * @returns {org.dash.platform.dapi.v0.PlatformEventsCommand.PlatformEventsCommandV0} PlatformEventsCommandV0 instance
835
+ */
836
+ PlatformEventsCommandV0.create = function create(properties) {
837
+ return new PlatformEventsCommandV0(properties);
838
+ };
839
+
840
+ /**
841
+ * Encodes the specified PlatformEventsCommandV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.PlatformEventsCommand.PlatformEventsCommandV0.verify|verify} messages.
842
+ * @function encode
843
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsCommand.PlatformEventsCommandV0
844
+ * @static
845
+ * @param {org.dash.platform.dapi.v0.PlatformEventsCommand.IPlatformEventsCommandV0} message PlatformEventsCommandV0 message or plain object to encode
846
+ * @param {$protobuf.Writer} [writer] Writer to encode to
847
+ * @returns {$protobuf.Writer} Writer
848
+ */
849
+ PlatformEventsCommandV0.encode = function encode(message, writer) {
850
+ if (!writer)
851
+ writer = $Writer.create();
852
+ if (message.add != null && Object.hasOwnProperty.call(message, "add"))
853
+ $root.org.dash.platform.dapi.v0.AddSubscriptionV0.encode(message.add, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
854
+ if (message.remove != null && Object.hasOwnProperty.call(message, "remove"))
855
+ $root.org.dash.platform.dapi.v0.RemoveSubscriptionV0.encode(message.remove, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
856
+ return writer;
857
+ };
858
+
859
+ /**
860
+ * Encodes the specified PlatformEventsCommandV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.PlatformEventsCommand.PlatformEventsCommandV0.verify|verify} messages.
861
+ * @function encodeDelimited
862
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsCommand.PlatformEventsCommandV0
863
+ * @static
864
+ * @param {org.dash.platform.dapi.v0.PlatformEventsCommand.IPlatformEventsCommandV0} message PlatformEventsCommandV0 message or plain object to encode
865
+ * @param {$protobuf.Writer} [writer] Writer to encode to
866
+ * @returns {$protobuf.Writer} Writer
867
+ */
868
+ PlatformEventsCommandV0.encodeDelimited = function encodeDelimited(message, writer) {
869
+ return this.encode(message, writer).ldelim();
870
+ };
871
+
872
+ /**
873
+ * Decodes a PlatformEventsCommandV0 message from the specified reader or buffer.
874
+ * @function decode
875
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsCommand.PlatformEventsCommandV0
876
+ * @static
877
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
878
+ * @param {number} [length] Message length if known beforehand
879
+ * @returns {org.dash.platform.dapi.v0.PlatformEventsCommand.PlatformEventsCommandV0} PlatformEventsCommandV0
880
+ * @throws {Error} If the payload is not a reader or valid buffer
881
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
882
+ */
883
+ PlatformEventsCommandV0.decode = function decode(reader, length) {
884
+ if (!(reader instanceof $Reader))
885
+ reader = $Reader.create(reader);
886
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.PlatformEventsCommand.PlatformEventsCommandV0();
887
+ while (reader.pos < end) {
888
+ var tag = reader.uint32();
889
+ switch (tag >>> 3) {
890
+ case 1:
891
+ message.add = $root.org.dash.platform.dapi.v0.AddSubscriptionV0.decode(reader, reader.uint32());
892
+ break;
893
+ case 2:
894
+ message.remove = $root.org.dash.platform.dapi.v0.RemoveSubscriptionV0.decode(reader, reader.uint32());
895
+ break;
896
+ default:
897
+ reader.skipType(tag & 7);
898
+ break;
899
+ }
900
+ }
901
+ return message;
902
+ };
903
+
904
+ /**
905
+ * Decodes a PlatformEventsCommandV0 message from the specified reader or buffer, length delimited.
906
+ * @function decodeDelimited
907
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsCommand.PlatformEventsCommandV0
908
+ * @static
909
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
910
+ * @returns {org.dash.platform.dapi.v0.PlatformEventsCommand.PlatformEventsCommandV0} PlatformEventsCommandV0
911
+ * @throws {Error} If the payload is not a reader or valid buffer
912
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
913
+ */
914
+ PlatformEventsCommandV0.decodeDelimited = function decodeDelimited(reader) {
915
+ if (!(reader instanceof $Reader))
916
+ reader = new $Reader(reader);
917
+ return this.decode(reader, reader.uint32());
918
+ };
919
+
920
+ /**
921
+ * Verifies a PlatformEventsCommandV0 message.
922
+ * @function verify
923
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsCommand.PlatformEventsCommandV0
924
+ * @static
925
+ * @param {Object.<string,*>} message Plain object to verify
926
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
927
+ */
928
+ PlatformEventsCommandV0.verify = function verify(message) {
929
+ if (typeof message !== "object" || message === null)
930
+ return "object expected";
931
+ var properties = {};
932
+ if (message.add != null && message.hasOwnProperty("add")) {
933
+ properties.command = 1;
934
+ {
935
+ var error = $root.org.dash.platform.dapi.v0.AddSubscriptionV0.verify(message.add);
936
+ if (error)
937
+ return "add." + error;
938
+ }
939
+ }
940
+ if (message.remove != null && message.hasOwnProperty("remove")) {
941
+ if (properties.command === 1)
942
+ return "command: multiple values";
943
+ properties.command = 1;
944
+ {
945
+ var error = $root.org.dash.platform.dapi.v0.RemoveSubscriptionV0.verify(message.remove);
946
+ if (error)
947
+ return "remove." + error;
948
+ }
949
+ }
950
+ return null;
951
+ };
952
+
953
+ /**
954
+ * Creates a PlatformEventsCommandV0 message from a plain object. Also converts values to their respective internal types.
955
+ * @function fromObject
956
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsCommand.PlatformEventsCommandV0
957
+ * @static
958
+ * @param {Object.<string,*>} object Plain object
959
+ * @returns {org.dash.platform.dapi.v0.PlatformEventsCommand.PlatformEventsCommandV0} PlatformEventsCommandV0
960
+ */
961
+ PlatformEventsCommandV0.fromObject = function fromObject(object) {
962
+ if (object instanceof $root.org.dash.platform.dapi.v0.PlatformEventsCommand.PlatformEventsCommandV0)
963
+ return object;
964
+ var message = new $root.org.dash.platform.dapi.v0.PlatformEventsCommand.PlatformEventsCommandV0();
965
+ if (object.add != null) {
966
+ if (typeof object.add !== "object")
967
+ throw TypeError(".org.dash.platform.dapi.v0.PlatformEventsCommand.PlatformEventsCommandV0.add: object expected");
968
+ message.add = $root.org.dash.platform.dapi.v0.AddSubscriptionV0.fromObject(object.add);
969
+ }
970
+ if (object.remove != null) {
971
+ if (typeof object.remove !== "object")
972
+ throw TypeError(".org.dash.platform.dapi.v0.PlatformEventsCommand.PlatformEventsCommandV0.remove: object expected");
973
+ message.remove = $root.org.dash.platform.dapi.v0.RemoveSubscriptionV0.fromObject(object.remove);
974
+ }
975
+ return message;
976
+ };
977
+
978
+ /**
979
+ * Creates a plain object from a PlatformEventsCommandV0 message. Also converts values to other types if specified.
980
+ * @function toObject
981
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsCommand.PlatformEventsCommandV0
982
+ * @static
983
+ * @param {org.dash.platform.dapi.v0.PlatformEventsCommand.PlatformEventsCommandV0} message PlatformEventsCommandV0
984
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
985
+ * @returns {Object.<string,*>} Plain object
986
+ */
987
+ PlatformEventsCommandV0.toObject = function toObject(message, options) {
988
+ if (!options)
989
+ options = {};
990
+ var object = {};
991
+ if (message.add != null && message.hasOwnProperty("add")) {
992
+ object.add = $root.org.dash.platform.dapi.v0.AddSubscriptionV0.toObject(message.add, options);
993
+ if (options.oneofs)
994
+ object.command = "add";
995
+ }
996
+ if (message.remove != null && message.hasOwnProperty("remove")) {
997
+ object.remove = $root.org.dash.platform.dapi.v0.RemoveSubscriptionV0.toObject(message.remove, options);
998
+ if (options.oneofs)
999
+ object.command = "remove";
1000
+ }
1001
+ return object;
1002
+ };
1003
+
1004
+ /**
1005
+ * Converts this PlatformEventsCommandV0 to JSON.
1006
+ * @function toJSON
1007
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsCommand.PlatformEventsCommandV0
1008
+ * @instance
1009
+ * @returns {Object.<string,*>} JSON object
1010
+ */
1011
+ PlatformEventsCommandV0.prototype.toJSON = function toJSON() {
1012
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1013
+ };
1014
+
1015
+ return PlatformEventsCommandV0;
1016
+ })();
1017
+
1018
+ return PlatformEventsCommand;
1019
+ })();
1020
+
1021
+ v0.PlatformEventsResponse = (function() {
1022
+
1023
+ /**
1024
+ * Properties of a PlatformEventsResponse.
1025
+ * @memberof org.dash.platform.dapi.v0
1026
+ * @interface IPlatformEventsResponse
1027
+ * @property {org.dash.platform.dapi.v0.PlatformEventsResponse.IPlatformEventsResponseV0|null} [v0] PlatformEventsResponse v0
1028
+ */
1029
+
1030
+ /**
1031
+ * Constructs a new PlatformEventsResponse.
1032
+ * @memberof org.dash.platform.dapi.v0
1033
+ * @classdesc Represents a PlatformEventsResponse.
1034
+ * @implements IPlatformEventsResponse
1035
+ * @constructor
1036
+ * @param {org.dash.platform.dapi.v0.IPlatformEventsResponse=} [properties] Properties to set
1037
+ */
1038
+ function PlatformEventsResponse(properties) {
1039
+ if (properties)
1040
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1041
+ if (properties[keys[i]] != null)
1042
+ this[keys[i]] = properties[keys[i]];
1043
+ }
1044
+
1045
+ /**
1046
+ * PlatformEventsResponse v0.
1047
+ * @member {org.dash.platform.dapi.v0.PlatformEventsResponse.IPlatformEventsResponseV0|null|undefined} v0
1048
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsResponse
1049
+ * @instance
1050
+ */
1051
+ PlatformEventsResponse.prototype.v0 = null;
1052
+
1053
+ // OneOf field names bound to virtual getters and setters
1054
+ var $oneOfFields;
1055
+
1056
+ /**
1057
+ * PlatformEventsResponse version.
1058
+ * @member {"v0"|undefined} version
1059
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsResponse
1060
+ * @instance
1061
+ */
1062
+ Object.defineProperty(PlatformEventsResponse.prototype, "version", {
1063
+ get: $util.oneOfGetter($oneOfFields = ["v0"]),
1064
+ set: $util.oneOfSetter($oneOfFields)
1065
+ });
1066
+
1067
+ /**
1068
+ * Creates a new PlatformEventsResponse instance using the specified properties.
1069
+ * @function create
1070
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsResponse
1071
+ * @static
1072
+ * @param {org.dash.platform.dapi.v0.IPlatformEventsResponse=} [properties] Properties to set
1073
+ * @returns {org.dash.platform.dapi.v0.PlatformEventsResponse} PlatformEventsResponse instance
1074
+ */
1075
+ PlatformEventsResponse.create = function create(properties) {
1076
+ return new PlatformEventsResponse(properties);
1077
+ };
1078
+
1079
+ /**
1080
+ * Encodes the specified PlatformEventsResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.PlatformEventsResponse.verify|verify} messages.
1081
+ * @function encode
1082
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsResponse
1083
+ * @static
1084
+ * @param {org.dash.platform.dapi.v0.IPlatformEventsResponse} message PlatformEventsResponse message or plain object to encode
1085
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1086
+ * @returns {$protobuf.Writer} Writer
1087
+ */
1088
+ PlatformEventsResponse.encode = function encode(message, writer) {
1089
+ if (!writer)
1090
+ writer = $Writer.create();
1091
+ if (message.v0 != null && Object.hasOwnProperty.call(message, "v0"))
1092
+ $root.org.dash.platform.dapi.v0.PlatformEventsResponse.PlatformEventsResponseV0.encode(message.v0, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
1093
+ return writer;
1094
+ };
1095
+
1096
+ /**
1097
+ * Encodes the specified PlatformEventsResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.PlatformEventsResponse.verify|verify} messages.
1098
+ * @function encodeDelimited
1099
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsResponse
1100
+ * @static
1101
+ * @param {org.dash.platform.dapi.v0.IPlatformEventsResponse} message PlatformEventsResponse message or plain object to encode
1102
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1103
+ * @returns {$protobuf.Writer} Writer
1104
+ */
1105
+ PlatformEventsResponse.encodeDelimited = function encodeDelimited(message, writer) {
1106
+ return this.encode(message, writer).ldelim();
1107
+ };
1108
+
1109
+ /**
1110
+ * Decodes a PlatformEventsResponse message from the specified reader or buffer.
1111
+ * @function decode
1112
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsResponse
1113
+ * @static
1114
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1115
+ * @param {number} [length] Message length if known beforehand
1116
+ * @returns {org.dash.platform.dapi.v0.PlatformEventsResponse} PlatformEventsResponse
1117
+ * @throws {Error} If the payload is not a reader or valid buffer
1118
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1119
+ */
1120
+ PlatformEventsResponse.decode = function decode(reader, length) {
1121
+ if (!(reader instanceof $Reader))
1122
+ reader = $Reader.create(reader);
1123
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.PlatformEventsResponse();
1124
+ while (reader.pos < end) {
1125
+ var tag = reader.uint32();
1126
+ switch (tag >>> 3) {
1127
+ case 1:
1128
+ message.v0 = $root.org.dash.platform.dapi.v0.PlatformEventsResponse.PlatformEventsResponseV0.decode(reader, reader.uint32());
1129
+ break;
1130
+ default:
1131
+ reader.skipType(tag & 7);
1132
+ break;
1133
+ }
1134
+ }
1135
+ return message;
1136
+ };
1137
+
1138
+ /**
1139
+ * Decodes a PlatformEventsResponse message from the specified reader or buffer, length delimited.
1140
+ * @function decodeDelimited
1141
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsResponse
1142
+ * @static
1143
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1144
+ * @returns {org.dash.platform.dapi.v0.PlatformEventsResponse} PlatformEventsResponse
1145
+ * @throws {Error} If the payload is not a reader or valid buffer
1146
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1147
+ */
1148
+ PlatformEventsResponse.decodeDelimited = function decodeDelimited(reader) {
1149
+ if (!(reader instanceof $Reader))
1150
+ reader = new $Reader(reader);
1151
+ return this.decode(reader, reader.uint32());
1152
+ };
1153
+
1154
+ /**
1155
+ * Verifies a PlatformEventsResponse message.
1156
+ * @function verify
1157
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsResponse
1158
+ * @static
1159
+ * @param {Object.<string,*>} message Plain object to verify
1160
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
1161
+ */
1162
+ PlatformEventsResponse.verify = function verify(message) {
1163
+ if (typeof message !== "object" || message === null)
1164
+ return "object expected";
1165
+ var properties = {};
1166
+ if (message.v0 != null && message.hasOwnProperty("v0")) {
1167
+ properties.version = 1;
1168
+ {
1169
+ var error = $root.org.dash.platform.dapi.v0.PlatformEventsResponse.PlatformEventsResponseV0.verify(message.v0);
1170
+ if (error)
1171
+ return "v0." + error;
1172
+ }
1173
+ }
1174
+ return null;
1175
+ };
1176
+
1177
+ /**
1178
+ * Creates a PlatformEventsResponse message from a plain object. Also converts values to their respective internal types.
1179
+ * @function fromObject
1180
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsResponse
1181
+ * @static
1182
+ * @param {Object.<string,*>} object Plain object
1183
+ * @returns {org.dash.platform.dapi.v0.PlatformEventsResponse} PlatformEventsResponse
1184
+ */
1185
+ PlatformEventsResponse.fromObject = function fromObject(object) {
1186
+ if (object instanceof $root.org.dash.platform.dapi.v0.PlatformEventsResponse)
1187
+ return object;
1188
+ var message = new $root.org.dash.platform.dapi.v0.PlatformEventsResponse();
1189
+ if (object.v0 != null) {
1190
+ if (typeof object.v0 !== "object")
1191
+ throw TypeError(".org.dash.platform.dapi.v0.PlatformEventsResponse.v0: object expected");
1192
+ message.v0 = $root.org.dash.platform.dapi.v0.PlatformEventsResponse.PlatformEventsResponseV0.fromObject(object.v0);
1193
+ }
1194
+ return message;
1195
+ };
1196
+
1197
+ /**
1198
+ * Creates a plain object from a PlatformEventsResponse message. Also converts values to other types if specified.
1199
+ * @function toObject
1200
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsResponse
1201
+ * @static
1202
+ * @param {org.dash.platform.dapi.v0.PlatformEventsResponse} message PlatformEventsResponse
1203
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
1204
+ * @returns {Object.<string,*>} Plain object
1205
+ */
1206
+ PlatformEventsResponse.toObject = function toObject(message, options) {
1207
+ if (!options)
1208
+ options = {};
1209
+ var object = {};
1210
+ if (message.v0 != null && message.hasOwnProperty("v0")) {
1211
+ object.v0 = $root.org.dash.platform.dapi.v0.PlatformEventsResponse.PlatformEventsResponseV0.toObject(message.v0, options);
1212
+ if (options.oneofs)
1213
+ object.version = "v0";
1214
+ }
1215
+ return object;
1216
+ };
1217
+
1218
+ /**
1219
+ * Converts this PlatformEventsResponse to JSON.
1220
+ * @function toJSON
1221
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsResponse
1222
+ * @instance
1223
+ * @returns {Object.<string,*>} JSON object
1224
+ */
1225
+ PlatformEventsResponse.prototype.toJSON = function toJSON() {
1226
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1227
+ };
1228
+
1229
+ PlatformEventsResponse.PlatformEventsResponseV0 = (function() {
1230
+
1231
+ /**
1232
+ * Properties of a PlatformEventsResponseV0.
1233
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsResponse
1234
+ * @interface IPlatformEventsResponseV0
1235
+ * @property {org.dash.platform.dapi.v0.IPlatformEventMessageV0|null} [event] PlatformEventsResponseV0 event
1236
+ * @property {org.dash.platform.dapi.v0.IAckV0|null} [ack] PlatformEventsResponseV0 ack
1237
+ * @property {org.dash.platform.dapi.v0.IPlatformErrorV0|null} [error] PlatformEventsResponseV0 error
1238
+ */
1239
+
1240
+ /**
1241
+ * Constructs a new PlatformEventsResponseV0.
1242
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsResponse
1243
+ * @classdesc Represents a PlatformEventsResponseV0.
1244
+ * @implements IPlatformEventsResponseV0
1245
+ * @constructor
1246
+ * @param {org.dash.platform.dapi.v0.PlatformEventsResponse.IPlatformEventsResponseV0=} [properties] Properties to set
1247
+ */
1248
+ function PlatformEventsResponseV0(properties) {
1249
+ if (properties)
1250
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1251
+ if (properties[keys[i]] != null)
1252
+ this[keys[i]] = properties[keys[i]];
1253
+ }
1254
+
1255
+ /**
1256
+ * PlatformEventsResponseV0 event.
1257
+ * @member {org.dash.platform.dapi.v0.IPlatformEventMessageV0|null|undefined} event
1258
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsResponse.PlatformEventsResponseV0
1259
+ * @instance
1260
+ */
1261
+ PlatformEventsResponseV0.prototype.event = null;
1262
+
1263
+ /**
1264
+ * PlatformEventsResponseV0 ack.
1265
+ * @member {org.dash.platform.dapi.v0.IAckV0|null|undefined} ack
1266
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsResponse.PlatformEventsResponseV0
1267
+ * @instance
1268
+ */
1269
+ PlatformEventsResponseV0.prototype.ack = null;
1270
+
1271
+ /**
1272
+ * PlatformEventsResponseV0 error.
1273
+ * @member {org.dash.platform.dapi.v0.IPlatformErrorV0|null|undefined} error
1274
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsResponse.PlatformEventsResponseV0
1275
+ * @instance
1276
+ */
1277
+ PlatformEventsResponseV0.prototype.error = null;
1278
+
1279
+ // OneOf field names bound to virtual getters and setters
1280
+ var $oneOfFields;
1281
+
1282
+ /**
1283
+ * PlatformEventsResponseV0 response.
1284
+ * @member {"event"|"ack"|"error"|undefined} response
1285
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsResponse.PlatformEventsResponseV0
1286
+ * @instance
1287
+ */
1288
+ Object.defineProperty(PlatformEventsResponseV0.prototype, "response", {
1289
+ get: $util.oneOfGetter($oneOfFields = ["event", "ack", "error"]),
1290
+ set: $util.oneOfSetter($oneOfFields)
1291
+ });
1292
+
1293
+ /**
1294
+ * Creates a new PlatformEventsResponseV0 instance using the specified properties.
1295
+ * @function create
1296
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsResponse.PlatformEventsResponseV0
1297
+ * @static
1298
+ * @param {org.dash.platform.dapi.v0.PlatformEventsResponse.IPlatformEventsResponseV0=} [properties] Properties to set
1299
+ * @returns {org.dash.platform.dapi.v0.PlatformEventsResponse.PlatformEventsResponseV0} PlatformEventsResponseV0 instance
1300
+ */
1301
+ PlatformEventsResponseV0.create = function create(properties) {
1302
+ return new PlatformEventsResponseV0(properties);
1303
+ };
1304
+
1305
+ /**
1306
+ * Encodes the specified PlatformEventsResponseV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.PlatformEventsResponse.PlatformEventsResponseV0.verify|verify} messages.
1307
+ * @function encode
1308
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsResponse.PlatformEventsResponseV0
1309
+ * @static
1310
+ * @param {org.dash.platform.dapi.v0.PlatformEventsResponse.IPlatformEventsResponseV0} message PlatformEventsResponseV0 message or plain object to encode
1311
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1312
+ * @returns {$protobuf.Writer} Writer
1313
+ */
1314
+ PlatformEventsResponseV0.encode = function encode(message, writer) {
1315
+ if (!writer)
1316
+ writer = $Writer.create();
1317
+ if (message.event != null && Object.hasOwnProperty.call(message, "event"))
1318
+ $root.org.dash.platform.dapi.v0.PlatformEventMessageV0.encode(message.event, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
1319
+ if (message.ack != null && Object.hasOwnProperty.call(message, "ack"))
1320
+ $root.org.dash.platform.dapi.v0.AckV0.encode(message.ack, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
1321
+ if (message.error != null && Object.hasOwnProperty.call(message, "error"))
1322
+ $root.org.dash.platform.dapi.v0.PlatformErrorV0.encode(message.error, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
1323
+ return writer;
1324
+ };
1325
+
1326
+ /**
1327
+ * Encodes the specified PlatformEventsResponseV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.PlatformEventsResponse.PlatformEventsResponseV0.verify|verify} messages.
1328
+ * @function encodeDelimited
1329
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsResponse.PlatformEventsResponseV0
1330
+ * @static
1331
+ * @param {org.dash.platform.dapi.v0.PlatformEventsResponse.IPlatformEventsResponseV0} message PlatformEventsResponseV0 message or plain object to encode
1332
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1333
+ * @returns {$protobuf.Writer} Writer
1334
+ */
1335
+ PlatformEventsResponseV0.encodeDelimited = function encodeDelimited(message, writer) {
1336
+ return this.encode(message, writer).ldelim();
1337
+ };
1338
+
1339
+ /**
1340
+ * Decodes a PlatformEventsResponseV0 message from the specified reader or buffer.
1341
+ * @function decode
1342
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsResponse.PlatformEventsResponseV0
1343
+ * @static
1344
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1345
+ * @param {number} [length] Message length if known beforehand
1346
+ * @returns {org.dash.platform.dapi.v0.PlatformEventsResponse.PlatformEventsResponseV0} PlatformEventsResponseV0
1347
+ * @throws {Error} If the payload is not a reader or valid buffer
1348
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1349
+ */
1350
+ PlatformEventsResponseV0.decode = function decode(reader, length) {
1351
+ if (!(reader instanceof $Reader))
1352
+ reader = $Reader.create(reader);
1353
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.PlatformEventsResponse.PlatformEventsResponseV0();
1354
+ while (reader.pos < end) {
1355
+ var tag = reader.uint32();
1356
+ switch (tag >>> 3) {
1357
+ case 1:
1358
+ message.event = $root.org.dash.platform.dapi.v0.PlatformEventMessageV0.decode(reader, reader.uint32());
1359
+ break;
1360
+ case 2:
1361
+ message.ack = $root.org.dash.platform.dapi.v0.AckV0.decode(reader, reader.uint32());
1362
+ break;
1363
+ case 3:
1364
+ message.error = $root.org.dash.platform.dapi.v0.PlatformErrorV0.decode(reader, reader.uint32());
1365
+ break;
1366
+ default:
1367
+ reader.skipType(tag & 7);
1368
+ break;
1369
+ }
1370
+ }
1371
+ return message;
1372
+ };
1373
+
1374
+ /**
1375
+ * Decodes a PlatformEventsResponseV0 message from the specified reader or buffer, length delimited.
1376
+ * @function decodeDelimited
1377
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsResponse.PlatformEventsResponseV0
1378
+ * @static
1379
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1380
+ * @returns {org.dash.platform.dapi.v0.PlatformEventsResponse.PlatformEventsResponseV0} PlatformEventsResponseV0
1381
+ * @throws {Error} If the payload is not a reader or valid buffer
1382
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1383
+ */
1384
+ PlatformEventsResponseV0.decodeDelimited = function decodeDelimited(reader) {
1385
+ if (!(reader instanceof $Reader))
1386
+ reader = new $Reader(reader);
1387
+ return this.decode(reader, reader.uint32());
1388
+ };
1389
+
1390
+ /**
1391
+ * Verifies a PlatformEventsResponseV0 message.
1392
+ * @function verify
1393
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsResponse.PlatformEventsResponseV0
1394
+ * @static
1395
+ * @param {Object.<string,*>} message Plain object to verify
1396
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
1397
+ */
1398
+ PlatformEventsResponseV0.verify = function verify(message) {
1399
+ if (typeof message !== "object" || message === null)
1400
+ return "object expected";
1401
+ var properties = {};
1402
+ if (message.event != null && message.hasOwnProperty("event")) {
1403
+ properties.response = 1;
1404
+ {
1405
+ var error = $root.org.dash.platform.dapi.v0.PlatformEventMessageV0.verify(message.event);
1406
+ if (error)
1407
+ return "event." + error;
1408
+ }
1409
+ }
1410
+ if (message.ack != null && message.hasOwnProperty("ack")) {
1411
+ if (properties.response === 1)
1412
+ return "response: multiple values";
1413
+ properties.response = 1;
1414
+ {
1415
+ var error = $root.org.dash.platform.dapi.v0.AckV0.verify(message.ack);
1416
+ if (error)
1417
+ return "ack." + error;
1418
+ }
1419
+ }
1420
+ if (message.error != null && message.hasOwnProperty("error")) {
1421
+ if (properties.response === 1)
1422
+ return "response: multiple values";
1423
+ properties.response = 1;
1424
+ {
1425
+ var error = $root.org.dash.platform.dapi.v0.PlatformErrorV0.verify(message.error);
1426
+ if (error)
1427
+ return "error." + error;
1428
+ }
1429
+ }
1430
+ return null;
1431
+ };
1432
+
1433
+ /**
1434
+ * Creates a PlatformEventsResponseV0 message from a plain object. Also converts values to their respective internal types.
1435
+ * @function fromObject
1436
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsResponse.PlatformEventsResponseV0
1437
+ * @static
1438
+ * @param {Object.<string,*>} object Plain object
1439
+ * @returns {org.dash.platform.dapi.v0.PlatformEventsResponse.PlatformEventsResponseV0} PlatformEventsResponseV0
1440
+ */
1441
+ PlatformEventsResponseV0.fromObject = function fromObject(object) {
1442
+ if (object instanceof $root.org.dash.platform.dapi.v0.PlatformEventsResponse.PlatformEventsResponseV0)
1443
+ return object;
1444
+ var message = new $root.org.dash.platform.dapi.v0.PlatformEventsResponse.PlatformEventsResponseV0();
1445
+ if (object.event != null) {
1446
+ if (typeof object.event !== "object")
1447
+ throw TypeError(".org.dash.platform.dapi.v0.PlatformEventsResponse.PlatformEventsResponseV0.event: object expected");
1448
+ message.event = $root.org.dash.platform.dapi.v0.PlatformEventMessageV0.fromObject(object.event);
1449
+ }
1450
+ if (object.ack != null) {
1451
+ if (typeof object.ack !== "object")
1452
+ throw TypeError(".org.dash.platform.dapi.v0.PlatformEventsResponse.PlatformEventsResponseV0.ack: object expected");
1453
+ message.ack = $root.org.dash.platform.dapi.v0.AckV0.fromObject(object.ack);
1454
+ }
1455
+ if (object.error != null) {
1456
+ if (typeof object.error !== "object")
1457
+ throw TypeError(".org.dash.platform.dapi.v0.PlatformEventsResponse.PlatformEventsResponseV0.error: object expected");
1458
+ message.error = $root.org.dash.platform.dapi.v0.PlatformErrorV0.fromObject(object.error);
1459
+ }
1460
+ return message;
1461
+ };
1462
+
1463
+ /**
1464
+ * Creates a plain object from a PlatformEventsResponseV0 message. Also converts values to other types if specified.
1465
+ * @function toObject
1466
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsResponse.PlatformEventsResponseV0
1467
+ * @static
1468
+ * @param {org.dash.platform.dapi.v0.PlatformEventsResponse.PlatformEventsResponseV0} message PlatformEventsResponseV0
1469
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
1470
+ * @returns {Object.<string,*>} Plain object
1471
+ */
1472
+ PlatformEventsResponseV0.toObject = function toObject(message, options) {
1473
+ if (!options)
1474
+ options = {};
1475
+ var object = {};
1476
+ if (message.event != null && message.hasOwnProperty("event")) {
1477
+ object.event = $root.org.dash.platform.dapi.v0.PlatformEventMessageV0.toObject(message.event, options);
1478
+ if (options.oneofs)
1479
+ object.response = "event";
1480
+ }
1481
+ if (message.ack != null && message.hasOwnProperty("ack")) {
1482
+ object.ack = $root.org.dash.platform.dapi.v0.AckV0.toObject(message.ack, options);
1483
+ if (options.oneofs)
1484
+ object.response = "ack";
1485
+ }
1486
+ if (message.error != null && message.hasOwnProperty("error")) {
1487
+ object.error = $root.org.dash.platform.dapi.v0.PlatformErrorV0.toObject(message.error, options);
1488
+ if (options.oneofs)
1489
+ object.response = "error";
1490
+ }
1491
+ return object;
1492
+ };
1493
+
1494
+ /**
1495
+ * Converts this PlatformEventsResponseV0 to JSON.
1496
+ * @function toJSON
1497
+ * @memberof org.dash.platform.dapi.v0.PlatformEventsResponse.PlatformEventsResponseV0
1498
+ * @instance
1499
+ * @returns {Object.<string,*>} JSON object
1500
+ */
1501
+ PlatformEventsResponseV0.prototype.toJSON = function toJSON() {
1502
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1503
+ };
1504
+
1505
+ return PlatformEventsResponseV0;
1506
+ })();
1507
+
1508
+ return PlatformEventsResponse;
1509
+ })();
1510
+
1511
+ v0.AddSubscriptionV0 = (function() {
1512
+
1513
+ /**
1514
+ * Properties of an AddSubscriptionV0.
1515
+ * @memberof org.dash.platform.dapi.v0
1516
+ * @interface IAddSubscriptionV0
1517
+ * @property {string|null} [clientSubscriptionId] AddSubscriptionV0 clientSubscriptionId
1518
+ * @property {org.dash.platform.dapi.v0.IPlatformFilterV0|null} [filter] AddSubscriptionV0 filter
1519
+ */
1520
+
1521
+ /**
1522
+ * Constructs a new AddSubscriptionV0.
1523
+ * @memberof org.dash.platform.dapi.v0
1524
+ * @classdesc Represents an AddSubscriptionV0.
1525
+ * @implements IAddSubscriptionV0
1526
+ * @constructor
1527
+ * @param {org.dash.platform.dapi.v0.IAddSubscriptionV0=} [properties] Properties to set
1528
+ */
1529
+ function AddSubscriptionV0(properties) {
1530
+ if (properties)
1531
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1532
+ if (properties[keys[i]] != null)
1533
+ this[keys[i]] = properties[keys[i]];
1534
+ }
1535
+
1536
+ /**
1537
+ * AddSubscriptionV0 clientSubscriptionId.
1538
+ * @member {string} clientSubscriptionId
1539
+ * @memberof org.dash.platform.dapi.v0.AddSubscriptionV0
1540
+ * @instance
1541
+ */
1542
+ AddSubscriptionV0.prototype.clientSubscriptionId = "";
1543
+
1544
+ /**
1545
+ * AddSubscriptionV0 filter.
1546
+ * @member {org.dash.platform.dapi.v0.IPlatformFilterV0|null|undefined} filter
1547
+ * @memberof org.dash.platform.dapi.v0.AddSubscriptionV0
1548
+ * @instance
1549
+ */
1550
+ AddSubscriptionV0.prototype.filter = null;
1551
+
1552
+ /**
1553
+ * Creates a new AddSubscriptionV0 instance using the specified properties.
1554
+ * @function create
1555
+ * @memberof org.dash.platform.dapi.v0.AddSubscriptionV0
1556
+ * @static
1557
+ * @param {org.dash.platform.dapi.v0.IAddSubscriptionV0=} [properties] Properties to set
1558
+ * @returns {org.dash.platform.dapi.v0.AddSubscriptionV0} AddSubscriptionV0 instance
1559
+ */
1560
+ AddSubscriptionV0.create = function create(properties) {
1561
+ return new AddSubscriptionV0(properties);
1562
+ };
1563
+
1564
+ /**
1565
+ * Encodes the specified AddSubscriptionV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.AddSubscriptionV0.verify|verify} messages.
1566
+ * @function encode
1567
+ * @memberof org.dash.platform.dapi.v0.AddSubscriptionV0
1568
+ * @static
1569
+ * @param {org.dash.platform.dapi.v0.IAddSubscriptionV0} message AddSubscriptionV0 message or plain object to encode
1570
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1571
+ * @returns {$protobuf.Writer} Writer
1572
+ */
1573
+ AddSubscriptionV0.encode = function encode(message, writer) {
1574
+ if (!writer)
1575
+ writer = $Writer.create();
1576
+ if (message.clientSubscriptionId != null && Object.hasOwnProperty.call(message, "clientSubscriptionId"))
1577
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientSubscriptionId);
1578
+ if (message.filter != null && Object.hasOwnProperty.call(message, "filter"))
1579
+ $root.org.dash.platform.dapi.v0.PlatformFilterV0.encode(message.filter, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
1580
+ return writer;
1581
+ };
1582
+
1583
+ /**
1584
+ * Encodes the specified AddSubscriptionV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.AddSubscriptionV0.verify|verify} messages.
1585
+ * @function encodeDelimited
1586
+ * @memberof org.dash.platform.dapi.v0.AddSubscriptionV0
1587
+ * @static
1588
+ * @param {org.dash.platform.dapi.v0.IAddSubscriptionV0} message AddSubscriptionV0 message or plain object to encode
1589
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1590
+ * @returns {$protobuf.Writer} Writer
1591
+ */
1592
+ AddSubscriptionV0.encodeDelimited = function encodeDelimited(message, writer) {
1593
+ return this.encode(message, writer).ldelim();
1594
+ };
1595
+
1596
+ /**
1597
+ * Decodes an AddSubscriptionV0 message from the specified reader or buffer.
1598
+ * @function decode
1599
+ * @memberof org.dash.platform.dapi.v0.AddSubscriptionV0
1600
+ * @static
1601
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1602
+ * @param {number} [length] Message length if known beforehand
1603
+ * @returns {org.dash.platform.dapi.v0.AddSubscriptionV0} AddSubscriptionV0
1604
+ * @throws {Error} If the payload is not a reader or valid buffer
1605
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1606
+ */
1607
+ AddSubscriptionV0.decode = function decode(reader, length) {
1608
+ if (!(reader instanceof $Reader))
1609
+ reader = $Reader.create(reader);
1610
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.AddSubscriptionV0();
1611
+ while (reader.pos < end) {
1612
+ var tag = reader.uint32();
1613
+ switch (tag >>> 3) {
1614
+ case 1:
1615
+ message.clientSubscriptionId = reader.string();
1616
+ break;
1617
+ case 2:
1618
+ message.filter = $root.org.dash.platform.dapi.v0.PlatformFilterV0.decode(reader, reader.uint32());
1619
+ break;
1620
+ default:
1621
+ reader.skipType(tag & 7);
1622
+ break;
1623
+ }
1624
+ }
1625
+ return message;
1626
+ };
1627
+
1628
+ /**
1629
+ * Decodes an AddSubscriptionV0 message from the specified reader or buffer, length delimited.
1630
+ * @function decodeDelimited
1631
+ * @memberof org.dash.platform.dapi.v0.AddSubscriptionV0
1632
+ * @static
1633
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1634
+ * @returns {org.dash.platform.dapi.v0.AddSubscriptionV0} AddSubscriptionV0
1635
+ * @throws {Error} If the payload is not a reader or valid buffer
1636
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1637
+ */
1638
+ AddSubscriptionV0.decodeDelimited = function decodeDelimited(reader) {
1639
+ if (!(reader instanceof $Reader))
1640
+ reader = new $Reader(reader);
1641
+ return this.decode(reader, reader.uint32());
1642
+ };
1643
+
1644
+ /**
1645
+ * Verifies an AddSubscriptionV0 message.
1646
+ * @function verify
1647
+ * @memberof org.dash.platform.dapi.v0.AddSubscriptionV0
1648
+ * @static
1649
+ * @param {Object.<string,*>} message Plain object to verify
1650
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
1651
+ */
1652
+ AddSubscriptionV0.verify = function verify(message) {
1653
+ if (typeof message !== "object" || message === null)
1654
+ return "object expected";
1655
+ if (message.clientSubscriptionId != null && message.hasOwnProperty("clientSubscriptionId"))
1656
+ if (!$util.isString(message.clientSubscriptionId))
1657
+ return "clientSubscriptionId: string expected";
1658
+ if (message.filter != null && message.hasOwnProperty("filter")) {
1659
+ var error = $root.org.dash.platform.dapi.v0.PlatformFilterV0.verify(message.filter);
1660
+ if (error)
1661
+ return "filter." + error;
1662
+ }
1663
+ return null;
1664
+ };
1665
+
1666
+ /**
1667
+ * Creates an AddSubscriptionV0 message from a plain object. Also converts values to their respective internal types.
1668
+ * @function fromObject
1669
+ * @memberof org.dash.platform.dapi.v0.AddSubscriptionV0
1670
+ * @static
1671
+ * @param {Object.<string,*>} object Plain object
1672
+ * @returns {org.dash.platform.dapi.v0.AddSubscriptionV0} AddSubscriptionV0
1673
+ */
1674
+ AddSubscriptionV0.fromObject = function fromObject(object) {
1675
+ if (object instanceof $root.org.dash.platform.dapi.v0.AddSubscriptionV0)
1676
+ return object;
1677
+ var message = new $root.org.dash.platform.dapi.v0.AddSubscriptionV0();
1678
+ if (object.clientSubscriptionId != null)
1679
+ message.clientSubscriptionId = String(object.clientSubscriptionId);
1680
+ if (object.filter != null) {
1681
+ if (typeof object.filter !== "object")
1682
+ throw TypeError(".org.dash.platform.dapi.v0.AddSubscriptionV0.filter: object expected");
1683
+ message.filter = $root.org.dash.platform.dapi.v0.PlatformFilterV0.fromObject(object.filter);
1684
+ }
1685
+ return message;
1686
+ };
1687
+
1688
+ /**
1689
+ * Creates a plain object from an AddSubscriptionV0 message. Also converts values to other types if specified.
1690
+ * @function toObject
1691
+ * @memberof org.dash.platform.dapi.v0.AddSubscriptionV0
1692
+ * @static
1693
+ * @param {org.dash.platform.dapi.v0.AddSubscriptionV0} message AddSubscriptionV0
1694
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
1695
+ * @returns {Object.<string,*>} Plain object
1696
+ */
1697
+ AddSubscriptionV0.toObject = function toObject(message, options) {
1698
+ if (!options)
1699
+ options = {};
1700
+ var object = {};
1701
+ if (options.defaults) {
1702
+ object.clientSubscriptionId = "";
1703
+ object.filter = null;
1704
+ }
1705
+ if (message.clientSubscriptionId != null && message.hasOwnProperty("clientSubscriptionId"))
1706
+ object.clientSubscriptionId = message.clientSubscriptionId;
1707
+ if (message.filter != null && message.hasOwnProperty("filter"))
1708
+ object.filter = $root.org.dash.platform.dapi.v0.PlatformFilterV0.toObject(message.filter, options);
1709
+ return object;
1710
+ };
1711
+
1712
+ /**
1713
+ * Converts this AddSubscriptionV0 to JSON.
1714
+ * @function toJSON
1715
+ * @memberof org.dash.platform.dapi.v0.AddSubscriptionV0
1716
+ * @instance
1717
+ * @returns {Object.<string,*>} JSON object
1718
+ */
1719
+ AddSubscriptionV0.prototype.toJSON = function toJSON() {
1720
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1721
+ };
1722
+
1723
+ return AddSubscriptionV0;
1724
+ })();
1725
+
1726
+ v0.RemoveSubscriptionV0 = (function() {
1727
+
1728
+ /**
1729
+ * Properties of a RemoveSubscriptionV0.
1730
+ * @memberof org.dash.platform.dapi.v0
1731
+ * @interface IRemoveSubscriptionV0
1732
+ * @property {string|null} [clientSubscriptionId] RemoveSubscriptionV0 clientSubscriptionId
1733
+ */
1734
+
1735
+ /**
1736
+ * Constructs a new RemoveSubscriptionV0.
1737
+ * @memberof org.dash.platform.dapi.v0
1738
+ * @classdesc Represents a RemoveSubscriptionV0.
1739
+ * @implements IRemoveSubscriptionV0
1740
+ * @constructor
1741
+ * @param {org.dash.platform.dapi.v0.IRemoveSubscriptionV0=} [properties] Properties to set
1742
+ */
1743
+ function RemoveSubscriptionV0(properties) {
1744
+ if (properties)
1745
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1746
+ if (properties[keys[i]] != null)
1747
+ this[keys[i]] = properties[keys[i]];
1748
+ }
1749
+
1750
+ /**
1751
+ * RemoveSubscriptionV0 clientSubscriptionId.
1752
+ * @member {string} clientSubscriptionId
1753
+ * @memberof org.dash.platform.dapi.v0.RemoveSubscriptionV0
1754
+ * @instance
1755
+ */
1756
+ RemoveSubscriptionV0.prototype.clientSubscriptionId = "";
1757
+
1758
+ /**
1759
+ * Creates a new RemoveSubscriptionV0 instance using the specified properties.
1760
+ * @function create
1761
+ * @memberof org.dash.platform.dapi.v0.RemoveSubscriptionV0
1762
+ * @static
1763
+ * @param {org.dash.platform.dapi.v0.IRemoveSubscriptionV0=} [properties] Properties to set
1764
+ * @returns {org.dash.platform.dapi.v0.RemoveSubscriptionV0} RemoveSubscriptionV0 instance
1765
+ */
1766
+ RemoveSubscriptionV0.create = function create(properties) {
1767
+ return new RemoveSubscriptionV0(properties);
1768
+ };
1769
+
1770
+ /**
1771
+ * Encodes the specified RemoveSubscriptionV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.RemoveSubscriptionV0.verify|verify} messages.
1772
+ * @function encode
1773
+ * @memberof org.dash.platform.dapi.v0.RemoveSubscriptionV0
1774
+ * @static
1775
+ * @param {org.dash.platform.dapi.v0.IRemoveSubscriptionV0} message RemoveSubscriptionV0 message or plain object to encode
1776
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1777
+ * @returns {$protobuf.Writer} Writer
1778
+ */
1779
+ RemoveSubscriptionV0.encode = function encode(message, writer) {
1780
+ if (!writer)
1781
+ writer = $Writer.create();
1782
+ if (message.clientSubscriptionId != null && Object.hasOwnProperty.call(message, "clientSubscriptionId"))
1783
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientSubscriptionId);
1784
+ return writer;
1785
+ };
1786
+
1787
+ /**
1788
+ * Encodes the specified RemoveSubscriptionV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.RemoveSubscriptionV0.verify|verify} messages.
1789
+ * @function encodeDelimited
1790
+ * @memberof org.dash.platform.dapi.v0.RemoveSubscriptionV0
1791
+ * @static
1792
+ * @param {org.dash.platform.dapi.v0.IRemoveSubscriptionV0} message RemoveSubscriptionV0 message or plain object to encode
1793
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1794
+ * @returns {$protobuf.Writer} Writer
1795
+ */
1796
+ RemoveSubscriptionV0.encodeDelimited = function encodeDelimited(message, writer) {
1797
+ return this.encode(message, writer).ldelim();
1798
+ };
1799
+
1800
+ /**
1801
+ * Decodes a RemoveSubscriptionV0 message from the specified reader or buffer.
1802
+ * @function decode
1803
+ * @memberof org.dash.platform.dapi.v0.RemoveSubscriptionV0
1804
+ * @static
1805
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1806
+ * @param {number} [length] Message length if known beforehand
1807
+ * @returns {org.dash.platform.dapi.v0.RemoveSubscriptionV0} RemoveSubscriptionV0
1808
+ * @throws {Error} If the payload is not a reader or valid buffer
1809
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1810
+ */
1811
+ RemoveSubscriptionV0.decode = function decode(reader, length) {
1812
+ if (!(reader instanceof $Reader))
1813
+ reader = $Reader.create(reader);
1814
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.RemoveSubscriptionV0();
1815
+ while (reader.pos < end) {
1816
+ var tag = reader.uint32();
1817
+ switch (tag >>> 3) {
1818
+ case 1:
1819
+ message.clientSubscriptionId = reader.string();
1820
+ break;
1821
+ default:
1822
+ reader.skipType(tag & 7);
1823
+ break;
1824
+ }
1825
+ }
1826
+ return message;
1827
+ };
1828
+
1829
+ /**
1830
+ * Decodes a RemoveSubscriptionV0 message from the specified reader or buffer, length delimited.
1831
+ * @function decodeDelimited
1832
+ * @memberof org.dash.platform.dapi.v0.RemoveSubscriptionV0
1833
+ * @static
1834
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1835
+ * @returns {org.dash.platform.dapi.v0.RemoveSubscriptionV0} RemoveSubscriptionV0
1836
+ * @throws {Error} If the payload is not a reader or valid buffer
1837
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1838
+ */
1839
+ RemoveSubscriptionV0.decodeDelimited = function decodeDelimited(reader) {
1840
+ if (!(reader instanceof $Reader))
1841
+ reader = new $Reader(reader);
1842
+ return this.decode(reader, reader.uint32());
1843
+ };
1844
+
1845
+ /**
1846
+ * Verifies a RemoveSubscriptionV0 message.
1847
+ * @function verify
1848
+ * @memberof org.dash.platform.dapi.v0.RemoveSubscriptionV0
1849
+ * @static
1850
+ * @param {Object.<string,*>} message Plain object to verify
1851
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
1852
+ */
1853
+ RemoveSubscriptionV0.verify = function verify(message) {
1854
+ if (typeof message !== "object" || message === null)
1855
+ return "object expected";
1856
+ if (message.clientSubscriptionId != null && message.hasOwnProperty("clientSubscriptionId"))
1857
+ if (!$util.isString(message.clientSubscriptionId))
1858
+ return "clientSubscriptionId: string expected";
1859
+ return null;
1860
+ };
1861
+
1862
+ /**
1863
+ * Creates a RemoveSubscriptionV0 message from a plain object. Also converts values to their respective internal types.
1864
+ * @function fromObject
1865
+ * @memberof org.dash.platform.dapi.v0.RemoveSubscriptionV0
1866
+ * @static
1867
+ * @param {Object.<string,*>} object Plain object
1868
+ * @returns {org.dash.platform.dapi.v0.RemoveSubscriptionV0} RemoveSubscriptionV0
1869
+ */
1870
+ RemoveSubscriptionV0.fromObject = function fromObject(object) {
1871
+ if (object instanceof $root.org.dash.platform.dapi.v0.RemoveSubscriptionV0)
1872
+ return object;
1873
+ var message = new $root.org.dash.platform.dapi.v0.RemoveSubscriptionV0();
1874
+ if (object.clientSubscriptionId != null)
1875
+ message.clientSubscriptionId = String(object.clientSubscriptionId);
1876
+ return message;
1877
+ };
1878
+
1879
+ /**
1880
+ * Creates a plain object from a RemoveSubscriptionV0 message. Also converts values to other types if specified.
1881
+ * @function toObject
1882
+ * @memberof org.dash.platform.dapi.v0.RemoveSubscriptionV0
1883
+ * @static
1884
+ * @param {org.dash.platform.dapi.v0.RemoveSubscriptionV0} message RemoveSubscriptionV0
1885
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
1886
+ * @returns {Object.<string,*>} Plain object
1887
+ */
1888
+ RemoveSubscriptionV0.toObject = function toObject(message, options) {
1889
+ if (!options)
1890
+ options = {};
1891
+ var object = {};
1892
+ if (options.defaults)
1893
+ object.clientSubscriptionId = "";
1894
+ if (message.clientSubscriptionId != null && message.hasOwnProperty("clientSubscriptionId"))
1895
+ object.clientSubscriptionId = message.clientSubscriptionId;
1896
+ return object;
1897
+ };
1898
+
1899
+ /**
1900
+ * Converts this RemoveSubscriptionV0 to JSON.
1901
+ * @function toJSON
1902
+ * @memberof org.dash.platform.dapi.v0.RemoveSubscriptionV0
1903
+ * @instance
1904
+ * @returns {Object.<string,*>} JSON object
1905
+ */
1906
+ RemoveSubscriptionV0.prototype.toJSON = function toJSON() {
1907
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1908
+ };
1909
+
1910
+ return RemoveSubscriptionV0;
1911
+ })();
1912
+
1913
+ v0.AckV0 = (function() {
1914
+
1915
+ /**
1916
+ * Properties of an AckV0.
1917
+ * @memberof org.dash.platform.dapi.v0
1918
+ * @interface IAckV0
1919
+ * @property {string|null} [clientSubscriptionId] AckV0 clientSubscriptionId
1920
+ * @property {string|null} [op] AckV0 op
1921
+ */
1922
+
1923
+ /**
1924
+ * Constructs a new AckV0.
1925
+ * @memberof org.dash.platform.dapi.v0
1926
+ * @classdesc Represents an AckV0.
1927
+ * @implements IAckV0
1928
+ * @constructor
1929
+ * @param {org.dash.platform.dapi.v0.IAckV0=} [properties] Properties to set
1930
+ */
1931
+ function AckV0(properties) {
1932
+ if (properties)
1933
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1934
+ if (properties[keys[i]] != null)
1935
+ this[keys[i]] = properties[keys[i]];
1936
+ }
1937
+
1938
+ /**
1939
+ * AckV0 clientSubscriptionId.
1940
+ * @member {string} clientSubscriptionId
1941
+ * @memberof org.dash.platform.dapi.v0.AckV0
1942
+ * @instance
1943
+ */
1944
+ AckV0.prototype.clientSubscriptionId = "";
1945
+
1946
+ /**
1947
+ * AckV0 op.
1948
+ * @member {string} op
1949
+ * @memberof org.dash.platform.dapi.v0.AckV0
1950
+ * @instance
1951
+ */
1952
+ AckV0.prototype.op = "";
1953
+
1954
+ /**
1955
+ * Creates a new AckV0 instance using the specified properties.
1956
+ * @function create
1957
+ * @memberof org.dash.platform.dapi.v0.AckV0
1958
+ * @static
1959
+ * @param {org.dash.platform.dapi.v0.IAckV0=} [properties] Properties to set
1960
+ * @returns {org.dash.platform.dapi.v0.AckV0} AckV0 instance
1961
+ */
1962
+ AckV0.create = function create(properties) {
1963
+ return new AckV0(properties);
1964
+ };
1965
+
1966
+ /**
1967
+ * Encodes the specified AckV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.AckV0.verify|verify} messages.
1968
+ * @function encode
1969
+ * @memberof org.dash.platform.dapi.v0.AckV0
1970
+ * @static
1971
+ * @param {org.dash.platform.dapi.v0.IAckV0} message AckV0 message or plain object to encode
1972
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1973
+ * @returns {$protobuf.Writer} Writer
1974
+ */
1975
+ AckV0.encode = function encode(message, writer) {
1976
+ if (!writer)
1977
+ writer = $Writer.create();
1978
+ if (message.clientSubscriptionId != null && Object.hasOwnProperty.call(message, "clientSubscriptionId"))
1979
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientSubscriptionId);
1980
+ if (message.op != null && Object.hasOwnProperty.call(message, "op"))
1981
+ writer.uint32(/* id 2, wireType 2 =*/18).string(message.op);
1982
+ return writer;
1983
+ };
1984
+
1985
+ /**
1986
+ * Encodes the specified AckV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.AckV0.verify|verify} messages.
1987
+ * @function encodeDelimited
1988
+ * @memberof org.dash.platform.dapi.v0.AckV0
1989
+ * @static
1990
+ * @param {org.dash.platform.dapi.v0.IAckV0} message AckV0 message or plain object to encode
1991
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1992
+ * @returns {$protobuf.Writer} Writer
1993
+ */
1994
+ AckV0.encodeDelimited = function encodeDelimited(message, writer) {
1995
+ return this.encode(message, writer).ldelim();
1996
+ };
1997
+
1998
+ /**
1999
+ * Decodes an AckV0 message from the specified reader or buffer.
2000
+ * @function decode
2001
+ * @memberof org.dash.platform.dapi.v0.AckV0
2002
+ * @static
2003
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2004
+ * @param {number} [length] Message length if known beforehand
2005
+ * @returns {org.dash.platform.dapi.v0.AckV0} AckV0
2006
+ * @throws {Error} If the payload is not a reader or valid buffer
2007
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
2008
+ */
2009
+ AckV0.decode = function decode(reader, length) {
2010
+ if (!(reader instanceof $Reader))
2011
+ reader = $Reader.create(reader);
2012
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.AckV0();
2013
+ while (reader.pos < end) {
2014
+ var tag = reader.uint32();
2015
+ switch (tag >>> 3) {
2016
+ case 1:
2017
+ message.clientSubscriptionId = reader.string();
2018
+ break;
2019
+ case 2:
2020
+ message.op = reader.string();
2021
+ break;
2022
+ default:
2023
+ reader.skipType(tag & 7);
2024
+ break;
2025
+ }
2026
+ }
2027
+ return message;
2028
+ };
2029
+
2030
+ /**
2031
+ * Decodes an AckV0 message from the specified reader or buffer, length delimited.
2032
+ * @function decodeDelimited
2033
+ * @memberof org.dash.platform.dapi.v0.AckV0
2034
+ * @static
2035
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2036
+ * @returns {org.dash.platform.dapi.v0.AckV0} AckV0
2037
+ * @throws {Error} If the payload is not a reader or valid buffer
2038
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
2039
+ */
2040
+ AckV0.decodeDelimited = function decodeDelimited(reader) {
2041
+ if (!(reader instanceof $Reader))
2042
+ reader = new $Reader(reader);
2043
+ return this.decode(reader, reader.uint32());
2044
+ };
2045
+
2046
+ /**
2047
+ * Verifies an AckV0 message.
2048
+ * @function verify
2049
+ * @memberof org.dash.platform.dapi.v0.AckV0
2050
+ * @static
2051
+ * @param {Object.<string,*>} message Plain object to verify
2052
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
2053
+ */
2054
+ AckV0.verify = function verify(message) {
2055
+ if (typeof message !== "object" || message === null)
2056
+ return "object expected";
2057
+ if (message.clientSubscriptionId != null && message.hasOwnProperty("clientSubscriptionId"))
2058
+ if (!$util.isString(message.clientSubscriptionId))
2059
+ return "clientSubscriptionId: string expected";
2060
+ if (message.op != null && message.hasOwnProperty("op"))
2061
+ if (!$util.isString(message.op))
2062
+ return "op: string expected";
2063
+ return null;
2064
+ };
2065
+
2066
+ /**
2067
+ * Creates an AckV0 message from a plain object. Also converts values to their respective internal types.
2068
+ * @function fromObject
2069
+ * @memberof org.dash.platform.dapi.v0.AckV0
2070
+ * @static
2071
+ * @param {Object.<string,*>} object Plain object
2072
+ * @returns {org.dash.platform.dapi.v0.AckV0} AckV0
2073
+ */
2074
+ AckV0.fromObject = function fromObject(object) {
2075
+ if (object instanceof $root.org.dash.platform.dapi.v0.AckV0)
2076
+ return object;
2077
+ var message = new $root.org.dash.platform.dapi.v0.AckV0();
2078
+ if (object.clientSubscriptionId != null)
2079
+ message.clientSubscriptionId = String(object.clientSubscriptionId);
2080
+ if (object.op != null)
2081
+ message.op = String(object.op);
2082
+ return message;
2083
+ };
2084
+
2085
+ /**
2086
+ * Creates a plain object from an AckV0 message. Also converts values to other types if specified.
2087
+ * @function toObject
2088
+ * @memberof org.dash.platform.dapi.v0.AckV0
2089
+ * @static
2090
+ * @param {org.dash.platform.dapi.v0.AckV0} message AckV0
2091
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
2092
+ * @returns {Object.<string,*>} Plain object
2093
+ */
2094
+ AckV0.toObject = function toObject(message, options) {
2095
+ if (!options)
2096
+ options = {};
2097
+ var object = {};
2098
+ if (options.defaults) {
2099
+ object.clientSubscriptionId = "";
2100
+ object.op = "";
2101
+ }
2102
+ if (message.clientSubscriptionId != null && message.hasOwnProperty("clientSubscriptionId"))
2103
+ object.clientSubscriptionId = message.clientSubscriptionId;
2104
+ if (message.op != null && message.hasOwnProperty("op"))
2105
+ object.op = message.op;
2106
+ return object;
2107
+ };
2108
+
2109
+ /**
2110
+ * Converts this AckV0 to JSON.
2111
+ * @function toJSON
2112
+ * @memberof org.dash.platform.dapi.v0.AckV0
2113
+ * @instance
2114
+ * @returns {Object.<string,*>} JSON object
2115
+ */
2116
+ AckV0.prototype.toJSON = function toJSON() {
2117
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
2118
+ };
2119
+
2120
+ return AckV0;
2121
+ })();
2122
+
2123
+ v0.PlatformErrorV0 = (function() {
2124
+
2125
+ /**
2126
+ * Properties of a PlatformErrorV0.
2127
+ * @memberof org.dash.platform.dapi.v0
2128
+ * @interface IPlatformErrorV0
2129
+ * @property {string|null} [clientSubscriptionId] PlatformErrorV0 clientSubscriptionId
2130
+ * @property {number|null} [code] PlatformErrorV0 code
2131
+ * @property {string|null} [message] PlatformErrorV0 message
2132
+ */
2133
+
2134
+ /**
2135
+ * Constructs a new PlatformErrorV0.
2136
+ * @memberof org.dash.platform.dapi.v0
2137
+ * @classdesc Represents a PlatformErrorV0.
2138
+ * @implements IPlatformErrorV0
2139
+ * @constructor
2140
+ * @param {org.dash.platform.dapi.v0.IPlatformErrorV0=} [properties] Properties to set
2141
+ */
2142
+ function PlatformErrorV0(properties) {
2143
+ if (properties)
2144
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
2145
+ if (properties[keys[i]] != null)
2146
+ this[keys[i]] = properties[keys[i]];
2147
+ }
2148
+
2149
+ /**
2150
+ * PlatformErrorV0 clientSubscriptionId.
2151
+ * @member {string} clientSubscriptionId
2152
+ * @memberof org.dash.platform.dapi.v0.PlatformErrorV0
2153
+ * @instance
2154
+ */
2155
+ PlatformErrorV0.prototype.clientSubscriptionId = "";
2156
+
2157
+ /**
2158
+ * PlatformErrorV0 code.
2159
+ * @member {number} code
2160
+ * @memberof org.dash.platform.dapi.v0.PlatformErrorV0
2161
+ * @instance
2162
+ */
2163
+ PlatformErrorV0.prototype.code = 0;
2164
+
2165
+ /**
2166
+ * PlatformErrorV0 message.
2167
+ * @member {string} message
2168
+ * @memberof org.dash.platform.dapi.v0.PlatformErrorV0
2169
+ * @instance
2170
+ */
2171
+ PlatformErrorV0.prototype.message = "";
2172
+
2173
+ /**
2174
+ * Creates a new PlatformErrorV0 instance using the specified properties.
2175
+ * @function create
2176
+ * @memberof org.dash.platform.dapi.v0.PlatformErrorV0
2177
+ * @static
2178
+ * @param {org.dash.platform.dapi.v0.IPlatformErrorV0=} [properties] Properties to set
2179
+ * @returns {org.dash.platform.dapi.v0.PlatformErrorV0} PlatformErrorV0 instance
2180
+ */
2181
+ PlatformErrorV0.create = function create(properties) {
2182
+ return new PlatformErrorV0(properties);
2183
+ };
2184
+
2185
+ /**
2186
+ * Encodes the specified PlatformErrorV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.PlatformErrorV0.verify|verify} messages.
2187
+ * @function encode
2188
+ * @memberof org.dash.platform.dapi.v0.PlatformErrorV0
2189
+ * @static
2190
+ * @param {org.dash.platform.dapi.v0.IPlatformErrorV0} message PlatformErrorV0 message or plain object to encode
2191
+ * @param {$protobuf.Writer} [writer] Writer to encode to
2192
+ * @returns {$protobuf.Writer} Writer
2193
+ */
2194
+ PlatformErrorV0.encode = function encode(message, writer) {
2195
+ if (!writer)
2196
+ writer = $Writer.create();
2197
+ if (message.clientSubscriptionId != null && Object.hasOwnProperty.call(message, "clientSubscriptionId"))
2198
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientSubscriptionId);
2199
+ if (message.code != null && Object.hasOwnProperty.call(message, "code"))
2200
+ writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.code);
2201
+ if (message.message != null && Object.hasOwnProperty.call(message, "message"))
2202
+ writer.uint32(/* id 3, wireType 2 =*/26).string(message.message);
2203
+ return writer;
2204
+ };
2205
+
2206
+ /**
2207
+ * Encodes the specified PlatformErrorV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.PlatformErrorV0.verify|verify} messages.
2208
+ * @function encodeDelimited
2209
+ * @memberof org.dash.platform.dapi.v0.PlatformErrorV0
2210
+ * @static
2211
+ * @param {org.dash.platform.dapi.v0.IPlatformErrorV0} message PlatformErrorV0 message or plain object to encode
2212
+ * @param {$protobuf.Writer} [writer] Writer to encode to
2213
+ * @returns {$protobuf.Writer} Writer
2214
+ */
2215
+ PlatformErrorV0.encodeDelimited = function encodeDelimited(message, writer) {
2216
+ return this.encode(message, writer).ldelim();
2217
+ };
2218
+
2219
+ /**
2220
+ * Decodes a PlatformErrorV0 message from the specified reader or buffer.
2221
+ * @function decode
2222
+ * @memberof org.dash.platform.dapi.v0.PlatformErrorV0
2223
+ * @static
2224
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2225
+ * @param {number} [length] Message length if known beforehand
2226
+ * @returns {org.dash.platform.dapi.v0.PlatformErrorV0} PlatformErrorV0
2227
+ * @throws {Error} If the payload is not a reader or valid buffer
2228
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
2229
+ */
2230
+ PlatformErrorV0.decode = function decode(reader, length) {
2231
+ if (!(reader instanceof $Reader))
2232
+ reader = $Reader.create(reader);
2233
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.PlatformErrorV0();
2234
+ while (reader.pos < end) {
2235
+ var tag = reader.uint32();
2236
+ switch (tag >>> 3) {
2237
+ case 1:
2238
+ message.clientSubscriptionId = reader.string();
2239
+ break;
2240
+ case 2:
2241
+ message.code = reader.uint32();
2242
+ break;
2243
+ case 3:
2244
+ message.message = reader.string();
2245
+ break;
2246
+ default:
2247
+ reader.skipType(tag & 7);
2248
+ break;
2249
+ }
2250
+ }
2251
+ return message;
2252
+ };
2253
+
2254
+ /**
2255
+ * Decodes a PlatformErrorV0 message from the specified reader or buffer, length delimited.
2256
+ * @function decodeDelimited
2257
+ * @memberof org.dash.platform.dapi.v0.PlatformErrorV0
2258
+ * @static
2259
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2260
+ * @returns {org.dash.platform.dapi.v0.PlatformErrorV0} PlatformErrorV0
2261
+ * @throws {Error} If the payload is not a reader or valid buffer
2262
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
2263
+ */
2264
+ PlatformErrorV0.decodeDelimited = function decodeDelimited(reader) {
2265
+ if (!(reader instanceof $Reader))
2266
+ reader = new $Reader(reader);
2267
+ return this.decode(reader, reader.uint32());
2268
+ };
2269
+
2270
+ /**
2271
+ * Verifies a PlatformErrorV0 message.
2272
+ * @function verify
2273
+ * @memberof org.dash.platform.dapi.v0.PlatformErrorV0
2274
+ * @static
2275
+ * @param {Object.<string,*>} message Plain object to verify
2276
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
2277
+ */
2278
+ PlatformErrorV0.verify = function verify(message) {
2279
+ if (typeof message !== "object" || message === null)
2280
+ return "object expected";
2281
+ if (message.clientSubscriptionId != null && message.hasOwnProperty("clientSubscriptionId"))
2282
+ if (!$util.isString(message.clientSubscriptionId))
2283
+ return "clientSubscriptionId: string expected";
2284
+ if (message.code != null && message.hasOwnProperty("code"))
2285
+ if (!$util.isInteger(message.code))
2286
+ return "code: integer expected";
2287
+ if (message.message != null && message.hasOwnProperty("message"))
2288
+ if (!$util.isString(message.message))
2289
+ return "message: string expected";
2290
+ return null;
2291
+ };
2292
+
2293
+ /**
2294
+ * Creates a PlatformErrorV0 message from a plain object. Also converts values to their respective internal types.
2295
+ * @function fromObject
2296
+ * @memberof org.dash.platform.dapi.v0.PlatformErrorV0
2297
+ * @static
2298
+ * @param {Object.<string,*>} object Plain object
2299
+ * @returns {org.dash.platform.dapi.v0.PlatformErrorV0} PlatformErrorV0
2300
+ */
2301
+ PlatformErrorV0.fromObject = function fromObject(object) {
2302
+ if (object instanceof $root.org.dash.platform.dapi.v0.PlatformErrorV0)
2303
+ return object;
2304
+ var message = new $root.org.dash.platform.dapi.v0.PlatformErrorV0();
2305
+ if (object.clientSubscriptionId != null)
2306
+ message.clientSubscriptionId = String(object.clientSubscriptionId);
2307
+ if (object.code != null)
2308
+ message.code = object.code >>> 0;
2309
+ if (object.message != null)
2310
+ message.message = String(object.message);
2311
+ return message;
2312
+ };
2313
+
2314
+ /**
2315
+ * Creates a plain object from a PlatformErrorV0 message. Also converts values to other types if specified.
2316
+ * @function toObject
2317
+ * @memberof org.dash.platform.dapi.v0.PlatformErrorV0
2318
+ * @static
2319
+ * @param {org.dash.platform.dapi.v0.PlatformErrorV0} message PlatformErrorV0
2320
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
2321
+ * @returns {Object.<string,*>} Plain object
2322
+ */
2323
+ PlatformErrorV0.toObject = function toObject(message, options) {
2324
+ if (!options)
2325
+ options = {};
2326
+ var object = {};
2327
+ if (options.defaults) {
2328
+ object.clientSubscriptionId = "";
2329
+ object.code = 0;
2330
+ object.message = "";
2331
+ }
2332
+ if (message.clientSubscriptionId != null && message.hasOwnProperty("clientSubscriptionId"))
2333
+ object.clientSubscriptionId = message.clientSubscriptionId;
2334
+ if (message.code != null && message.hasOwnProperty("code"))
2335
+ object.code = message.code;
2336
+ if (message.message != null && message.hasOwnProperty("message"))
2337
+ object.message = message.message;
2338
+ return object;
2339
+ };
2340
+
2341
+ /**
2342
+ * Converts this PlatformErrorV0 to JSON.
2343
+ * @function toJSON
2344
+ * @memberof org.dash.platform.dapi.v0.PlatformErrorV0
2345
+ * @instance
2346
+ * @returns {Object.<string,*>} JSON object
2347
+ */
2348
+ PlatformErrorV0.prototype.toJSON = function toJSON() {
2349
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
2350
+ };
2351
+
2352
+ return PlatformErrorV0;
2353
+ })();
2354
+
2355
+ v0.PlatformEventMessageV0 = (function() {
2356
+
2357
+ /**
2358
+ * Properties of a PlatformEventMessageV0.
2359
+ * @memberof org.dash.platform.dapi.v0
2360
+ * @interface IPlatformEventMessageV0
2361
+ * @property {string|null} [clientSubscriptionId] PlatformEventMessageV0 clientSubscriptionId
2362
+ * @property {org.dash.platform.dapi.v0.IPlatformEventV0|null} [event] PlatformEventMessageV0 event
2363
+ */
2364
+
2365
+ /**
2366
+ * Constructs a new PlatformEventMessageV0.
2367
+ * @memberof org.dash.platform.dapi.v0
2368
+ * @classdesc Represents a PlatformEventMessageV0.
2369
+ * @implements IPlatformEventMessageV0
2370
+ * @constructor
2371
+ * @param {org.dash.platform.dapi.v0.IPlatformEventMessageV0=} [properties] Properties to set
2372
+ */
2373
+ function PlatformEventMessageV0(properties) {
2374
+ if (properties)
2375
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
2376
+ if (properties[keys[i]] != null)
2377
+ this[keys[i]] = properties[keys[i]];
2378
+ }
2379
+
2380
+ /**
2381
+ * PlatformEventMessageV0 clientSubscriptionId.
2382
+ * @member {string} clientSubscriptionId
2383
+ * @memberof org.dash.platform.dapi.v0.PlatformEventMessageV0
2384
+ * @instance
2385
+ */
2386
+ PlatformEventMessageV0.prototype.clientSubscriptionId = "";
2387
+
2388
+ /**
2389
+ * PlatformEventMessageV0 event.
2390
+ * @member {org.dash.platform.dapi.v0.IPlatformEventV0|null|undefined} event
2391
+ * @memberof org.dash.platform.dapi.v0.PlatformEventMessageV0
2392
+ * @instance
2393
+ */
2394
+ PlatformEventMessageV0.prototype.event = null;
2395
+
2396
+ /**
2397
+ * Creates a new PlatformEventMessageV0 instance using the specified properties.
2398
+ * @function create
2399
+ * @memberof org.dash.platform.dapi.v0.PlatformEventMessageV0
2400
+ * @static
2401
+ * @param {org.dash.platform.dapi.v0.IPlatformEventMessageV0=} [properties] Properties to set
2402
+ * @returns {org.dash.platform.dapi.v0.PlatformEventMessageV0} PlatformEventMessageV0 instance
2403
+ */
2404
+ PlatformEventMessageV0.create = function create(properties) {
2405
+ return new PlatformEventMessageV0(properties);
2406
+ };
2407
+
2408
+ /**
2409
+ * Encodes the specified PlatformEventMessageV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.PlatformEventMessageV0.verify|verify} messages.
2410
+ * @function encode
2411
+ * @memberof org.dash.platform.dapi.v0.PlatformEventMessageV0
2412
+ * @static
2413
+ * @param {org.dash.platform.dapi.v0.IPlatformEventMessageV0} message PlatformEventMessageV0 message or plain object to encode
2414
+ * @param {$protobuf.Writer} [writer] Writer to encode to
2415
+ * @returns {$protobuf.Writer} Writer
2416
+ */
2417
+ PlatformEventMessageV0.encode = function encode(message, writer) {
2418
+ if (!writer)
2419
+ writer = $Writer.create();
2420
+ if (message.clientSubscriptionId != null && Object.hasOwnProperty.call(message, "clientSubscriptionId"))
2421
+ writer.uint32(/* id 1, wireType 2 =*/10).string(message.clientSubscriptionId);
2422
+ if (message.event != null && Object.hasOwnProperty.call(message, "event"))
2423
+ $root.org.dash.platform.dapi.v0.PlatformEventV0.encode(message.event, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
2424
+ return writer;
2425
+ };
2426
+
2427
+ /**
2428
+ * Encodes the specified PlatformEventMessageV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.PlatformEventMessageV0.verify|verify} messages.
2429
+ * @function encodeDelimited
2430
+ * @memberof org.dash.platform.dapi.v0.PlatformEventMessageV0
2431
+ * @static
2432
+ * @param {org.dash.platform.dapi.v0.IPlatformEventMessageV0} message PlatformEventMessageV0 message or plain object to encode
2433
+ * @param {$protobuf.Writer} [writer] Writer to encode to
2434
+ * @returns {$protobuf.Writer} Writer
2435
+ */
2436
+ PlatformEventMessageV0.encodeDelimited = function encodeDelimited(message, writer) {
2437
+ return this.encode(message, writer).ldelim();
2438
+ };
2439
+
2440
+ /**
2441
+ * Decodes a PlatformEventMessageV0 message from the specified reader or buffer.
2442
+ * @function decode
2443
+ * @memberof org.dash.platform.dapi.v0.PlatformEventMessageV0
2444
+ * @static
2445
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2446
+ * @param {number} [length] Message length if known beforehand
2447
+ * @returns {org.dash.platform.dapi.v0.PlatformEventMessageV0} PlatformEventMessageV0
2448
+ * @throws {Error} If the payload is not a reader or valid buffer
2449
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
2450
+ */
2451
+ PlatformEventMessageV0.decode = function decode(reader, length) {
2452
+ if (!(reader instanceof $Reader))
2453
+ reader = $Reader.create(reader);
2454
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.PlatformEventMessageV0();
2455
+ while (reader.pos < end) {
2456
+ var tag = reader.uint32();
2457
+ switch (tag >>> 3) {
2458
+ case 1:
2459
+ message.clientSubscriptionId = reader.string();
2460
+ break;
2461
+ case 2:
2462
+ message.event = $root.org.dash.platform.dapi.v0.PlatformEventV0.decode(reader, reader.uint32());
2463
+ break;
2464
+ default:
2465
+ reader.skipType(tag & 7);
2466
+ break;
2467
+ }
2468
+ }
2469
+ return message;
2470
+ };
2471
+
2472
+ /**
2473
+ * Decodes a PlatformEventMessageV0 message from the specified reader or buffer, length delimited.
2474
+ * @function decodeDelimited
2475
+ * @memberof org.dash.platform.dapi.v0.PlatformEventMessageV0
2476
+ * @static
2477
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2478
+ * @returns {org.dash.platform.dapi.v0.PlatformEventMessageV0} PlatformEventMessageV0
2479
+ * @throws {Error} If the payload is not a reader or valid buffer
2480
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
2481
+ */
2482
+ PlatformEventMessageV0.decodeDelimited = function decodeDelimited(reader) {
2483
+ if (!(reader instanceof $Reader))
2484
+ reader = new $Reader(reader);
2485
+ return this.decode(reader, reader.uint32());
2486
+ };
2487
+
2488
+ /**
2489
+ * Verifies a PlatformEventMessageV0 message.
2490
+ * @function verify
2491
+ * @memberof org.dash.platform.dapi.v0.PlatformEventMessageV0
2492
+ * @static
2493
+ * @param {Object.<string,*>} message Plain object to verify
2494
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
2495
+ */
2496
+ PlatformEventMessageV0.verify = function verify(message) {
2497
+ if (typeof message !== "object" || message === null)
2498
+ return "object expected";
2499
+ if (message.clientSubscriptionId != null && message.hasOwnProperty("clientSubscriptionId"))
2500
+ if (!$util.isString(message.clientSubscriptionId))
2501
+ return "clientSubscriptionId: string expected";
2502
+ if (message.event != null && message.hasOwnProperty("event")) {
2503
+ var error = $root.org.dash.platform.dapi.v0.PlatformEventV0.verify(message.event);
2504
+ if (error)
2505
+ return "event." + error;
2506
+ }
2507
+ return null;
2508
+ };
2509
+
2510
+ /**
2511
+ * Creates a PlatformEventMessageV0 message from a plain object. Also converts values to their respective internal types.
2512
+ * @function fromObject
2513
+ * @memberof org.dash.platform.dapi.v0.PlatformEventMessageV0
2514
+ * @static
2515
+ * @param {Object.<string,*>} object Plain object
2516
+ * @returns {org.dash.platform.dapi.v0.PlatformEventMessageV0} PlatformEventMessageV0
2517
+ */
2518
+ PlatformEventMessageV0.fromObject = function fromObject(object) {
2519
+ if (object instanceof $root.org.dash.platform.dapi.v0.PlatformEventMessageV0)
2520
+ return object;
2521
+ var message = new $root.org.dash.platform.dapi.v0.PlatformEventMessageV0();
2522
+ if (object.clientSubscriptionId != null)
2523
+ message.clientSubscriptionId = String(object.clientSubscriptionId);
2524
+ if (object.event != null) {
2525
+ if (typeof object.event !== "object")
2526
+ throw TypeError(".org.dash.platform.dapi.v0.PlatformEventMessageV0.event: object expected");
2527
+ message.event = $root.org.dash.platform.dapi.v0.PlatformEventV0.fromObject(object.event);
2528
+ }
2529
+ return message;
2530
+ };
2531
+
2532
+ /**
2533
+ * Creates a plain object from a PlatformEventMessageV0 message. Also converts values to other types if specified.
2534
+ * @function toObject
2535
+ * @memberof org.dash.platform.dapi.v0.PlatformEventMessageV0
2536
+ * @static
2537
+ * @param {org.dash.platform.dapi.v0.PlatformEventMessageV0} message PlatformEventMessageV0
2538
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
2539
+ * @returns {Object.<string,*>} Plain object
2540
+ */
2541
+ PlatformEventMessageV0.toObject = function toObject(message, options) {
2542
+ if (!options)
2543
+ options = {};
2544
+ var object = {};
2545
+ if (options.defaults) {
2546
+ object.clientSubscriptionId = "";
2547
+ object.event = null;
2548
+ }
2549
+ if (message.clientSubscriptionId != null && message.hasOwnProperty("clientSubscriptionId"))
2550
+ object.clientSubscriptionId = message.clientSubscriptionId;
2551
+ if (message.event != null && message.hasOwnProperty("event"))
2552
+ object.event = $root.org.dash.platform.dapi.v0.PlatformEventV0.toObject(message.event, options);
2553
+ return object;
2554
+ };
2555
+
2556
+ /**
2557
+ * Converts this PlatformEventMessageV0 to JSON.
2558
+ * @function toJSON
2559
+ * @memberof org.dash.platform.dapi.v0.PlatformEventMessageV0
2560
+ * @instance
2561
+ * @returns {Object.<string,*>} JSON object
2562
+ */
2563
+ PlatformEventMessageV0.prototype.toJSON = function toJSON() {
2564
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
2565
+ };
2566
+
2567
+ return PlatformEventMessageV0;
2568
+ })();
2569
+
2570
+ v0.StateTransitionResultFilter = (function() {
2571
+
2572
+ /**
2573
+ * Properties of a StateTransitionResultFilter.
2574
+ * @memberof org.dash.platform.dapi.v0
2575
+ * @interface IStateTransitionResultFilter
2576
+ * @property {Uint8Array|null} [txHash] StateTransitionResultFilter txHash
2577
+ */
2578
+
2579
+ /**
2580
+ * Constructs a new StateTransitionResultFilter.
2581
+ * @memberof org.dash.platform.dapi.v0
2582
+ * @classdesc Represents a StateTransitionResultFilter.
2583
+ * @implements IStateTransitionResultFilter
2584
+ * @constructor
2585
+ * @param {org.dash.platform.dapi.v0.IStateTransitionResultFilter=} [properties] Properties to set
2586
+ */
2587
+ function StateTransitionResultFilter(properties) {
2588
+ if (properties)
2589
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
2590
+ if (properties[keys[i]] != null)
2591
+ this[keys[i]] = properties[keys[i]];
2592
+ }
2593
+
2594
+ /**
2595
+ * StateTransitionResultFilter txHash.
2596
+ * @member {Uint8Array} txHash
2597
+ * @memberof org.dash.platform.dapi.v0.StateTransitionResultFilter
2598
+ * @instance
2599
+ */
2600
+ StateTransitionResultFilter.prototype.txHash = $util.newBuffer([]);
2601
+
2602
+ /**
2603
+ * Creates a new StateTransitionResultFilter instance using the specified properties.
2604
+ * @function create
2605
+ * @memberof org.dash.platform.dapi.v0.StateTransitionResultFilter
2606
+ * @static
2607
+ * @param {org.dash.platform.dapi.v0.IStateTransitionResultFilter=} [properties] Properties to set
2608
+ * @returns {org.dash.platform.dapi.v0.StateTransitionResultFilter} StateTransitionResultFilter instance
2609
+ */
2610
+ StateTransitionResultFilter.create = function create(properties) {
2611
+ return new StateTransitionResultFilter(properties);
2612
+ };
2613
+
2614
+ /**
2615
+ * Encodes the specified StateTransitionResultFilter message. Does not implicitly {@link org.dash.platform.dapi.v0.StateTransitionResultFilter.verify|verify} messages.
2616
+ * @function encode
2617
+ * @memberof org.dash.platform.dapi.v0.StateTransitionResultFilter
2618
+ * @static
2619
+ * @param {org.dash.platform.dapi.v0.IStateTransitionResultFilter} message StateTransitionResultFilter message or plain object to encode
2620
+ * @param {$protobuf.Writer} [writer] Writer to encode to
2621
+ * @returns {$protobuf.Writer} Writer
2622
+ */
2623
+ StateTransitionResultFilter.encode = function encode(message, writer) {
2624
+ if (!writer)
2625
+ writer = $Writer.create();
2626
+ if (message.txHash != null && Object.hasOwnProperty.call(message, "txHash"))
2627
+ writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.txHash);
2628
+ return writer;
2629
+ };
2630
+
2631
+ /**
2632
+ * Encodes the specified StateTransitionResultFilter message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.StateTransitionResultFilter.verify|verify} messages.
2633
+ * @function encodeDelimited
2634
+ * @memberof org.dash.platform.dapi.v0.StateTransitionResultFilter
2635
+ * @static
2636
+ * @param {org.dash.platform.dapi.v0.IStateTransitionResultFilter} message StateTransitionResultFilter message or plain object to encode
2637
+ * @param {$protobuf.Writer} [writer] Writer to encode to
2638
+ * @returns {$protobuf.Writer} Writer
2639
+ */
2640
+ StateTransitionResultFilter.encodeDelimited = function encodeDelimited(message, writer) {
2641
+ return this.encode(message, writer).ldelim();
2642
+ };
2643
+
2644
+ /**
2645
+ * Decodes a StateTransitionResultFilter message from the specified reader or buffer.
2646
+ * @function decode
2647
+ * @memberof org.dash.platform.dapi.v0.StateTransitionResultFilter
2648
+ * @static
2649
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2650
+ * @param {number} [length] Message length if known beforehand
2651
+ * @returns {org.dash.platform.dapi.v0.StateTransitionResultFilter} StateTransitionResultFilter
2652
+ * @throws {Error} If the payload is not a reader or valid buffer
2653
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
2654
+ */
2655
+ StateTransitionResultFilter.decode = function decode(reader, length) {
2656
+ if (!(reader instanceof $Reader))
2657
+ reader = $Reader.create(reader);
2658
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.StateTransitionResultFilter();
2659
+ while (reader.pos < end) {
2660
+ var tag = reader.uint32();
2661
+ switch (tag >>> 3) {
2662
+ case 1:
2663
+ message.txHash = reader.bytes();
2664
+ break;
2665
+ default:
2666
+ reader.skipType(tag & 7);
2667
+ break;
2668
+ }
2669
+ }
2670
+ return message;
2671
+ };
2672
+
2673
+ /**
2674
+ * Decodes a StateTransitionResultFilter message from the specified reader or buffer, length delimited.
2675
+ * @function decodeDelimited
2676
+ * @memberof org.dash.platform.dapi.v0.StateTransitionResultFilter
2677
+ * @static
2678
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2679
+ * @returns {org.dash.platform.dapi.v0.StateTransitionResultFilter} StateTransitionResultFilter
2680
+ * @throws {Error} If the payload is not a reader or valid buffer
2681
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
2682
+ */
2683
+ StateTransitionResultFilter.decodeDelimited = function decodeDelimited(reader) {
2684
+ if (!(reader instanceof $Reader))
2685
+ reader = new $Reader(reader);
2686
+ return this.decode(reader, reader.uint32());
2687
+ };
2688
+
2689
+ /**
2690
+ * Verifies a StateTransitionResultFilter message.
2691
+ * @function verify
2692
+ * @memberof org.dash.platform.dapi.v0.StateTransitionResultFilter
2693
+ * @static
2694
+ * @param {Object.<string,*>} message Plain object to verify
2695
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
2696
+ */
2697
+ StateTransitionResultFilter.verify = function verify(message) {
2698
+ if (typeof message !== "object" || message === null)
2699
+ return "object expected";
2700
+ if (message.txHash != null && message.hasOwnProperty("txHash"))
2701
+ if (!(message.txHash && typeof message.txHash.length === "number" || $util.isString(message.txHash)))
2702
+ return "txHash: buffer expected";
2703
+ return null;
2704
+ };
2705
+
2706
+ /**
2707
+ * Creates a StateTransitionResultFilter message from a plain object. Also converts values to their respective internal types.
2708
+ * @function fromObject
2709
+ * @memberof org.dash.platform.dapi.v0.StateTransitionResultFilter
2710
+ * @static
2711
+ * @param {Object.<string,*>} object Plain object
2712
+ * @returns {org.dash.platform.dapi.v0.StateTransitionResultFilter} StateTransitionResultFilter
2713
+ */
2714
+ StateTransitionResultFilter.fromObject = function fromObject(object) {
2715
+ if (object instanceof $root.org.dash.platform.dapi.v0.StateTransitionResultFilter)
2716
+ return object;
2717
+ var message = new $root.org.dash.platform.dapi.v0.StateTransitionResultFilter();
2718
+ if (object.txHash != null)
2719
+ if (typeof object.txHash === "string")
2720
+ $util.base64.decode(object.txHash, message.txHash = $util.newBuffer($util.base64.length(object.txHash)), 0);
2721
+ else if (object.txHash.length >= 0)
2722
+ message.txHash = object.txHash;
2723
+ return message;
2724
+ };
2725
+
2726
+ /**
2727
+ * Creates a plain object from a StateTransitionResultFilter message. Also converts values to other types if specified.
2728
+ * @function toObject
2729
+ * @memberof org.dash.platform.dapi.v0.StateTransitionResultFilter
2730
+ * @static
2731
+ * @param {org.dash.platform.dapi.v0.StateTransitionResultFilter} message StateTransitionResultFilter
2732
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
2733
+ * @returns {Object.<string,*>} Plain object
2734
+ */
2735
+ StateTransitionResultFilter.toObject = function toObject(message, options) {
2736
+ if (!options)
2737
+ options = {};
2738
+ var object = {};
2739
+ if (options.defaults)
2740
+ if (options.bytes === String)
2741
+ object.txHash = "";
2742
+ else {
2743
+ object.txHash = [];
2744
+ if (options.bytes !== Array)
2745
+ object.txHash = $util.newBuffer(object.txHash);
2746
+ }
2747
+ if (message.txHash != null && message.hasOwnProperty("txHash"))
2748
+ object.txHash = options.bytes === String ? $util.base64.encode(message.txHash, 0, message.txHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.txHash) : message.txHash;
2749
+ return object;
2750
+ };
2751
+
2752
+ /**
2753
+ * Converts this StateTransitionResultFilter to JSON.
2754
+ * @function toJSON
2755
+ * @memberof org.dash.platform.dapi.v0.StateTransitionResultFilter
2756
+ * @instance
2757
+ * @returns {Object.<string,*>} JSON object
2758
+ */
2759
+ StateTransitionResultFilter.prototype.toJSON = function toJSON() {
2760
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
2761
+ };
2762
+
2763
+ return StateTransitionResultFilter;
2764
+ })();
2765
+
2766
+ v0.PlatformFilterV0 = (function() {
2767
+
2768
+ /**
2769
+ * Properties of a PlatformFilterV0.
2770
+ * @memberof org.dash.platform.dapi.v0
2771
+ * @interface IPlatformFilterV0
2772
+ * @property {boolean|null} [all] PlatformFilterV0 all
2773
+ * @property {boolean|null} [blockCommitted] PlatformFilterV0 blockCommitted
2774
+ * @property {org.dash.platform.dapi.v0.IStateTransitionResultFilter|null} [stateTransitionResult] PlatformFilterV0 stateTransitionResult
2775
+ */
2776
+
2777
+ /**
2778
+ * Constructs a new PlatformFilterV0.
2779
+ * @memberof org.dash.platform.dapi.v0
2780
+ * @classdesc Represents a PlatformFilterV0.
2781
+ * @implements IPlatformFilterV0
2782
+ * @constructor
2783
+ * @param {org.dash.platform.dapi.v0.IPlatformFilterV0=} [properties] Properties to set
2784
+ */
2785
+ function PlatformFilterV0(properties) {
2786
+ if (properties)
2787
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
2788
+ if (properties[keys[i]] != null)
2789
+ this[keys[i]] = properties[keys[i]];
2790
+ }
2791
+
2792
+ /**
2793
+ * PlatformFilterV0 all.
2794
+ * @member {boolean} all
2795
+ * @memberof org.dash.platform.dapi.v0.PlatformFilterV0
2796
+ * @instance
2797
+ */
2798
+ PlatformFilterV0.prototype.all = false;
2799
+
2800
+ /**
2801
+ * PlatformFilterV0 blockCommitted.
2802
+ * @member {boolean} blockCommitted
2803
+ * @memberof org.dash.platform.dapi.v0.PlatformFilterV0
2804
+ * @instance
2805
+ */
2806
+ PlatformFilterV0.prototype.blockCommitted = false;
2807
+
2808
+ /**
2809
+ * PlatformFilterV0 stateTransitionResult.
2810
+ * @member {org.dash.platform.dapi.v0.IStateTransitionResultFilter|null|undefined} stateTransitionResult
2811
+ * @memberof org.dash.platform.dapi.v0.PlatformFilterV0
2812
+ * @instance
2813
+ */
2814
+ PlatformFilterV0.prototype.stateTransitionResult = null;
2815
+
2816
+ // OneOf field names bound to virtual getters and setters
2817
+ var $oneOfFields;
2818
+
2819
+ /**
2820
+ * PlatformFilterV0 kind.
2821
+ * @member {"all"|"blockCommitted"|"stateTransitionResult"|undefined} kind
2822
+ * @memberof org.dash.platform.dapi.v0.PlatformFilterV0
2823
+ * @instance
2824
+ */
2825
+ Object.defineProperty(PlatformFilterV0.prototype, "kind", {
2826
+ get: $util.oneOfGetter($oneOfFields = ["all", "blockCommitted", "stateTransitionResult"]),
2827
+ set: $util.oneOfSetter($oneOfFields)
2828
+ });
2829
+
2830
+ /**
2831
+ * Creates a new PlatformFilterV0 instance using the specified properties.
2832
+ * @function create
2833
+ * @memberof org.dash.platform.dapi.v0.PlatformFilterV0
2834
+ * @static
2835
+ * @param {org.dash.platform.dapi.v0.IPlatformFilterV0=} [properties] Properties to set
2836
+ * @returns {org.dash.platform.dapi.v0.PlatformFilterV0} PlatformFilterV0 instance
2837
+ */
2838
+ PlatformFilterV0.create = function create(properties) {
2839
+ return new PlatformFilterV0(properties);
2840
+ };
2841
+
2842
+ /**
2843
+ * Encodes the specified PlatformFilterV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.PlatformFilterV0.verify|verify} messages.
2844
+ * @function encode
2845
+ * @memberof org.dash.platform.dapi.v0.PlatformFilterV0
2846
+ * @static
2847
+ * @param {org.dash.platform.dapi.v0.IPlatformFilterV0} message PlatformFilterV0 message or plain object to encode
2848
+ * @param {$protobuf.Writer} [writer] Writer to encode to
2849
+ * @returns {$protobuf.Writer} Writer
2850
+ */
2851
+ PlatformFilterV0.encode = function encode(message, writer) {
2852
+ if (!writer)
2853
+ writer = $Writer.create();
2854
+ if (message.all != null && Object.hasOwnProperty.call(message, "all"))
2855
+ writer.uint32(/* id 1, wireType 0 =*/8).bool(message.all);
2856
+ if (message.blockCommitted != null && Object.hasOwnProperty.call(message, "blockCommitted"))
2857
+ writer.uint32(/* id 2, wireType 0 =*/16).bool(message.blockCommitted);
2858
+ if (message.stateTransitionResult != null && Object.hasOwnProperty.call(message, "stateTransitionResult"))
2859
+ $root.org.dash.platform.dapi.v0.StateTransitionResultFilter.encode(message.stateTransitionResult, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
2860
+ return writer;
2861
+ };
2862
+
2863
+ /**
2864
+ * Encodes the specified PlatformFilterV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.PlatformFilterV0.verify|verify} messages.
2865
+ * @function encodeDelimited
2866
+ * @memberof org.dash.platform.dapi.v0.PlatformFilterV0
2867
+ * @static
2868
+ * @param {org.dash.platform.dapi.v0.IPlatformFilterV0} message PlatformFilterV0 message or plain object to encode
2869
+ * @param {$protobuf.Writer} [writer] Writer to encode to
2870
+ * @returns {$protobuf.Writer} Writer
2871
+ */
2872
+ PlatformFilterV0.encodeDelimited = function encodeDelimited(message, writer) {
2873
+ return this.encode(message, writer).ldelim();
2874
+ };
2875
+
2876
+ /**
2877
+ * Decodes a PlatformFilterV0 message from the specified reader or buffer.
2878
+ * @function decode
2879
+ * @memberof org.dash.platform.dapi.v0.PlatformFilterV0
2880
+ * @static
2881
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2882
+ * @param {number} [length] Message length if known beforehand
2883
+ * @returns {org.dash.platform.dapi.v0.PlatformFilterV0} PlatformFilterV0
2884
+ * @throws {Error} If the payload is not a reader or valid buffer
2885
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
2886
+ */
2887
+ PlatformFilterV0.decode = function decode(reader, length) {
2888
+ if (!(reader instanceof $Reader))
2889
+ reader = $Reader.create(reader);
2890
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.PlatformFilterV0();
2891
+ while (reader.pos < end) {
2892
+ var tag = reader.uint32();
2893
+ switch (tag >>> 3) {
2894
+ case 1:
2895
+ message.all = reader.bool();
2896
+ break;
2897
+ case 2:
2898
+ message.blockCommitted = reader.bool();
2899
+ break;
2900
+ case 3:
2901
+ message.stateTransitionResult = $root.org.dash.platform.dapi.v0.StateTransitionResultFilter.decode(reader, reader.uint32());
2902
+ break;
2903
+ default:
2904
+ reader.skipType(tag & 7);
2905
+ break;
2906
+ }
2907
+ }
2908
+ return message;
2909
+ };
2910
+
2911
+ /**
2912
+ * Decodes a PlatformFilterV0 message from the specified reader or buffer, length delimited.
2913
+ * @function decodeDelimited
2914
+ * @memberof org.dash.platform.dapi.v0.PlatformFilterV0
2915
+ * @static
2916
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2917
+ * @returns {org.dash.platform.dapi.v0.PlatformFilterV0} PlatformFilterV0
2918
+ * @throws {Error} If the payload is not a reader or valid buffer
2919
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
2920
+ */
2921
+ PlatformFilterV0.decodeDelimited = function decodeDelimited(reader) {
2922
+ if (!(reader instanceof $Reader))
2923
+ reader = new $Reader(reader);
2924
+ return this.decode(reader, reader.uint32());
2925
+ };
2926
+
2927
+ /**
2928
+ * Verifies a PlatformFilterV0 message.
2929
+ * @function verify
2930
+ * @memberof org.dash.platform.dapi.v0.PlatformFilterV0
2931
+ * @static
2932
+ * @param {Object.<string,*>} message Plain object to verify
2933
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
2934
+ */
2935
+ PlatformFilterV0.verify = function verify(message) {
2936
+ if (typeof message !== "object" || message === null)
2937
+ return "object expected";
2938
+ var properties = {};
2939
+ if (message.all != null && message.hasOwnProperty("all")) {
2940
+ properties.kind = 1;
2941
+ if (typeof message.all !== "boolean")
2942
+ return "all: boolean expected";
2943
+ }
2944
+ if (message.blockCommitted != null && message.hasOwnProperty("blockCommitted")) {
2945
+ if (properties.kind === 1)
2946
+ return "kind: multiple values";
2947
+ properties.kind = 1;
2948
+ if (typeof message.blockCommitted !== "boolean")
2949
+ return "blockCommitted: boolean expected";
2950
+ }
2951
+ if (message.stateTransitionResult != null && message.hasOwnProperty("stateTransitionResult")) {
2952
+ if (properties.kind === 1)
2953
+ return "kind: multiple values";
2954
+ properties.kind = 1;
2955
+ {
2956
+ var error = $root.org.dash.platform.dapi.v0.StateTransitionResultFilter.verify(message.stateTransitionResult);
2957
+ if (error)
2958
+ return "stateTransitionResult." + error;
2959
+ }
2960
+ }
2961
+ return null;
2962
+ };
2963
+
2964
+ /**
2965
+ * Creates a PlatformFilterV0 message from a plain object. Also converts values to their respective internal types.
2966
+ * @function fromObject
2967
+ * @memberof org.dash.platform.dapi.v0.PlatformFilterV0
2968
+ * @static
2969
+ * @param {Object.<string,*>} object Plain object
2970
+ * @returns {org.dash.platform.dapi.v0.PlatformFilterV0} PlatformFilterV0
2971
+ */
2972
+ PlatformFilterV0.fromObject = function fromObject(object) {
2973
+ if (object instanceof $root.org.dash.platform.dapi.v0.PlatformFilterV0)
2974
+ return object;
2975
+ var message = new $root.org.dash.platform.dapi.v0.PlatformFilterV0();
2976
+ if (object.all != null)
2977
+ message.all = Boolean(object.all);
2978
+ if (object.blockCommitted != null)
2979
+ message.blockCommitted = Boolean(object.blockCommitted);
2980
+ if (object.stateTransitionResult != null) {
2981
+ if (typeof object.stateTransitionResult !== "object")
2982
+ throw TypeError(".org.dash.platform.dapi.v0.PlatformFilterV0.stateTransitionResult: object expected");
2983
+ message.stateTransitionResult = $root.org.dash.platform.dapi.v0.StateTransitionResultFilter.fromObject(object.stateTransitionResult);
2984
+ }
2985
+ return message;
2986
+ };
2987
+
2988
+ /**
2989
+ * Creates a plain object from a PlatformFilterV0 message. Also converts values to other types if specified.
2990
+ * @function toObject
2991
+ * @memberof org.dash.platform.dapi.v0.PlatformFilterV0
2992
+ * @static
2993
+ * @param {org.dash.platform.dapi.v0.PlatformFilterV0} message PlatformFilterV0
2994
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
2995
+ * @returns {Object.<string,*>} Plain object
2996
+ */
2997
+ PlatformFilterV0.toObject = function toObject(message, options) {
2998
+ if (!options)
2999
+ options = {};
3000
+ var object = {};
3001
+ if (message.all != null && message.hasOwnProperty("all")) {
3002
+ object.all = message.all;
3003
+ if (options.oneofs)
3004
+ object.kind = "all";
3005
+ }
3006
+ if (message.blockCommitted != null && message.hasOwnProperty("blockCommitted")) {
3007
+ object.blockCommitted = message.blockCommitted;
3008
+ if (options.oneofs)
3009
+ object.kind = "blockCommitted";
3010
+ }
3011
+ if (message.stateTransitionResult != null && message.hasOwnProperty("stateTransitionResult")) {
3012
+ object.stateTransitionResult = $root.org.dash.platform.dapi.v0.StateTransitionResultFilter.toObject(message.stateTransitionResult, options);
3013
+ if (options.oneofs)
3014
+ object.kind = "stateTransitionResult";
3015
+ }
3016
+ return object;
3017
+ };
3018
+
3019
+ /**
3020
+ * Converts this PlatformFilterV0 to JSON.
3021
+ * @function toJSON
3022
+ * @memberof org.dash.platform.dapi.v0.PlatformFilterV0
3023
+ * @instance
3024
+ * @returns {Object.<string,*>} JSON object
3025
+ */
3026
+ PlatformFilterV0.prototype.toJSON = function toJSON() {
3027
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
3028
+ };
3029
+
3030
+ return PlatformFilterV0;
3031
+ })();
3032
+
3033
+ v0.PlatformEventV0 = (function() {
3034
+
3035
+ /**
3036
+ * Properties of a PlatformEventV0.
3037
+ * @memberof org.dash.platform.dapi.v0
3038
+ * @interface IPlatformEventV0
3039
+ * @property {org.dash.platform.dapi.v0.PlatformEventV0.IBlockCommitted|null} [blockCommitted] PlatformEventV0 blockCommitted
3040
+ * @property {org.dash.platform.dapi.v0.PlatformEventV0.IStateTransitionFinalized|null} [stateTransitionFinalized] PlatformEventV0 stateTransitionFinalized
3041
+ */
3042
+
3043
+ /**
3044
+ * Constructs a new PlatformEventV0.
3045
+ * @memberof org.dash.platform.dapi.v0
3046
+ * @classdesc Represents a PlatformEventV0.
3047
+ * @implements IPlatformEventV0
3048
+ * @constructor
3049
+ * @param {org.dash.platform.dapi.v0.IPlatformEventV0=} [properties] Properties to set
3050
+ */
3051
+ function PlatformEventV0(properties) {
3052
+ if (properties)
3053
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
3054
+ if (properties[keys[i]] != null)
3055
+ this[keys[i]] = properties[keys[i]];
3056
+ }
3057
+
3058
+ /**
3059
+ * PlatformEventV0 blockCommitted.
3060
+ * @member {org.dash.platform.dapi.v0.PlatformEventV0.IBlockCommitted|null|undefined} blockCommitted
3061
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0
3062
+ * @instance
3063
+ */
3064
+ PlatformEventV0.prototype.blockCommitted = null;
3065
+
3066
+ /**
3067
+ * PlatformEventV0 stateTransitionFinalized.
3068
+ * @member {org.dash.platform.dapi.v0.PlatformEventV0.IStateTransitionFinalized|null|undefined} stateTransitionFinalized
3069
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0
3070
+ * @instance
3071
+ */
3072
+ PlatformEventV0.prototype.stateTransitionFinalized = null;
3073
+
3074
+ // OneOf field names bound to virtual getters and setters
3075
+ var $oneOfFields;
3076
+
3077
+ /**
3078
+ * PlatformEventV0 event.
3079
+ * @member {"blockCommitted"|"stateTransitionFinalized"|undefined} event
3080
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0
3081
+ * @instance
3082
+ */
3083
+ Object.defineProperty(PlatformEventV0.prototype, "event", {
3084
+ get: $util.oneOfGetter($oneOfFields = ["blockCommitted", "stateTransitionFinalized"]),
3085
+ set: $util.oneOfSetter($oneOfFields)
3086
+ });
3087
+
3088
+ /**
3089
+ * Creates a new PlatformEventV0 instance using the specified properties.
3090
+ * @function create
3091
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0
3092
+ * @static
3093
+ * @param {org.dash.platform.dapi.v0.IPlatformEventV0=} [properties] Properties to set
3094
+ * @returns {org.dash.platform.dapi.v0.PlatformEventV0} PlatformEventV0 instance
3095
+ */
3096
+ PlatformEventV0.create = function create(properties) {
3097
+ return new PlatformEventV0(properties);
3098
+ };
3099
+
3100
+ /**
3101
+ * Encodes the specified PlatformEventV0 message. Does not implicitly {@link org.dash.platform.dapi.v0.PlatformEventV0.verify|verify} messages.
3102
+ * @function encode
3103
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0
3104
+ * @static
3105
+ * @param {org.dash.platform.dapi.v0.IPlatformEventV0} message PlatformEventV0 message or plain object to encode
3106
+ * @param {$protobuf.Writer} [writer] Writer to encode to
3107
+ * @returns {$protobuf.Writer} Writer
3108
+ */
3109
+ PlatformEventV0.encode = function encode(message, writer) {
3110
+ if (!writer)
3111
+ writer = $Writer.create();
3112
+ if (message.blockCommitted != null && Object.hasOwnProperty.call(message, "blockCommitted"))
3113
+ $root.org.dash.platform.dapi.v0.PlatformEventV0.BlockCommitted.encode(message.blockCommitted, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
3114
+ if (message.stateTransitionFinalized != null && Object.hasOwnProperty.call(message, "stateTransitionFinalized"))
3115
+ $root.org.dash.platform.dapi.v0.PlatformEventV0.StateTransitionFinalized.encode(message.stateTransitionFinalized, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
3116
+ return writer;
3117
+ };
3118
+
3119
+ /**
3120
+ * Encodes the specified PlatformEventV0 message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.PlatformEventV0.verify|verify} messages.
3121
+ * @function encodeDelimited
3122
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0
3123
+ * @static
3124
+ * @param {org.dash.platform.dapi.v0.IPlatformEventV0} message PlatformEventV0 message or plain object to encode
3125
+ * @param {$protobuf.Writer} [writer] Writer to encode to
3126
+ * @returns {$protobuf.Writer} Writer
3127
+ */
3128
+ PlatformEventV0.encodeDelimited = function encodeDelimited(message, writer) {
3129
+ return this.encode(message, writer).ldelim();
3130
+ };
3131
+
3132
+ /**
3133
+ * Decodes a PlatformEventV0 message from the specified reader or buffer.
3134
+ * @function decode
3135
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0
3136
+ * @static
3137
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
3138
+ * @param {number} [length] Message length if known beforehand
3139
+ * @returns {org.dash.platform.dapi.v0.PlatformEventV0} PlatformEventV0
3140
+ * @throws {Error} If the payload is not a reader or valid buffer
3141
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
3142
+ */
3143
+ PlatformEventV0.decode = function decode(reader, length) {
3144
+ if (!(reader instanceof $Reader))
3145
+ reader = $Reader.create(reader);
3146
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.PlatformEventV0();
3147
+ while (reader.pos < end) {
3148
+ var tag = reader.uint32();
3149
+ switch (tag >>> 3) {
3150
+ case 1:
3151
+ message.blockCommitted = $root.org.dash.platform.dapi.v0.PlatformEventV0.BlockCommitted.decode(reader, reader.uint32());
3152
+ break;
3153
+ case 2:
3154
+ message.stateTransitionFinalized = $root.org.dash.platform.dapi.v0.PlatformEventV0.StateTransitionFinalized.decode(reader, reader.uint32());
3155
+ break;
3156
+ default:
3157
+ reader.skipType(tag & 7);
3158
+ break;
3159
+ }
3160
+ }
3161
+ return message;
3162
+ };
3163
+
3164
+ /**
3165
+ * Decodes a PlatformEventV0 message from the specified reader or buffer, length delimited.
3166
+ * @function decodeDelimited
3167
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0
3168
+ * @static
3169
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
3170
+ * @returns {org.dash.platform.dapi.v0.PlatformEventV0} PlatformEventV0
3171
+ * @throws {Error} If the payload is not a reader or valid buffer
3172
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
3173
+ */
3174
+ PlatformEventV0.decodeDelimited = function decodeDelimited(reader) {
3175
+ if (!(reader instanceof $Reader))
3176
+ reader = new $Reader(reader);
3177
+ return this.decode(reader, reader.uint32());
3178
+ };
3179
+
3180
+ /**
3181
+ * Verifies a PlatformEventV0 message.
3182
+ * @function verify
3183
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0
3184
+ * @static
3185
+ * @param {Object.<string,*>} message Plain object to verify
3186
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
3187
+ */
3188
+ PlatformEventV0.verify = function verify(message) {
3189
+ if (typeof message !== "object" || message === null)
3190
+ return "object expected";
3191
+ var properties = {};
3192
+ if (message.blockCommitted != null && message.hasOwnProperty("blockCommitted")) {
3193
+ properties.event = 1;
3194
+ {
3195
+ var error = $root.org.dash.platform.dapi.v0.PlatformEventV0.BlockCommitted.verify(message.blockCommitted);
3196
+ if (error)
3197
+ return "blockCommitted." + error;
3198
+ }
3199
+ }
3200
+ if (message.stateTransitionFinalized != null && message.hasOwnProperty("stateTransitionFinalized")) {
3201
+ if (properties.event === 1)
3202
+ return "event: multiple values";
3203
+ properties.event = 1;
3204
+ {
3205
+ var error = $root.org.dash.platform.dapi.v0.PlatformEventV0.StateTransitionFinalized.verify(message.stateTransitionFinalized);
3206
+ if (error)
3207
+ return "stateTransitionFinalized." + error;
3208
+ }
3209
+ }
3210
+ return null;
3211
+ };
3212
+
3213
+ /**
3214
+ * Creates a PlatformEventV0 message from a plain object. Also converts values to their respective internal types.
3215
+ * @function fromObject
3216
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0
3217
+ * @static
3218
+ * @param {Object.<string,*>} object Plain object
3219
+ * @returns {org.dash.platform.dapi.v0.PlatformEventV0} PlatformEventV0
3220
+ */
3221
+ PlatformEventV0.fromObject = function fromObject(object) {
3222
+ if (object instanceof $root.org.dash.platform.dapi.v0.PlatformEventV0)
3223
+ return object;
3224
+ var message = new $root.org.dash.platform.dapi.v0.PlatformEventV0();
3225
+ if (object.blockCommitted != null) {
3226
+ if (typeof object.blockCommitted !== "object")
3227
+ throw TypeError(".org.dash.platform.dapi.v0.PlatformEventV0.blockCommitted: object expected");
3228
+ message.blockCommitted = $root.org.dash.platform.dapi.v0.PlatformEventV0.BlockCommitted.fromObject(object.blockCommitted);
3229
+ }
3230
+ if (object.stateTransitionFinalized != null) {
3231
+ if (typeof object.stateTransitionFinalized !== "object")
3232
+ throw TypeError(".org.dash.platform.dapi.v0.PlatformEventV0.stateTransitionFinalized: object expected");
3233
+ message.stateTransitionFinalized = $root.org.dash.platform.dapi.v0.PlatformEventV0.StateTransitionFinalized.fromObject(object.stateTransitionFinalized);
3234
+ }
3235
+ return message;
3236
+ };
3237
+
3238
+ /**
3239
+ * Creates a plain object from a PlatformEventV0 message. Also converts values to other types if specified.
3240
+ * @function toObject
3241
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0
3242
+ * @static
3243
+ * @param {org.dash.platform.dapi.v0.PlatformEventV0} message PlatformEventV0
3244
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
3245
+ * @returns {Object.<string,*>} Plain object
3246
+ */
3247
+ PlatformEventV0.toObject = function toObject(message, options) {
3248
+ if (!options)
3249
+ options = {};
3250
+ var object = {};
3251
+ if (message.blockCommitted != null && message.hasOwnProperty("blockCommitted")) {
3252
+ object.blockCommitted = $root.org.dash.platform.dapi.v0.PlatformEventV0.BlockCommitted.toObject(message.blockCommitted, options);
3253
+ if (options.oneofs)
3254
+ object.event = "blockCommitted";
3255
+ }
3256
+ if (message.stateTransitionFinalized != null && message.hasOwnProperty("stateTransitionFinalized")) {
3257
+ object.stateTransitionFinalized = $root.org.dash.platform.dapi.v0.PlatformEventV0.StateTransitionFinalized.toObject(message.stateTransitionFinalized, options);
3258
+ if (options.oneofs)
3259
+ object.event = "stateTransitionFinalized";
3260
+ }
3261
+ return object;
3262
+ };
3263
+
3264
+ /**
3265
+ * Converts this PlatformEventV0 to JSON.
3266
+ * @function toJSON
3267
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0
3268
+ * @instance
3269
+ * @returns {Object.<string,*>} JSON object
3270
+ */
3271
+ PlatformEventV0.prototype.toJSON = function toJSON() {
3272
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
3273
+ };
3274
+
3275
+ PlatformEventV0.BlockMetadata = (function() {
3276
+
3277
+ /**
3278
+ * Properties of a BlockMetadata.
3279
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0
3280
+ * @interface IBlockMetadata
3281
+ * @property {number|Long|null} [height] BlockMetadata height
3282
+ * @property {number|Long|null} [timeMs] BlockMetadata timeMs
3283
+ * @property {Uint8Array|null} [blockIdHash] BlockMetadata blockIdHash
3284
+ */
3285
+
3286
+ /**
3287
+ * Constructs a new BlockMetadata.
3288
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0
3289
+ * @classdesc Represents a BlockMetadata.
3290
+ * @implements IBlockMetadata
3291
+ * @constructor
3292
+ * @param {org.dash.platform.dapi.v0.PlatformEventV0.IBlockMetadata=} [properties] Properties to set
3293
+ */
3294
+ function BlockMetadata(properties) {
3295
+ if (properties)
3296
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
3297
+ if (properties[keys[i]] != null)
3298
+ this[keys[i]] = properties[keys[i]];
3299
+ }
3300
+
3301
+ /**
3302
+ * BlockMetadata height.
3303
+ * @member {number|Long} height
3304
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0.BlockMetadata
3305
+ * @instance
3306
+ */
3307
+ BlockMetadata.prototype.height = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
3308
+
3309
+ /**
3310
+ * BlockMetadata timeMs.
3311
+ * @member {number|Long} timeMs
3312
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0.BlockMetadata
3313
+ * @instance
3314
+ */
3315
+ BlockMetadata.prototype.timeMs = $util.Long ? $util.Long.fromBits(0,0,true) : 0;
3316
+
3317
+ /**
3318
+ * BlockMetadata blockIdHash.
3319
+ * @member {Uint8Array} blockIdHash
3320
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0.BlockMetadata
3321
+ * @instance
3322
+ */
3323
+ BlockMetadata.prototype.blockIdHash = $util.newBuffer([]);
3324
+
3325
+ /**
3326
+ * Creates a new BlockMetadata instance using the specified properties.
3327
+ * @function create
3328
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0.BlockMetadata
3329
+ * @static
3330
+ * @param {org.dash.platform.dapi.v0.PlatformEventV0.IBlockMetadata=} [properties] Properties to set
3331
+ * @returns {org.dash.platform.dapi.v0.PlatformEventV0.BlockMetadata} BlockMetadata instance
3332
+ */
3333
+ BlockMetadata.create = function create(properties) {
3334
+ return new BlockMetadata(properties);
3335
+ };
3336
+
3337
+ /**
3338
+ * Encodes the specified BlockMetadata message. Does not implicitly {@link org.dash.platform.dapi.v0.PlatformEventV0.BlockMetadata.verify|verify} messages.
3339
+ * @function encode
3340
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0.BlockMetadata
3341
+ * @static
3342
+ * @param {org.dash.platform.dapi.v0.PlatformEventV0.IBlockMetadata} message BlockMetadata message or plain object to encode
3343
+ * @param {$protobuf.Writer} [writer] Writer to encode to
3344
+ * @returns {$protobuf.Writer} Writer
3345
+ */
3346
+ BlockMetadata.encode = function encode(message, writer) {
3347
+ if (!writer)
3348
+ writer = $Writer.create();
3349
+ if (message.height != null && Object.hasOwnProperty.call(message, "height"))
3350
+ writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.height);
3351
+ if (message.timeMs != null && Object.hasOwnProperty.call(message, "timeMs"))
3352
+ writer.uint32(/* id 2, wireType 0 =*/16).uint64(message.timeMs);
3353
+ if (message.blockIdHash != null && Object.hasOwnProperty.call(message, "blockIdHash"))
3354
+ writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.blockIdHash);
3355
+ return writer;
3356
+ };
3357
+
3358
+ /**
3359
+ * Encodes the specified BlockMetadata message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.PlatformEventV0.BlockMetadata.verify|verify} messages.
3360
+ * @function encodeDelimited
3361
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0.BlockMetadata
3362
+ * @static
3363
+ * @param {org.dash.platform.dapi.v0.PlatformEventV0.IBlockMetadata} message BlockMetadata message or plain object to encode
3364
+ * @param {$protobuf.Writer} [writer] Writer to encode to
3365
+ * @returns {$protobuf.Writer} Writer
3366
+ */
3367
+ BlockMetadata.encodeDelimited = function encodeDelimited(message, writer) {
3368
+ return this.encode(message, writer).ldelim();
3369
+ };
3370
+
3371
+ /**
3372
+ * Decodes a BlockMetadata message from the specified reader or buffer.
3373
+ * @function decode
3374
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0.BlockMetadata
3375
+ * @static
3376
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
3377
+ * @param {number} [length] Message length if known beforehand
3378
+ * @returns {org.dash.platform.dapi.v0.PlatformEventV0.BlockMetadata} BlockMetadata
3379
+ * @throws {Error} If the payload is not a reader or valid buffer
3380
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
3381
+ */
3382
+ BlockMetadata.decode = function decode(reader, length) {
3383
+ if (!(reader instanceof $Reader))
3384
+ reader = $Reader.create(reader);
3385
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.PlatformEventV0.BlockMetadata();
3386
+ while (reader.pos < end) {
3387
+ var tag = reader.uint32();
3388
+ switch (tag >>> 3) {
3389
+ case 1:
3390
+ message.height = reader.uint64();
3391
+ break;
3392
+ case 2:
3393
+ message.timeMs = reader.uint64();
3394
+ break;
3395
+ case 3:
3396
+ message.blockIdHash = reader.bytes();
3397
+ break;
3398
+ default:
3399
+ reader.skipType(tag & 7);
3400
+ break;
3401
+ }
3402
+ }
3403
+ return message;
3404
+ };
3405
+
3406
+ /**
3407
+ * Decodes a BlockMetadata message from the specified reader or buffer, length delimited.
3408
+ * @function decodeDelimited
3409
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0.BlockMetadata
3410
+ * @static
3411
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
3412
+ * @returns {org.dash.platform.dapi.v0.PlatformEventV0.BlockMetadata} BlockMetadata
3413
+ * @throws {Error} If the payload is not a reader or valid buffer
3414
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
3415
+ */
3416
+ BlockMetadata.decodeDelimited = function decodeDelimited(reader) {
3417
+ if (!(reader instanceof $Reader))
3418
+ reader = new $Reader(reader);
3419
+ return this.decode(reader, reader.uint32());
3420
+ };
3421
+
3422
+ /**
3423
+ * Verifies a BlockMetadata message.
3424
+ * @function verify
3425
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0.BlockMetadata
3426
+ * @static
3427
+ * @param {Object.<string,*>} message Plain object to verify
3428
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
3429
+ */
3430
+ BlockMetadata.verify = function verify(message) {
3431
+ if (typeof message !== "object" || message === null)
3432
+ return "object expected";
3433
+ if (message.height != null && message.hasOwnProperty("height"))
3434
+ if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high)))
3435
+ return "height: integer|Long expected";
3436
+ if (message.timeMs != null && message.hasOwnProperty("timeMs"))
3437
+ if (!$util.isInteger(message.timeMs) && !(message.timeMs && $util.isInteger(message.timeMs.low) && $util.isInteger(message.timeMs.high)))
3438
+ return "timeMs: integer|Long expected";
3439
+ if (message.blockIdHash != null && message.hasOwnProperty("blockIdHash"))
3440
+ if (!(message.blockIdHash && typeof message.blockIdHash.length === "number" || $util.isString(message.blockIdHash)))
3441
+ return "blockIdHash: buffer expected";
3442
+ return null;
3443
+ };
3444
+
3445
+ /**
3446
+ * Creates a BlockMetadata message from a plain object. Also converts values to their respective internal types.
3447
+ * @function fromObject
3448
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0.BlockMetadata
3449
+ * @static
3450
+ * @param {Object.<string,*>} object Plain object
3451
+ * @returns {org.dash.platform.dapi.v0.PlatformEventV0.BlockMetadata} BlockMetadata
3452
+ */
3453
+ BlockMetadata.fromObject = function fromObject(object) {
3454
+ if (object instanceof $root.org.dash.platform.dapi.v0.PlatformEventV0.BlockMetadata)
3455
+ return object;
3456
+ var message = new $root.org.dash.platform.dapi.v0.PlatformEventV0.BlockMetadata();
3457
+ if (object.height != null)
3458
+ if ($util.Long)
3459
+ (message.height = $util.Long.fromValue(object.height)).unsigned = true;
3460
+ else if (typeof object.height === "string")
3461
+ message.height = parseInt(object.height, 10);
3462
+ else if (typeof object.height === "number")
3463
+ message.height = object.height;
3464
+ else if (typeof object.height === "object")
3465
+ message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(true);
3466
+ if (object.timeMs != null)
3467
+ if ($util.Long)
3468
+ (message.timeMs = $util.Long.fromValue(object.timeMs)).unsigned = true;
3469
+ else if (typeof object.timeMs === "string")
3470
+ message.timeMs = parseInt(object.timeMs, 10);
3471
+ else if (typeof object.timeMs === "number")
3472
+ message.timeMs = object.timeMs;
3473
+ else if (typeof object.timeMs === "object")
3474
+ message.timeMs = new $util.LongBits(object.timeMs.low >>> 0, object.timeMs.high >>> 0).toNumber(true);
3475
+ if (object.blockIdHash != null)
3476
+ if (typeof object.blockIdHash === "string")
3477
+ $util.base64.decode(object.blockIdHash, message.blockIdHash = $util.newBuffer($util.base64.length(object.blockIdHash)), 0);
3478
+ else if (object.blockIdHash.length >= 0)
3479
+ message.blockIdHash = object.blockIdHash;
3480
+ return message;
3481
+ };
3482
+
3483
+ /**
3484
+ * Creates a plain object from a BlockMetadata message. Also converts values to other types if specified.
3485
+ * @function toObject
3486
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0.BlockMetadata
3487
+ * @static
3488
+ * @param {org.dash.platform.dapi.v0.PlatformEventV0.BlockMetadata} message BlockMetadata
3489
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
3490
+ * @returns {Object.<string,*>} Plain object
3491
+ */
3492
+ BlockMetadata.toObject = function toObject(message, options) {
3493
+ if (!options)
3494
+ options = {};
3495
+ var object = {};
3496
+ if (options.defaults) {
3497
+ if ($util.Long) {
3498
+ var long = new $util.Long(0, 0, true);
3499
+ object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
3500
+ } else
3501
+ object.height = options.longs === String ? "0" : 0;
3502
+ if ($util.Long) {
3503
+ var long = new $util.Long(0, 0, true);
3504
+ object.timeMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
3505
+ } else
3506
+ object.timeMs = options.longs === String ? "0" : 0;
3507
+ if (options.bytes === String)
3508
+ object.blockIdHash = "";
3509
+ else {
3510
+ object.blockIdHash = [];
3511
+ if (options.bytes !== Array)
3512
+ object.blockIdHash = $util.newBuffer(object.blockIdHash);
3513
+ }
3514
+ }
3515
+ if (message.height != null && message.hasOwnProperty("height"))
3516
+ if (typeof message.height === "number")
3517
+ object.height = options.longs === String ? String(message.height) : message.height;
3518
+ else
3519
+ object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber(true) : message.height;
3520
+ if (message.timeMs != null && message.hasOwnProperty("timeMs"))
3521
+ if (typeof message.timeMs === "number")
3522
+ object.timeMs = options.longs === String ? String(message.timeMs) : message.timeMs;
3523
+ else
3524
+ object.timeMs = options.longs === String ? $util.Long.prototype.toString.call(message.timeMs) : options.longs === Number ? new $util.LongBits(message.timeMs.low >>> 0, message.timeMs.high >>> 0).toNumber(true) : message.timeMs;
3525
+ if (message.blockIdHash != null && message.hasOwnProperty("blockIdHash"))
3526
+ object.blockIdHash = options.bytes === String ? $util.base64.encode(message.blockIdHash, 0, message.blockIdHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.blockIdHash) : message.blockIdHash;
3527
+ return object;
3528
+ };
3529
+
3530
+ /**
3531
+ * Converts this BlockMetadata to JSON.
3532
+ * @function toJSON
3533
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0.BlockMetadata
3534
+ * @instance
3535
+ * @returns {Object.<string,*>} JSON object
3536
+ */
3537
+ BlockMetadata.prototype.toJSON = function toJSON() {
3538
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
3539
+ };
3540
+
3541
+ return BlockMetadata;
3542
+ })();
3543
+
3544
+ PlatformEventV0.BlockCommitted = (function() {
3545
+
3546
+ /**
3547
+ * Properties of a BlockCommitted.
3548
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0
3549
+ * @interface IBlockCommitted
3550
+ * @property {org.dash.platform.dapi.v0.PlatformEventV0.IBlockMetadata|null} [meta] BlockCommitted meta
3551
+ * @property {number|null} [txCount] BlockCommitted txCount
3552
+ */
3553
+
3554
+ /**
3555
+ * Constructs a new BlockCommitted.
3556
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0
3557
+ * @classdesc Represents a BlockCommitted.
3558
+ * @implements IBlockCommitted
3559
+ * @constructor
3560
+ * @param {org.dash.platform.dapi.v0.PlatformEventV0.IBlockCommitted=} [properties] Properties to set
3561
+ */
3562
+ function BlockCommitted(properties) {
3563
+ if (properties)
3564
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
3565
+ if (properties[keys[i]] != null)
3566
+ this[keys[i]] = properties[keys[i]];
3567
+ }
3568
+
3569
+ /**
3570
+ * BlockCommitted meta.
3571
+ * @member {org.dash.platform.dapi.v0.PlatformEventV0.IBlockMetadata|null|undefined} meta
3572
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0.BlockCommitted
3573
+ * @instance
3574
+ */
3575
+ BlockCommitted.prototype.meta = null;
3576
+
3577
+ /**
3578
+ * BlockCommitted txCount.
3579
+ * @member {number} txCount
3580
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0.BlockCommitted
3581
+ * @instance
3582
+ */
3583
+ BlockCommitted.prototype.txCount = 0;
3584
+
3585
+ /**
3586
+ * Creates a new BlockCommitted instance using the specified properties.
3587
+ * @function create
3588
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0.BlockCommitted
3589
+ * @static
3590
+ * @param {org.dash.platform.dapi.v0.PlatformEventV0.IBlockCommitted=} [properties] Properties to set
3591
+ * @returns {org.dash.platform.dapi.v0.PlatformEventV0.BlockCommitted} BlockCommitted instance
3592
+ */
3593
+ BlockCommitted.create = function create(properties) {
3594
+ return new BlockCommitted(properties);
3595
+ };
3596
+
3597
+ /**
3598
+ * Encodes the specified BlockCommitted message. Does not implicitly {@link org.dash.platform.dapi.v0.PlatformEventV0.BlockCommitted.verify|verify} messages.
3599
+ * @function encode
3600
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0.BlockCommitted
3601
+ * @static
3602
+ * @param {org.dash.platform.dapi.v0.PlatformEventV0.IBlockCommitted} message BlockCommitted message or plain object to encode
3603
+ * @param {$protobuf.Writer} [writer] Writer to encode to
3604
+ * @returns {$protobuf.Writer} Writer
3605
+ */
3606
+ BlockCommitted.encode = function encode(message, writer) {
3607
+ if (!writer)
3608
+ writer = $Writer.create();
3609
+ if (message.meta != null && Object.hasOwnProperty.call(message, "meta"))
3610
+ $root.org.dash.platform.dapi.v0.PlatformEventV0.BlockMetadata.encode(message.meta, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
3611
+ if (message.txCount != null && Object.hasOwnProperty.call(message, "txCount"))
3612
+ writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.txCount);
3613
+ return writer;
3614
+ };
3615
+
3616
+ /**
3617
+ * Encodes the specified BlockCommitted message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.PlatformEventV0.BlockCommitted.verify|verify} messages.
3618
+ * @function encodeDelimited
3619
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0.BlockCommitted
3620
+ * @static
3621
+ * @param {org.dash.platform.dapi.v0.PlatformEventV0.IBlockCommitted} message BlockCommitted message or plain object to encode
3622
+ * @param {$protobuf.Writer} [writer] Writer to encode to
3623
+ * @returns {$protobuf.Writer} Writer
3624
+ */
3625
+ BlockCommitted.encodeDelimited = function encodeDelimited(message, writer) {
3626
+ return this.encode(message, writer).ldelim();
3627
+ };
3628
+
3629
+ /**
3630
+ * Decodes a BlockCommitted message from the specified reader or buffer.
3631
+ * @function decode
3632
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0.BlockCommitted
3633
+ * @static
3634
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
3635
+ * @param {number} [length] Message length if known beforehand
3636
+ * @returns {org.dash.platform.dapi.v0.PlatformEventV0.BlockCommitted} BlockCommitted
3637
+ * @throws {Error} If the payload is not a reader or valid buffer
3638
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
3639
+ */
3640
+ BlockCommitted.decode = function decode(reader, length) {
3641
+ if (!(reader instanceof $Reader))
3642
+ reader = $Reader.create(reader);
3643
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.PlatformEventV0.BlockCommitted();
3644
+ while (reader.pos < end) {
3645
+ var tag = reader.uint32();
3646
+ switch (tag >>> 3) {
3647
+ case 1:
3648
+ message.meta = $root.org.dash.platform.dapi.v0.PlatformEventV0.BlockMetadata.decode(reader, reader.uint32());
3649
+ break;
3650
+ case 2:
3651
+ message.txCount = reader.uint32();
3652
+ break;
3653
+ default:
3654
+ reader.skipType(tag & 7);
3655
+ break;
3656
+ }
3657
+ }
3658
+ return message;
3659
+ };
3660
+
3661
+ /**
3662
+ * Decodes a BlockCommitted message from the specified reader or buffer, length delimited.
3663
+ * @function decodeDelimited
3664
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0.BlockCommitted
3665
+ * @static
3666
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
3667
+ * @returns {org.dash.platform.dapi.v0.PlatformEventV0.BlockCommitted} BlockCommitted
3668
+ * @throws {Error} If the payload is not a reader or valid buffer
3669
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
3670
+ */
3671
+ BlockCommitted.decodeDelimited = function decodeDelimited(reader) {
3672
+ if (!(reader instanceof $Reader))
3673
+ reader = new $Reader(reader);
3674
+ return this.decode(reader, reader.uint32());
3675
+ };
3676
+
3677
+ /**
3678
+ * Verifies a BlockCommitted message.
3679
+ * @function verify
3680
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0.BlockCommitted
3681
+ * @static
3682
+ * @param {Object.<string,*>} message Plain object to verify
3683
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
3684
+ */
3685
+ BlockCommitted.verify = function verify(message) {
3686
+ if (typeof message !== "object" || message === null)
3687
+ return "object expected";
3688
+ if (message.meta != null && message.hasOwnProperty("meta")) {
3689
+ var error = $root.org.dash.platform.dapi.v0.PlatformEventV0.BlockMetadata.verify(message.meta);
3690
+ if (error)
3691
+ return "meta." + error;
3692
+ }
3693
+ if (message.txCount != null && message.hasOwnProperty("txCount"))
3694
+ if (!$util.isInteger(message.txCount))
3695
+ return "txCount: integer expected";
3696
+ return null;
3697
+ };
3698
+
3699
+ /**
3700
+ * Creates a BlockCommitted message from a plain object. Also converts values to their respective internal types.
3701
+ * @function fromObject
3702
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0.BlockCommitted
3703
+ * @static
3704
+ * @param {Object.<string,*>} object Plain object
3705
+ * @returns {org.dash.platform.dapi.v0.PlatformEventV0.BlockCommitted} BlockCommitted
3706
+ */
3707
+ BlockCommitted.fromObject = function fromObject(object) {
3708
+ if (object instanceof $root.org.dash.platform.dapi.v0.PlatformEventV0.BlockCommitted)
3709
+ return object;
3710
+ var message = new $root.org.dash.platform.dapi.v0.PlatformEventV0.BlockCommitted();
3711
+ if (object.meta != null) {
3712
+ if (typeof object.meta !== "object")
3713
+ throw TypeError(".org.dash.platform.dapi.v0.PlatformEventV0.BlockCommitted.meta: object expected");
3714
+ message.meta = $root.org.dash.platform.dapi.v0.PlatformEventV0.BlockMetadata.fromObject(object.meta);
3715
+ }
3716
+ if (object.txCount != null)
3717
+ message.txCount = object.txCount >>> 0;
3718
+ return message;
3719
+ };
3720
+
3721
+ /**
3722
+ * Creates a plain object from a BlockCommitted message. Also converts values to other types if specified.
3723
+ * @function toObject
3724
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0.BlockCommitted
3725
+ * @static
3726
+ * @param {org.dash.platform.dapi.v0.PlatformEventV0.BlockCommitted} message BlockCommitted
3727
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
3728
+ * @returns {Object.<string,*>} Plain object
3729
+ */
3730
+ BlockCommitted.toObject = function toObject(message, options) {
3731
+ if (!options)
3732
+ options = {};
3733
+ var object = {};
3734
+ if (options.defaults) {
3735
+ object.meta = null;
3736
+ object.txCount = 0;
3737
+ }
3738
+ if (message.meta != null && message.hasOwnProperty("meta"))
3739
+ object.meta = $root.org.dash.platform.dapi.v0.PlatformEventV0.BlockMetadata.toObject(message.meta, options);
3740
+ if (message.txCount != null && message.hasOwnProperty("txCount"))
3741
+ object.txCount = message.txCount;
3742
+ return object;
3743
+ };
3744
+
3745
+ /**
3746
+ * Converts this BlockCommitted to JSON.
3747
+ * @function toJSON
3748
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0.BlockCommitted
3749
+ * @instance
3750
+ * @returns {Object.<string,*>} JSON object
3751
+ */
3752
+ BlockCommitted.prototype.toJSON = function toJSON() {
3753
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
3754
+ };
3755
+
3756
+ return BlockCommitted;
3757
+ })();
3758
+
3759
+ PlatformEventV0.StateTransitionFinalized = (function() {
3760
+
3761
+ /**
3762
+ * Properties of a StateTransitionFinalized.
3763
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0
3764
+ * @interface IStateTransitionFinalized
3765
+ * @property {org.dash.platform.dapi.v0.PlatformEventV0.IBlockMetadata|null} [meta] StateTransitionFinalized meta
3766
+ * @property {Uint8Array|null} [txHash] StateTransitionFinalized txHash
3767
+ */
3768
+
3769
+ /**
3770
+ * Constructs a new StateTransitionFinalized.
3771
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0
3772
+ * @classdesc Represents a StateTransitionFinalized.
3773
+ * @implements IStateTransitionFinalized
3774
+ * @constructor
3775
+ * @param {org.dash.platform.dapi.v0.PlatformEventV0.IStateTransitionFinalized=} [properties] Properties to set
3776
+ */
3777
+ function StateTransitionFinalized(properties) {
3778
+ if (properties)
3779
+ for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
3780
+ if (properties[keys[i]] != null)
3781
+ this[keys[i]] = properties[keys[i]];
3782
+ }
3783
+
3784
+ /**
3785
+ * StateTransitionFinalized meta.
3786
+ * @member {org.dash.platform.dapi.v0.PlatformEventV0.IBlockMetadata|null|undefined} meta
3787
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0.StateTransitionFinalized
3788
+ * @instance
3789
+ */
3790
+ StateTransitionFinalized.prototype.meta = null;
3791
+
3792
+ /**
3793
+ * StateTransitionFinalized txHash.
3794
+ * @member {Uint8Array} txHash
3795
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0.StateTransitionFinalized
3796
+ * @instance
3797
+ */
3798
+ StateTransitionFinalized.prototype.txHash = $util.newBuffer([]);
3799
+
3800
+ /**
3801
+ * Creates a new StateTransitionFinalized instance using the specified properties.
3802
+ * @function create
3803
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0.StateTransitionFinalized
3804
+ * @static
3805
+ * @param {org.dash.platform.dapi.v0.PlatformEventV0.IStateTransitionFinalized=} [properties] Properties to set
3806
+ * @returns {org.dash.platform.dapi.v0.PlatformEventV0.StateTransitionFinalized} StateTransitionFinalized instance
3807
+ */
3808
+ StateTransitionFinalized.create = function create(properties) {
3809
+ return new StateTransitionFinalized(properties);
3810
+ };
3811
+
3812
+ /**
3813
+ * Encodes the specified StateTransitionFinalized message. Does not implicitly {@link org.dash.platform.dapi.v0.PlatformEventV0.StateTransitionFinalized.verify|verify} messages.
3814
+ * @function encode
3815
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0.StateTransitionFinalized
3816
+ * @static
3817
+ * @param {org.dash.platform.dapi.v0.PlatformEventV0.IStateTransitionFinalized} message StateTransitionFinalized message or plain object to encode
3818
+ * @param {$protobuf.Writer} [writer] Writer to encode to
3819
+ * @returns {$protobuf.Writer} Writer
3820
+ */
3821
+ StateTransitionFinalized.encode = function encode(message, writer) {
3822
+ if (!writer)
3823
+ writer = $Writer.create();
3824
+ if (message.meta != null && Object.hasOwnProperty.call(message, "meta"))
3825
+ $root.org.dash.platform.dapi.v0.PlatformEventV0.BlockMetadata.encode(message.meta, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
3826
+ if (message.txHash != null && Object.hasOwnProperty.call(message, "txHash"))
3827
+ writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.txHash);
3828
+ return writer;
3829
+ };
3830
+
3831
+ /**
3832
+ * Encodes the specified StateTransitionFinalized message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.PlatformEventV0.StateTransitionFinalized.verify|verify} messages.
3833
+ * @function encodeDelimited
3834
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0.StateTransitionFinalized
3835
+ * @static
3836
+ * @param {org.dash.platform.dapi.v0.PlatformEventV0.IStateTransitionFinalized} message StateTransitionFinalized message or plain object to encode
3837
+ * @param {$protobuf.Writer} [writer] Writer to encode to
3838
+ * @returns {$protobuf.Writer} Writer
3839
+ */
3840
+ StateTransitionFinalized.encodeDelimited = function encodeDelimited(message, writer) {
3841
+ return this.encode(message, writer).ldelim();
3842
+ };
3843
+
3844
+ /**
3845
+ * Decodes a StateTransitionFinalized message from the specified reader or buffer.
3846
+ * @function decode
3847
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0.StateTransitionFinalized
3848
+ * @static
3849
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
3850
+ * @param {number} [length] Message length if known beforehand
3851
+ * @returns {org.dash.platform.dapi.v0.PlatformEventV0.StateTransitionFinalized} StateTransitionFinalized
3852
+ * @throws {Error} If the payload is not a reader or valid buffer
3853
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
3854
+ */
3855
+ StateTransitionFinalized.decode = function decode(reader, length) {
3856
+ if (!(reader instanceof $Reader))
3857
+ reader = $Reader.create(reader);
3858
+ var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.PlatformEventV0.StateTransitionFinalized();
3859
+ while (reader.pos < end) {
3860
+ var tag = reader.uint32();
3861
+ switch (tag >>> 3) {
3862
+ case 1:
3863
+ message.meta = $root.org.dash.platform.dapi.v0.PlatformEventV0.BlockMetadata.decode(reader, reader.uint32());
3864
+ break;
3865
+ case 2:
3866
+ message.txHash = reader.bytes();
3867
+ break;
3868
+ default:
3869
+ reader.skipType(tag & 7);
3870
+ break;
3871
+ }
3872
+ }
3873
+ return message;
3874
+ };
3875
+
3876
+ /**
3877
+ * Decodes a StateTransitionFinalized message from the specified reader or buffer, length delimited.
3878
+ * @function decodeDelimited
3879
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0.StateTransitionFinalized
3880
+ * @static
3881
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
3882
+ * @returns {org.dash.platform.dapi.v0.PlatformEventV0.StateTransitionFinalized} StateTransitionFinalized
3883
+ * @throws {Error} If the payload is not a reader or valid buffer
3884
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
3885
+ */
3886
+ StateTransitionFinalized.decodeDelimited = function decodeDelimited(reader) {
3887
+ if (!(reader instanceof $Reader))
3888
+ reader = new $Reader(reader);
3889
+ return this.decode(reader, reader.uint32());
3890
+ };
3891
+
3892
+ /**
3893
+ * Verifies a StateTransitionFinalized message.
3894
+ * @function verify
3895
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0.StateTransitionFinalized
3896
+ * @static
3897
+ * @param {Object.<string,*>} message Plain object to verify
3898
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
3899
+ */
3900
+ StateTransitionFinalized.verify = function verify(message) {
3901
+ if (typeof message !== "object" || message === null)
3902
+ return "object expected";
3903
+ if (message.meta != null && message.hasOwnProperty("meta")) {
3904
+ var error = $root.org.dash.platform.dapi.v0.PlatformEventV0.BlockMetadata.verify(message.meta);
3905
+ if (error)
3906
+ return "meta." + error;
3907
+ }
3908
+ if (message.txHash != null && message.hasOwnProperty("txHash"))
3909
+ if (!(message.txHash && typeof message.txHash.length === "number" || $util.isString(message.txHash)))
3910
+ return "txHash: buffer expected";
3911
+ return null;
3912
+ };
3913
+
3914
+ /**
3915
+ * Creates a StateTransitionFinalized message from a plain object. Also converts values to their respective internal types.
3916
+ * @function fromObject
3917
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0.StateTransitionFinalized
3918
+ * @static
3919
+ * @param {Object.<string,*>} object Plain object
3920
+ * @returns {org.dash.platform.dapi.v0.PlatformEventV0.StateTransitionFinalized} StateTransitionFinalized
3921
+ */
3922
+ StateTransitionFinalized.fromObject = function fromObject(object) {
3923
+ if (object instanceof $root.org.dash.platform.dapi.v0.PlatformEventV0.StateTransitionFinalized)
3924
+ return object;
3925
+ var message = new $root.org.dash.platform.dapi.v0.PlatformEventV0.StateTransitionFinalized();
3926
+ if (object.meta != null) {
3927
+ if (typeof object.meta !== "object")
3928
+ throw TypeError(".org.dash.platform.dapi.v0.PlatformEventV0.StateTransitionFinalized.meta: object expected");
3929
+ message.meta = $root.org.dash.platform.dapi.v0.PlatformEventV0.BlockMetadata.fromObject(object.meta);
3930
+ }
3931
+ if (object.txHash != null)
3932
+ if (typeof object.txHash === "string")
3933
+ $util.base64.decode(object.txHash, message.txHash = $util.newBuffer($util.base64.length(object.txHash)), 0);
3934
+ else if (object.txHash.length >= 0)
3935
+ message.txHash = object.txHash;
3936
+ return message;
3937
+ };
3938
+
3939
+ /**
3940
+ * Creates a plain object from a StateTransitionFinalized message. Also converts values to other types if specified.
3941
+ * @function toObject
3942
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0.StateTransitionFinalized
3943
+ * @static
3944
+ * @param {org.dash.platform.dapi.v0.PlatformEventV0.StateTransitionFinalized} message StateTransitionFinalized
3945
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
3946
+ * @returns {Object.<string,*>} Plain object
3947
+ */
3948
+ StateTransitionFinalized.toObject = function toObject(message, options) {
3949
+ if (!options)
3950
+ options = {};
3951
+ var object = {};
3952
+ if (options.defaults) {
3953
+ object.meta = null;
3954
+ if (options.bytes === String)
3955
+ object.txHash = "";
3956
+ else {
3957
+ object.txHash = [];
3958
+ if (options.bytes !== Array)
3959
+ object.txHash = $util.newBuffer(object.txHash);
3960
+ }
3961
+ }
3962
+ if (message.meta != null && message.hasOwnProperty("meta"))
3963
+ object.meta = $root.org.dash.platform.dapi.v0.PlatformEventV0.BlockMetadata.toObject(message.meta, options);
3964
+ if (message.txHash != null && message.hasOwnProperty("txHash"))
3965
+ object.txHash = options.bytes === String ? $util.base64.encode(message.txHash, 0, message.txHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.txHash) : message.txHash;
3966
+ return object;
3967
+ };
3968
+
3969
+ /**
3970
+ * Converts this StateTransitionFinalized to JSON.
3971
+ * @function toJSON
3972
+ * @memberof org.dash.platform.dapi.v0.PlatformEventV0.StateTransitionFinalized
3973
+ * @instance
3974
+ * @returns {Object.<string,*>} JSON object
3975
+ */
3976
+ StateTransitionFinalized.prototype.toJSON = function toJSON() {
3977
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
3978
+ };
3979
+
3980
+ return StateTransitionFinalized;
3981
+ })();
3982
+
3983
+ return PlatformEventV0;
3984
+ })();
3985
+
565
3986
  v0.Platform = (function() {
566
3987
 
567
3988
  /**
@@ -2145,6 +5566,39 @@ $root.org = (function() {
2145
5566
  * @variation 2
2146
5567
  */
2147
5568
 
5569
+ /**
5570
+ * Callback as used by {@link org.dash.platform.dapi.v0.Platform#subscribePlatformEvents}.
5571
+ * @memberof org.dash.platform.dapi.v0.Platform
5572
+ * @typedef SubscribePlatformEventsCallback
5573
+ * @type {function}
5574
+ * @param {Error|null} error Error, if any
5575
+ * @param {org.dash.platform.dapi.v0.PlatformEventsResponse} [response] PlatformEventsResponse
5576
+ */
5577
+
5578
+ /**
5579
+ * Calls SubscribePlatformEvents.
5580
+ * @function subscribePlatformEvents
5581
+ * @memberof org.dash.platform.dapi.v0.Platform
5582
+ * @instance
5583
+ * @param {org.dash.platform.dapi.v0.IPlatformEventsCommand} request PlatformEventsCommand message or plain object
5584
+ * @param {org.dash.platform.dapi.v0.Platform.SubscribePlatformEventsCallback} callback Node-style callback called with the error, if any, and PlatformEventsResponse
5585
+ * @returns {undefined}
5586
+ * @variation 1
5587
+ */
5588
+ Object.defineProperty(Platform.prototype.subscribePlatformEvents = function subscribePlatformEvents(request, callback) {
5589
+ return this.rpcCall(subscribePlatformEvents, $root.org.dash.platform.dapi.v0.PlatformEventsCommand, $root.org.dash.platform.dapi.v0.PlatformEventsResponse, request, callback);
5590
+ }, "name", { value: "SubscribePlatformEvents" });
5591
+
5592
+ /**
5593
+ * Calls SubscribePlatformEvents.
5594
+ * @function subscribePlatformEvents
5595
+ * @memberof org.dash.platform.dapi.v0.Platform
5596
+ * @instance
5597
+ * @param {org.dash.platform.dapi.v0.IPlatformEventsCommand} request PlatformEventsCommand message or plain object
5598
+ * @returns {Promise<org.dash.platform.dapi.v0.PlatformEventsResponse>} Promise
5599
+ * @variation 2
5600
+ */
5601
+
2148
5602
  return Platform;
2149
5603
  })();
2150
5604