dash-platform-sdk 1.5.0-dev.1 → 1.5.0-dev.3

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.
@@ -10644,6 +10644,497 @@ class GetShieldedNullifiersResponse_GetShieldedNullifiersResponseV0_NullifierSta
10644
10644
  * @generated MessageType for protobuf message org.dash.platform.dapi.v0.GetShieldedNullifiersResponse.GetShieldedNullifiersResponseV0.NullifierStatuses
10645
10645
  */
10646
10646
  export const GetShieldedNullifiersResponse_GetShieldedNullifiersResponseV0_NullifierStatuses = new GetShieldedNullifiersResponse_GetShieldedNullifiersResponseV0_NullifierStatuses$Type();
10647
+ // @generated message type with reflection information, may provide speed optimized methods
10648
+ class GetFinalizedEpochInfosRequest$Type extends MessageType {
10649
+ constructor() {
10650
+ super("org.dash.platform.dapi.v0.GetFinalizedEpochInfosRequest", [
10651
+ { no: 1, name: "v0", kind: "message", oneof: "version", T: () => GetFinalizedEpochInfosRequest_GetFinalizedEpochInfosRequestV0 }
10652
+ ]);
10653
+ }
10654
+ create(value) {
10655
+ const message = globalThis.Object.create((this.messagePrototype));
10656
+ message.version = { oneofKind: undefined };
10657
+ if (value !== undefined)
10658
+ reflectionMergePartial(this, message, value);
10659
+ return message;
10660
+ }
10661
+ internalBinaryRead(reader, length, options, target) {
10662
+ let message = target ?? this.create(), end = reader.pos + length;
10663
+ while (reader.pos < end) {
10664
+ let [fieldNo, wireType] = reader.tag();
10665
+ switch (fieldNo) {
10666
+ case /* org.dash.platform.dapi.v0.GetFinalizedEpochInfosRequest.GetFinalizedEpochInfosRequestV0 v0 */ 1:
10667
+ message.version = {
10668
+ oneofKind: "v0",
10669
+ v0: GetFinalizedEpochInfosRequest_GetFinalizedEpochInfosRequestV0.internalBinaryRead(reader, reader.uint32(), options, message.version.v0)
10670
+ };
10671
+ break;
10672
+ default:
10673
+ let u = options.readUnknownField;
10674
+ if (u === "throw")
10675
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
10676
+ let d = reader.skip(wireType);
10677
+ if (u !== false)
10678
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
10679
+ }
10680
+ }
10681
+ return message;
10682
+ }
10683
+ internalBinaryWrite(message, writer, options) {
10684
+ /* org.dash.platform.dapi.v0.GetFinalizedEpochInfosRequest.GetFinalizedEpochInfosRequestV0 v0 = 1; */
10685
+ if (message.version.oneofKind === "v0")
10686
+ GetFinalizedEpochInfosRequest_GetFinalizedEpochInfosRequestV0.internalBinaryWrite(message.version.v0, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
10687
+ let u = options.writeUnknownFields;
10688
+ if (u !== false)
10689
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
10690
+ return writer;
10691
+ }
10692
+ }
10693
+ /**
10694
+ * @generated MessageType for protobuf message org.dash.platform.dapi.v0.GetFinalizedEpochInfosRequest
10695
+ */
10696
+ export const GetFinalizedEpochInfosRequest = new GetFinalizedEpochInfosRequest$Type();
10697
+ // @generated message type with reflection information, may provide speed optimized methods
10698
+ class GetFinalizedEpochInfosRequest_GetFinalizedEpochInfosRequestV0$Type extends MessageType {
10699
+ constructor() {
10700
+ super("org.dash.platform.dapi.v0.GetFinalizedEpochInfosRequest.GetFinalizedEpochInfosRequestV0", [
10701
+ { no: 1, name: "start_epoch_index", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
10702
+ { no: 2, name: "start_epoch_index_included", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
10703
+ { no: 3, name: "end_epoch_index", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
10704
+ { no: 4, name: "end_epoch_index_included", kind: "scalar", T: 8 /*ScalarType.BOOL*/ },
10705
+ { no: 5, name: "prove", kind: "scalar", T: 8 /*ScalarType.BOOL*/ }
10706
+ ]);
10707
+ }
10708
+ create(value) {
10709
+ const message = globalThis.Object.create((this.messagePrototype));
10710
+ message.startEpochIndex = 0;
10711
+ message.startEpochIndexIncluded = false;
10712
+ message.endEpochIndex = 0;
10713
+ message.endEpochIndexIncluded = false;
10714
+ message.prove = false;
10715
+ if (value !== undefined)
10716
+ reflectionMergePartial(this, message, value);
10717
+ return message;
10718
+ }
10719
+ internalBinaryRead(reader, length, options, target) {
10720
+ let message = target ?? this.create(), end = reader.pos + length;
10721
+ while (reader.pos < end) {
10722
+ let [fieldNo, wireType] = reader.tag();
10723
+ switch (fieldNo) {
10724
+ case /* uint32 start_epoch_index */ 1:
10725
+ message.startEpochIndex = reader.uint32();
10726
+ break;
10727
+ case /* bool start_epoch_index_included */ 2:
10728
+ message.startEpochIndexIncluded = reader.bool();
10729
+ break;
10730
+ case /* uint32 end_epoch_index */ 3:
10731
+ message.endEpochIndex = reader.uint32();
10732
+ break;
10733
+ case /* bool end_epoch_index_included */ 4:
10734
+ message.endEpochIndexIncluded = reader.bool();
10735
+ break;
10736
+ case /* bool prove */ 5:
10737
+ message.prove = reader.bool();
10738
+ break;
10739
+ default:
10740
+ let u = options.readUnknownField;
10741
+ if (u === "throw")
10742
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
10743
+ let d = reader.skip(wireType);
10744
+ if (u !== false)
10745
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
10746
+ }
10747
+ }
10748
+ return message;
10749
+ }
10750
+ internalBinaryWrite(message, writer, options) {
10751
+ /* uint32 start_epoch_index = 1; */
10752
+ if (message.startEpochIndex !== 0)
10753
+ writer.tag(1, WireType.Varint).uint32(message.startEpochIndex);
10754
+ /* bool start_epoch_index_included = 2; */
10755
+ if (message.startEpochIndexIncluded !== false)
10756
+ writer.tag(2, WireType.Varint).bool(message.startEpochIndexIncluded);
10757
+ /* uint32 end_epoch_index = 3; */
10758
+ if (message.endEpochIndex !== 0)
10759
+ writer.tag(3, WireType.Varint).uint32(message.endEpochIndex);
10760
+ /* bool end_epoch_index_included = 4; */
10761
+ if (message.endEpochIndexIncluded !== false)
10762
+ writer.tag(4, WireType.Varint).bool(message.endEpochIndexIncluded);
10763
+ /* bool prove = 5; */
10764
+ if (message.prove !== false)
10765
+ writer.tag(5, WireType.Varint).bool(message.prove);
10766
+ let u = options.writeUnknownFields;
10767
+ if (u !== false)
10768
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
10769
+ return writer;
10770
+ }
10771
+ }
10772
+ /**
10773
+ * @generated MessageType for protobuf message org.dash.platform.dapi.v0.GetFinalizedEpochInfosRequest.GetFinalizedEpochInfosRequestV0
10774
+ */
10775
+ export const GetFinalizedEpochInfosRequest_GetFinalizedEpochInfosRequestV0 = new GetFinalizedEpochInfosRequest_GetFinalizedEpochInfosRequestV0$Type();
10776
+ // @generated message type with reflection information, may provide speed optimized methods
10777
+ class GetFinalizedEpochInfosResponse$Type extends MessageType {
10778
+ constructor() {
10779
+ super("org.dash.platform.dapi.v0.GetFinalizedEpochInfosResponse", [
10780
+ { no: 1, name: "v0", kind: "message", oneof: "version", T: () => GetFinalizedEpochInfosResponse_GetFinalizedEpochInfosResponseV0 }
10781
+ ]);
10782
+ }
10783
+ create(value) {
10784
+ const message = globalThis.Object.create((this.messagePrototype));
10785
+ message.version = { oneofKind: undefined };
10786
+ if (value !== undefined)
10787
+ reflectionMergePartial(this, message, value);
10788
+ return message;
10789
+ }
10790
+ internalBinaryRead(reader, length, options, target) {
10791
+ let message = target ?? this.create(), end = reader.pos + length;
10792
+ while (reader.pos < end) {
10793
+ let [fieldNo, wireType] = reader.tag();
10794
+ switch (fieldNo) {
10795
+ case /* org.dash.platform.dapi.v0.GetFinalizedEpochInfosResponse.GetFinalizedEpochInfosResponseV0 v0 */ 1:
10796
+ message.version = {
10797
+ oneofKind: "v0",
10798
+ v0: GetFinalizedEpochInfosResponse_GetFinalizedEpochInfosResponseV0.internalBinaryRead(reader, reader.uint32(), options, message.version.v0)
10799
+ };
10800
+ break;
10801
+ default:
10802
+ let u = options.readUnknownField;
10803
+ if (u === "throw")
10804
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
10805
+ let d = reader.skip(wireType);
10806
+ if (u !== false)
10807
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
10808
+ }
10809
+ }
10810
+ return message;
10811
+ }
10812
+ internalBinaryWrite(message, writer, options) {
10813
+ /* org.dash.platform.dapi.v0.GetFinalizedEpochInfosResponse.GetFinalizedEpochInfosResponseV0 v0 = 1; */
10814
+ if (message.version.oneofKind === "v0")
10815
+ GetFinalizedEpochInfosResponse_GetFinalizedEpochInfosResponseV0.internalBinaryWrite(message.version.v0, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
10816
+ let u = options.writeUnknownFields;
10817
+ if (u !== false)
10818
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
10819
+ return writer;
10820
+ }
10821
+ }
10822
+ /**
10823
+ * @generated MessageType for protobuf message org.dash.platform.dapi.v0.GetFinalizedEpochInfosResponse
10824
+ */
10825
+ export const GetFinalizedEpochInfosResponse = new GetFinalizedEpochInfosResponse$Type();
10826
+ // @generated message type with reflection information, may provide speed optimized methods
10827
+ class GetFinalizedEpochInfosResponse_GetFinalizedEpochInfosResponseV0$Type extends MessageType {
10828
+ constructor() {
10829
+ super("org.dash.platform.dapi.v0.GetFinalizedEpochInfosResponse.GetFinalizedEpochInfosResponseV0", [
10830
+ { no: 1, name: "epochs", kind: "message", oneof: "result", T: () => GetFinalizedEpochInfosResponse_GetFinalizedEpochInfosResponseV0_FinalizedEpochInfos },
10831
+ { no: 2, name: "proof", kind: "message", oneof: "result", T: () => Proof },
10832
+ { no: 3, name: "metadata", kind: "message", T: () => ResponseMetadata }
10833
+ ]);
10834
+ }
10835
+ create(value) {
10836
+ const message = globalThis.Object.create((this.messagePrototype));
10837
+ message.result = { oneofKind: undefined };
10838
+ if (value !== undefined)
10839
+ reflectionMergePartial(this, message, value);
10840
+ return message;
10841
+ }
10842
+ internalBinaryRead(reader, length, options, target) {
10843
+ let message = target ?? this.create(), end = reader.pos + length;
10844
+ while (reader.pos < end) {
10845
+ let [fieldNo, wireType] = reader.tag();
10846
+ switch (fieldNo) {
10847
+ case /* org.dash.platform.dapi.v0.GetFinalizedEpochInfosResponse.GetFinalizedEpochInfosResponseV0.FinalizedEpochInfos epochs */ 1:
10848
+ message.result = {
10849
+ oneofKind: "epochs",
10850
+ epochs: GetFinalizedEpochInfosResponse_GetFinalizedEpochInfosResponseV0_FinalizedEpochInfos.internalBinaryRead(reader, reader.uint32(), options, message.result.epochs)
10851
+ };
10852
+ break;
10853
+ case /* org.dash.platform.dapi.v0.Proof proof */ 2:
10854
+ message.result = {
10855
+ oneofKind: "proof",
10856
+ proof: Proof.internalBinaryRead(reader, reader.uint32(), options, message.result.proof)
10857
+ };
10858
+ break;
10859
+ case /* org.dash.platform.dapi.v0.ResponseMetadata metadata */ 3:
10860
+ message.metadata = ResponseMetadata.internalBinaryRead(reader, reader.uint32(), options, message.metadata);
10861
+ break;
10862
+ default:
10863
+ let u = options.readUnknownField;
10864
+ if (u === "throw")
10865
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
10866
+ let d = reader.skip(wireType);
10867
+ if (u !== false)
10868
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
10869
+ }
10870
+ }
10871
+ return message;
10872
+ }
10873
+ internalBinaryWrite(message, writer, options) {
10874
+ /* org.dash.platform.dapi.v0.GetFinalizedEpochInfosResponse.GetFinalizedEpochInfosResponseV0.FinalizedEpochInfos epochs = 1; */
10875
+ if (message.result.oneofKind === "epochs")
10876
+ GetFinalizedEpochInfosResponse_GetFinalizedEpochInfosResponseV0_FinalizedEpochInfos.internalBinaryWrite(message.result.epochs, writer.tag(1, WireType.LengthDelimited).fork(), options).join();
10877
+ /* org.dash.platform.dapi.v0.Proof proof = 2; */
10878
+ if (message.result.oneofKind === "proof")
10879
+ Proof.internalBinaryWrite(message.result.proof, writer.tag(2, WireType.LengthDelimited).fork(), options).join();
10880
+ /* org.dash.platform.dapi.v0.ResponseMetadata metadata = 3; */
10881
+ if (message.metadata)
10882
+ ResponseMetadata.internalBinaryWrite(message.metadata, writer.tag(3, WireType.LengthDelimited).fork(), options).join();
10883
+ let u = options.writeUnknownFields;
10884
+ if (u !== false)
10885
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
10886
+ return writer;
10887
+ }
10888
+ }
10889
+ /**
10890
+ * @generated MessageType for protobuf message org.dash.platform.dapi.v0.GetFinalizedEpochInfosResponse.GetFinalizedEpochInfosResponseV0
10891
+ */
10892
+ export const GetFinalizedEpochInfosResponse_GetFinalizedEpochInfosResponseV0 = new GetFinalizedEpochInfosResponse_GetFinalizedEpochInfosResponseV0$Type();
10893
+ // @generated message type with reflection information, may provide speed optimized methods
10894
+ class GetFinalizedEpochInfosResponse_GetFinalizedEpochInfosResponseV0_FinalizedEpochInfos$Type extends MessageType {
10895
+ constructor() {
10896
+ super("org.dash.platform.dapi.v0.GetFinalizedEpochInfosResponse.GetFinalizedEpochInfosResponseV0.FinalizedEpochInfos", [
10897
+ { no: 1, name: "finalized_epoch_infos", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => GetFinalizedEpochInfosResponse_GetFinalizedEpochInfosResponseV0_FinalizedEpochInfo }
10898
+ ]);
10899
+ }
10900
+ create(value) {
10901
+ const message = globalThis.Object.create((this.messagePrototype));
10902
+ message.finalizedEpochInfos = [];
10903
+ if (value !== undefined)
10904
+ reflectionMergePartial(this, message, value);
10905
+ return message;
10906
+ }
10907
+ internalBinaryRead(reader, length, options, target) {
10908
+ let message = target ?? this.create(), end = reader.pos + length;
10909
+ while (reader.pos < end) {
10910
+ let [fieldNo, wireType] = reader.tag();
10911
+ switch (fieldNo) {
10912
+ case /* repeated org.dash.platform.dapi.v0.GetFinalizedEpochInfosResponse.GetFinalizedEpochInfosResponseV0.FinalizedEpochInfo finalized_epoch_infos */ 1:
10913
+ message.finalizedEpochInfos.push(GetFinalizedEpochInfosResponse_GetFinalizedEpochInfosResponseV0_FinalizedEpochInfo.internalBinaryRead(reader, reader.uint32(), options));
10914
+ break;
10915
+ default:
10916
+ let u = options.readUnknownField;
10917
+ if (u === "throw")
10918
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
10919
+ let d = reader.skip(wireType);
10920
+ if (u !== false)
10921
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
10922
+ }
10923
+ }
10924
+ return message;
10925
+ }
10926
+ internalBinaryWrite(message, writer, options) {
10927
+ /* repeated org.dash.platform.dapi.v0.GetFinalizedEpochInfosResponse.GetFinalizedEpochInfosResponseV0.FinalizedEpochInfo finalized_epoch_infos = 1; */
10928
+ for (let i = 0; i < message.finalizedEpochInfos.length; i++)
10929
+ GetFinalizedEpochInfosResponse_GetFinalizedEpochInfosResponseV0_FinalizedEpochInfo.internalBinaryWrite(message.finalizedEpochInfos[i], writer.tag(1, WireType.LengthDelimited).fork(), options).join();
10930
+ let u = options.writeUnknownFields;
10931
+ if (u !== false)
10932
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
10933
+ return writer;
10934
+ }
10935
+ }
10936
+ /**
10937
+ * @generated MessageType for protobuf message org.dash.platform.dapi.v0.GetFinalizedEpochInfosResponse.GetFinalizedEpochInfosResponseV0.FinalizedEpochInfos
10938
+ */
10939
+ export const GetFinalizedEpochInfosResponse_GetFinalizedEpochInfosResponseV0_FinalizedEpochInfos = new GetFinalizedEpochInfosResponse_GetFinalizedEpochInfosResponseV0_FinalizedEpochInfos$Type();
10940
+ // @generated message type with reflection information, may provide speed optimized methods
10941
+ class GetFinalizedEpochInfosResponse_GetFinalizedEpochInfosResponseV0_FinalizedEpochInfo$Type extends MessageType {
10942
+ constructor() {
10943
+ super("org.dash.platform.dapi.v0.GetFinalizedEpochInfosResponse.GetFinalizedEpochInfosResponseV0.FinalizedEpochInfo", [
10944
+ { no: 1, name: "number", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
10945
+ { no: 2, name: "first_block_height", kind: "scalar", T: 4 /*ScalarType.UINT64*/ },
10946
+ { no: 3, name: "first_core_block_height", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
10947
+ { no: 4, name: "first_block_time", kind: "scalar", T: 4 /*ScalarType.UINT64*/ },
10948
+ { no: 5, name: "fee_multiplier", kind: "scalar", T: 1 /*ScalarType.DOUBLE*/ },
10949
+ { no: 6, name: "protocol_version", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
10950
+ { no: 7, name: "total_blocks_in_epoch", kind: "scalar", T: 4 /*ScalarType.UINT64*/ },
10951
+ { no: 8, name: "next_epoch_start_core_block_height", kind: "scalar", T: 13 /*ScalarType.UINT32*/ },
10952
+ { no: 9, name: "total_processing_fees", kind: "scalar", T: 4 /*ScalarType.UINT64*/ },
10953
+ { no: 10, name: "total_distributed_storage_fees", kind: "scalar", T: 4 /*ScalarType.UINT64*/ },
10954
+ { no: 11, name: "total_created_storage_fees", kind: "scalar", T: 4 /*ScalarType.UINT64*/ },
10955
+ { no: 12, name: "core_block_rewards", kind: "scalar", T: 4 /*ScalarType.UINT64*/ },
10956
+ { no: 13, name: "block_proposers", kind: "message", repeat: 2 /*RepeatType.UNPACKED*/, T: () => GetFinalizedEpochInfosResponse_GetFinalizedEpochInfosResponseV0_BlockProposer }
10957
+ ]);
10958
+ }
10959
+ create(value) {
10960
+ const message = globalThis.Object.create((this.messagePrototype));
10961
+ message.number = 0;
10962
+ message.firstBlockHeight = "0";
10963
+ message.firstCoreBlockHeight = 0;
10964
+ message.firstBlockTime = "0";
10965
+ message.feeMultiplier = 0;
10966
+ message.protocolVersion = 0;
10967
+ message.totalBlocksInEpoch = "0";
10968
+ message.nextEpochStartCoreBlockHeight = 0;
10969
+ message.totalProcessingFees = "0";
10970
+ message.totalDistributedStorageFees = "0";
10971
+ message.totalCreatedStorageFees = "0";
10972
+ message.coreBlockRewards = "0";
10973
+ message.blockProposers = [];
10974
+ if (value !== undefined)
10975
+ reflectionMergePartial(this, message, value);
10976
+ return message;
10977
+ }
10978
+ internalBinaryRead(reader, length, options, target) {
10979
+ let message = target ?? this.create(), end = reader.pos + length;
10980
+ while (reader.pos < end) {
10981
+ let [fieldNo, wireType] = reader.tag();
10982
+ switch (fieldNo) {
10983
+ case /* uint32 number */ 1:
10984
+ message.number = reader.uint32();
10985
+ break;
10986
+ case /* uint64 first_block_height = 2 [jstype = JS_STRING] */ 2:
10987
+ message.firstBlockHeight = reader.uint64().toString();
10988
+ break;
10989
+ case /* uint32 first_core_block_height */ 3:
10990
+ message.firstCoreBlockHeight = reader.uint32();
10991
+ break;
10992
+ case /* uint64 first_block_time = 4 [jstype = JS_STRING] */ 4:
10993
+ message.firstBlockTime = reader.uint64().toString();
10994
+ break;
10995
+ case /* double fee_multiplier */ 5:
10996
+ message.feeMultiplier = reader.double();
10997
+ break;
10998
+ case /* uint32 protocol_version */ 6:
10999
+ message.protocolVersion = reader.uint32();
11000
+ break;
11001
+ case /* uint64 total_blocks_in_epoch = 7 [jstype = JS_STRING] */ 7:
11002
+ message.totalBlocksInEpoch = reader.uint64().toString();
11003
+ break;
11004
+ case /* uint32 next_epoch_start_core_block_height */ 8:
11005
+ message.nextEpochStartCoreBlockHeight = reader.uint32();
11006
+ break;
11007
+ case /* uint64 total_processing_fees = 9 [jstype = JS_STRING] */ 9:
11008
+ message.totalProcessingFees = reader.uint64().toString();
11009
+ break;
11010
+ case /* uint64 total_distributed_storage_fees = 10 [jstype = JS_STRING] */ 10:
11011
+ message.totalDistributedStorageFees = reader.uint64().toString();
11012
+ break;
11013
+ case /* uint64 total_created_storage_fees = 11 [jstype = JS_STRING] */ 11:
11014
+ message.totalCreatedStorageFees = reader.uint64().toString();
11015
+ break;
11016
+ case /* uint64 core_block_rewards = 12 [jstype = JS_STRING] */ 12:
11017
+ message.coreBlockRewards = reader.uint64().toString();
11018
+ break;
11019
+ case /* repeated org.dash.platform.dapi.v0.GetFinalizedEpochInfosResponse.GetFinalizedEpochInfosResponseV0.BlockProposer block_proposers */ 13:
11020
+ message.blockProposers.push(GetFinalizedEpochInfosResponse_GetFinalizedEpochInfosResponseV0_BlockProposer.internalBinaryRead(reader, reader.uint32(), options));
11021
+ break;
11022
+ default:
11023
+ let u = options.readUnknownField;
11024
+ if (u === "throw")
11025
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
11026
+ let d = reader.skip(wireType);
11027
+ if (u !== false)
11028
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
11029
+ }
11030
+ }
11031
+ return message;
11032
+ }
11033
+ internalBinaryWrite(message, writer, options) {
11034
+ /* uint32 number = 1; */
11035
+ if (message.number !== 0)
11036
+ writer.tag(1, WireType.Varint).uint32(message.number);
11037
+ /* uint64 first_block_height = 2 [jstype = JS_STRING]; */
11038
+ if (message.firstBlockHeight !== "0")
11039
+ writer.tag(2, WireType.Varint).uint64(message.firstBlockHeight);
11040
+ /* uint32 first_core_block_height = 3; */
11041
+ if (message.firstCoreBlockHeight !== 0)
11042
+ writer.tag(3, WireType.Varint).uint32(message.firstCoreBlockHeight);
11043
+ /* uint64 first_block_time = 4 [jstype = JS_STRING]; */
11044
+ if (message.firstBlockTime !== "0")
11045
+ writer.tag(4, WireType.Varint).uint64(message.firstBlockTime);
11046
+ /* double fee_multiplier = 5; */
11047
+ if (message.feeMultiplier !== 0)
11048
+ writer.tag(5, WireType.Bit64).double(message.feeMultiplier);
11049
+ /* uint32 protocol_version = 6; */
11050
+ if (message.protocolVersion !== 0)
11051
+ writer.tag(6, WireType.Varint).uint32(message.protocolVersion);
11052
+ /* uint64 total_blocks_in_epoch = 7 [jstype = JS_STRING]; */
11053
+ if (message.totalBlocksInEpoch !== "0")
11054
+ writer.tag(7, WireType.Varint).uint64(message.totalBlocksInEpoch);
11055
+ /* uint32 next_epoch_start_core_block_height = 8; */
11056
+ if (message.nextEpochStartCoreBlockHeight !== 0)
11057
+ writer.tag(8, WireType.Varint).uint32(message.nextEpochStartCoreBlockHeight);
11058
+ /* uint64 total_processing_fees = 9 [jstype = JS_STRING]; */
11059
+ if (message.totalProcessingFees !== "0")
11060
+ writer.tag(9, WireType.Varint).uint64(message.totalProcessingFees);
11061
+ /* uint64 total_distributed_storage_fees = 10 [jstype = JS_STRING]; */
11062
+ if (message.totalDistributedStorageFees !== "0")
11063
+ writer.tag(10, WireType.Varint).uint64(message.totalDistributedStorageFees);
11064
+ /* uint64 total_created_storage_fees = 11 [jstype = JS_STRING]; */
11065
+ if (message.totalCreatedStorageFees !== "0")
11066
+ writer.tag(11, WireType.Varint).uint64(message.totalCreatedStorageFees);
11067
+ /* uint64 core_block_rewards = 12 [jstype = JS_STRING]; */
11068
+ if (message.coreBlockRewards !== "0")
11069
+ writer.tag(12, WireType.Varint).uint64(message.coreBlockRewards);
11070
+ /* repeated org.dash.platform.dapi.v0.GetFinalizedEpochInfosResponse.GetFinalizedEpochInfosResponseV0.BlockProposer block_proposers = 13; */
11071
+ for (let i = 0; i < message.blockProposers.length; i++)
11072
+ GetFinalizedEpochInfosResponse_GetFinalizedEpochInfosResponseV0_BlockProposer.internalBinaryWrite(message.blockProposers[i], writer.tag(13, WireType.LengthDelimited).fork(), options).join();
11073
+ let u = options.writeUnknownFields;
11074
+ if (u !== false)
11075
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
11076
+ return writer;
11077
+ }
11078
+ }
11079
+ /**
11080
+ * @generated MessageType for protobuf message org.dash.platform.dapi.v0.GetFinalizedEpochInfosResponse.GetFinalizedEpochInfosResponseV0.FinalizedEpochInfo
11081
+ */
11082
+ export const GetFinalizedEpochInfosResponse_GetFinalizedEpochInfosResponseV0_FinalizedEpochInfo = new GetFinalizedEpochInfosResponse_GetFinalizedEpochInfosResponseV0_FinalizedEpochInfo$Type();
11083
+ // @generated message type with reflection information, may provide speed optimized methods
11084
+ class GetFinalizedEpochInfosResponse_GetFinalizedEpochInfosResponseV0_BlockProposer$Type extends MessageType {
11085
+ constructor() {
11086
+ super("org.dash.platform.dapi.v0.GetFinalizedEpochInfosResponse.GetFinalizedEpochInfosResponseV0.BlockProposer", [
11087
+ { no: 1, name: "proposer_id", kind: "scalar", T: 12 /*ScalarType.BYTES*/ },
11088
+ { no: 2, name: "block_count", kind: "scalar", T: 13 /*ScalarType.UINT32*/ }
11089
+ ]);
11090
+ }
11091
+ create(value) {
11092
+ const message = globalThis.Object.create((this.messagePrototype));
11093
+ message.proposerId = new Uint8Array(0);
11094
+ message.blockCount = 0;
11095
+ if (value !== undefined)
11096
+ reflectionMergePartial(this, message, value);
11097
+ return message;
11098
+ }
11099
+ internalBinaryRead(reader, length, options, target) {
11100
+ let message = target ?? this.create(), end = reader.pos + length;
11101
+ while (reader.pos < end) {
11102
+ let [fieldNo, wireType] = reader.tag();
11103
+ switch (fieldNo) {
11104
+ case /* bytes proposer_id */ 1:
11105
+ message.proposerId = reader.bytes();
11106
+ break;
11107
+ case /* uint32 block_count */ 2:
11108
+ message.blockCount = reader.uint32();
11109
+ break;
11110
+ default:
11111
+ let u = options.readUnknownField;
11112
+ if (u === "throw")
11113
+ throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
11114
+ let d = reader.skip(wireType);
11115
+ if (u !== false)
11116
+ (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
11117
+ }
11118
+ }
11119
+ return message;
11120
+ }
11121
+ internalBinaryWrite(message, writer, options) {
11122
+ /* bytes proposer_id = 1; */
11123
+ if (message.proposerId.length)
11124
+ writer.tag(1, WireType.LengthDelimited).bytes(message.proposerId);
11125
+ /* uint32 block_count = 2; */
11126
+ if (message.blockCount !== 0)
11127
+ writer.tag(2, WireType.Varint).uint32(message.blockCount);
11128
+ let u = options.writeUnknownFields;
11129
+ if (u !== false)
11130
+ (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
11131
+ return writer;
11132
+ }
11133
+ }
11134
+ /**
11135
+ * @generated MessageType for protobuf message org.dash.platform.dapi.v0.GetFinalizedEpochInfosResponse.GetFinalizedEpochInfosResponseV0.BlockProposer
11136
+ */
11137
+ export const GetFinalizedEpochInfosResponse_GetFinalizedEpochInfosResponseV0_BlockProposer = new GetFinalizedEpochInfosResponse_GetFinalizedEpochInfosResponseV0_BlockProposer$Type();
10647
11138
  /**
10648
11139
  * @generated ServiceType for protobuf service org.dash.platform.dapi.v0.Platform
10649
11140
  */
@@ -10662,6 +11153,7 @@ export const Platform = new ServiceType("org.dash.platform.dapi.v0.Platform", [
10662
11153
  { name: "getIdentityByPublicKeyHash", options: {}, I: GetIdentityByPublicKeyHashRequest, O: GetIdentityByPublicKeyHashResponse },
10663
11154
  { name: "getIdentityByNonUniquePublicKeyHash", options: {}, I: GetIdentityByNonUniquePublicKeyHashRequest, O: GetIdentityByNonUniquePublicKeyHashResponse },
10664
11155
  { name: "getEpochsInfo", options: {}, I: GetEpochsInfoRequest, O: GetEpochsInfoResponse },
11156
+ { name: "getFinalizedEpochInfos", options: {}, I: GetFinalizedEpochInfosRequest, O: GetFinalizedEpochInfosResponse },
10665
11157
  { name: "getContestedResources", options: {}, I: GetContestedResourcesRequest, O: GetContestedResourcesResponse },
10666
11158
  { name: "getContestedResourceVoteState", options: {}, I: GetContestedResourceVoteStateRequest, O: GetContestedResourceVoteStateResponse },
10667
11159
  { name: "getTotalCreditsInPlatform", options: {}, I: GetTotalCreditsInPlatformRequest, O: GetTotalCreditsInPlatformResponse },
@@ -7,4 +7,4 @@ export interface EpochInfo {
7
7
  feeMultiplier: bigint;
8
8
  protocolVersion: 9;
9
9
  }
10
- export default function epochs(grpcPool: GRPCConnectionPool, count: number, ascending: boolean, start?: number): Promise<EpochInfo[]>;
10
+ export default function epochInfos(grpcPool: GRPCConnectionPool, count: number, ascending: boolean, start?: number): Promise<EpochInfo[]>;
@@ -5,7 +5,7 @@ import bytesToHex from '../utils/bytesToHex.js';
5
5
  import verifyTenderdashProof from '../utils/verifyTenderdashProof.js';
6
6
  import { UInt32Value } from '../../proto/generated/google/protobuf/wrappers.js';
7
7
  import { LATEST_PLATFORM_VERSION } from '../constants.js';
8
- export default async function epochs(grpcPool, count, ascending, start) {
8
+ export default async function epochInfos(grpcPool, count, ascending, start) {
9
9
  const getEpochsInfoRequest = GetEpochsInfoRequest.create({
10
10
  version: {
11
11
  oneofKind: 'v0',
@@ -0,0 +1,21 @@
1
+ import GRPCConnectionPool from '../grpcConnectionPool.js';
2
+ import { IdentifierWASM } from 'pshenmic-dpp';
3
+ export interface FinalizedEpochInfo {
4
+ epochIndex: number;
5
+ firstBlockTime: Date;
6
+ firstBlockHeight: bigint;
7
+ totalBlocksInEpoch: bigint;
8
+ firstCoreBlockHeight: number;
9
+ nextEpochStartCoreBlockHeight: number;
10
+ totalProcessingFees: bigint;
11
+ totalDistributedStorageFees: bigint;
12
+ totalCreatedStorageFees: bigint;
13
+ coreBlockRewards: bigint;
14
+ blockProposers: {
15
+ proposer: IdentifierWASM;
16
+ count: bigint;
17
+ }[];
18
+ feeMultiplier: bigint;
19
+ protocolVersion: number;
20
+ }
21
+ export default function getFinalizedEpochsInfo(grpcPool: GRPCConnectionPool, startEpochIndex: number, startEpochIndexIncluded: boolean, endEpochIndex: number, endEpochIndexIncluded: boolean): Promise<FinalizedEpochInfo[]>;
@@ -0,0 +1,54 @@
1
+ import { GetFinalizedEpochInfosRequest } from '../../proto/generated/platform.js';
2
+ import { verifyFinalizedEpochInfosProof } from 'pshenmic-dpp';
3
+ import { getQuorumPublicKey } from '../utils/getQuorumPublicKey.js';
4
+ import bytesToHex from '../utils/bytesToHex.js';
5
+ import verifyTenderdashProof from '../utils/verifyTenderdashProof.js';
6
+ import { LATEST_PLATFORM_VERSION } from '../constants.js';
7
+ export default async function getFinalizedEpochsInfo(grpcPool, startEpochIndex, startEpochIndexIncluded, endEpochIndex, endEpochIndexIncluded) {
8
+ const getEpochsInfoRequest = GetFinalizedEpochInfosRequest.create({
9
+ version: {
10
+ oneofKind: 'v0',
11
+ v0: {
12
+ startEpochIndex,
13
+ startEpochIndexIncluded,
14
+ endEpochIndex,
15
+ endEpochIndexIncluded,
16
+ prove: true
17
+ }
18
+ }
19
+ });
20
+ const { response } = await grpcPool.getClient().getFinalizedEpochInfos(getEpochsInfoRequest);
21
+ const { version } = response;
22
+ if (version.oneofKind !== 'v0') {
23
+ throw new Error('Unexpected oneOf type returned from DAPI (must be v0)');
24
+ }
25
+ const { v0 } = version;
26
+ if (v0.result.oneofKind !== 'proof') {
27
+ throw new Error('Unexpected oneOf type returned from DAPI (must be proof)');
28
+ }
29
+ const { result: { proof }, metadata } = v0;
30
+ if (metadata == null) {
31
+ throw new Error('Metadata not found');
32
+ }
33
+ const { rootHash, epochInfos } = verifyFinalizedEpochInfosProof(proof.grovedbProof, startEpochIndex, startEpochIndexIncluded, endEpochIndex, endEpochIndexIncluded, LATEST_PLATFORM_VERSION);
34
+ const quorumPublicKey = await getQuorumPublicKey(grpcPool.network, proof.quorumType, bytesToHex(proof.quorumHash));
35
+ const verify = await verifyTenderdashProof(proof, metadata, rootHash, quorumPublicKey);
36
+ if (!verify) {
37
+ throw new Error('Failed to verify query');
38
+ }
39
+ return epochInfos.map(info => ({
40
+ epochIndex: info.epochIndex,
41
+ firstBlockTime: info.firstBlockTime,
42
+ firstBlockHeight: info.firstBlockHeight,
43
+ totalBlocksInEpoch: info.totalBlocksInEpoch,
44
+ firstCoreBlockHeight: info.firstCoreBlockHeight,
45
+ nextEpochStartCoreBlockHeight: info.nextEpochStartCoreBlockHeight,
46
+ totalProcessingFees: info.totalProcessingFees,
47
+ totalDistributedStorageFees: info.totalDistributedStorageFees,
48
+ totalCreatedStorageFees: info.totalCreatedStorageFees,
49
+ coreBlockRewards: info.coreBlockRewards,
50
+ blockProposers: info.blockProposers,
51
+ feeMultiplier: info.feeMultiplierPermille,
52
+ protocolVersion: info.protocolVersion
53
+ }));
54
+ }
@@ -1,6 +1,7 @@
1
1
  import GRPCConnectionPool from '../grpcConnectionPool.js';
2
2
  import { NodeStatus } from '../../types.js';
3
- import { EpochInfo } from './epochs.js';
3
+ import { EpochInfo } from './epochInfos.js';
4
+ import { FinalizedEpochInfo } from './finalizedEpochInfos.js';
4
5
  /**
5
6
  * Node controller for requesting information about DAPI node
6
7
  *
@@ -30,4 +31,11 @@ export declare class NodeController {
30
31
  * @return {Promise<EpochInfo[]>}
31
32
  */
32
33
  getEpochsInfo(count: number, ascending: boolean, start?: number): Promise<EpochInfo[]>;
34
+ /**
35
+ * Retrieves an finalized info about epochs
36
+ * Includes information about first block height, time, fee multiplier, number
37
+ *
38
+ * @return {Promise<FinalizedEpochInfo[]>}
39
+ */
40
+ getFinalizedEpochsInfo(startEpochIndex: number, startEpochIndexIncluded: boolean, endEpochIndex: number, endEpochIndexIncluded: boolean): Promise<FinalizedEpochInfo[]>;
33
41
  }
package/src/node/index.js CHANGED
@@ -1,5 +1,6 @@
1
1
  import getStatus from './status.js';
2
- import getEpochsInfo from './epochs.js';
2
+ import getEpochsInfo from './epochInfos.js';
3
+ import getFinalizedEpochsInfo from './finalizedEpochInfos.js';
3
4
  import getTotalCredits from './totalCredits.js';
4
5
  /**
5
6
  * Node controller for requesting information about DAPI node
@@ -38,4 +39,13 @@ export class NodeController {
38
39
  async getEpochsInfo(count, ascending, start) {
39
40
  return await getEpochsInfo(this.grpcPool, count, ascending, start);
40
41
  }
42
+ /**
43
+ * Retrieves an finalized info about epochs
44
+ * Includes information about first block height, time, fee multiplier, number
45
+ *
46
+ * @return {Promise<FinalizedEpochInfo[]>}
47
+ */
48
+ async getFinalizedEpochsInfo(startEpochIndex, startEpochIndexIncluded, endEpochIndex, endEpochIndexIncluded) {
49
+ return await getFinalizedEpochsInfo(this.grpcPool, startEpochIndex, startEpochIndexIncluded, endEpochIndex, endEpochIndexIncluded);
50
+ }
41
51
  }
@@ -1,3 +1,3 @@
1
1
  import { ShieldedBuilderWASM, StateTransitionWASM } from 'pshenmic-dpp';
2
2
  import { ShieldedTransitionParamsMap, ShieldedTransitionType } from '../../types.js';
3
- export default function createStateTransition<K extends ShieldedTransitionType>(builder: ShieldedBuilderWASM, type: K, params: ShieldedTransitionParamsMap[K]): StateTransitionWASM;
3
+ export default function createStateTransition<K extends ShieldedTransitionType>(builder: ShieldedBuilderWASM, type: K, params: ShieldedTransitionParamsMap[K]): Promise<StateTransitionWASM>;