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

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.
@@ -427,15 +427,6 @@ type PlatformgetGroupActionSigners = {
427
427
  readonly responseType: typeof platform_pb.GetGroupActionSignersResponse;
428
428
  };
429
429
 
430
- type PlatformSubscribePlatformEvents = {
431
- readonly methodName: string;
432
- readonly service: typeof Platform;
433
- readonly requestStream: true;
434
- readonly responseStream: true;
435
- readonly requestType: typeof platform_pb.PlatformEventsCommand;
436
- readonly responseType: typeof platform_pb.PlatformEventsResponse;
437
- };
438
-
439
430
  export class Platform {
440
431
  static readonly serviceName: string;
441
432
  static readonly broadcastStateTransition: PlatformbroadcastStateTransition;
@@ -485,7 +476,6 @@ export class Platform {
485
476
  static readonly getGroupInfos: PlatformgetGroupInfos;
486
477
  static readonly getGroupActions: PlatformgetGroupActions;
487
478
  static readonly getGroupActionSigners: PlatformgetGroupActionSigners;
488
- static readonly SubscribePlatformEvents: PlatformSubscribePlatformEvents;
489
479
  }
490
480
 
491
481
  export type ServiceError = { message: string, code: number; metadata: grpc.Metadata }
@@ -943,6 +933,5 @@ export class PlatformClient {
943
933
  requestMessage: platform_pb.GetGroupActionSignersRequest,
944
934
  callback: (error: ServiceError|null, responseMessage: platform_pb.GetGroupActionSignersResponse|null) => void
945
935
  ): UnaryResponse;
946
- subscribePlatformEvents(metadata?: grpc.Metadata): BidirectionalStream<platform_pb.PlatformEventsCommand, platform_pb.PlatformEventsResponse>;
947
936
  }
948
937
 
@@ -433,15 +433,6 @@ Platform.getGroupActionSigners = {
433
433
  responseType: platform_pb.GetGroupActionSignersResponse
434
434
  };
435
435
 
436
- Platform.SubscribePlatformEvents = {
437
- methodName: "SubscribePlatformEvents",
438
- service: Platform,
439
- requestStream: true,
440
- responseStream: true,
441
- requestType: platform_pb.PlatformEventsCommand,
442
- responseType: platform_pb.PlatformEventsResponse
443
- };
444
-
445
436
  exports.Platform = Platform;
446
437
 
447
438
  function PlatformClient(serviceHost, options) {
@@ -1906,50 +1897,5 @@ PlatformClient.prototype.getGroupActionSigners = function getGroupActionSigners(
1906
1897
  };
1907
1898
  };
1908
1899
 
1909
- PlatformClient.prototype.subscribePlatformEvents = function subscribePlatformEvents(metadata) {
1910
- var listeners = {
1911
- data: [],
1912
- end: [],
1913
- status: []
1914
- };
1915
- var client = grpc.client(Platform.SubscribePlatformEvents, {
1916
- host: this.serviceHost,
1917
- metadata: metadata,
1918
- transport: this.options.transport
1919
- });
1920
- client.onEnd(function (status, statusMessage, trailers) {
1921
- listeners.status.forEach(function (handler) {
1922
- handler({ code: status, details: statusMessage, metadata: trailers });
1923
- });
1924
- listeners.end.forEach(function (handler) {
1925
- handler({ code: status, details: statusMessage, metadata: trailers });
1926
- });
1927
- listeners = null;
1928
- });
1929
- client.onMessage(function (message) {
1930
- listeners.data.forEach(function (handler) {
1931
- handler(message);
1932
- })
1933
- });
1934
- client.start(metadata);
1935
- return {
1936
- on: function (type, handler) {
1937
- listeners[type].push(handler);
1938
- return this;
1939
- },
1940
- write: function (requestMessage) {
1941
- client.send(requestMessage);
1942
- return this;
1943
- },
1944
- end: function () {
1945
- client.finishSend();
1946
- },
1947
- cancel: function () {
1948
- listeners = null;
1949
- client.close();
1950
- }
1951
- };
1952
- };
1953
-
1954
1900
  exports.PlatformClient = PlatformClient;
1955
1901
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dashevo/dapi-grpc",
3
- "version": "2.1.0-pr.2716.1",
3
+ "version": "2.1.0",
4
4
  "description": "DAPI GRPC definition file and generated clients",
5
5
  "browser": "browser.js",
6
6
  "main": "node.js",
@@ -45,7 +45,7 @@
45
45
  },
46
46
  "homepage": "https://github.com/dashevo/dapi-grpc#readme",
47
47
  "dependencies": {
48
- "@dashevo/grpc-common": "2.1.0-pr.2716.1",
48
+ "@dashevo/grpc-common": "2.1.0",
49
49
  "@dashevo/protobufjs": "6.10.5",
50
50
  "@grpc/grpc-js": "1.4.4",
51
51
  "@improbable-eng/grpc-web": "^0.15.0",
@@ -6,91 +6,6 @@ package org.dash.platform.dapi.v0;
6
6
 
7
7
  import "google/protobuf/timestamp.proto";
8
8
 
9
- // Platform events streaming (v0)
10
- message PlatformEventsCommand {
11
- message PlatformEventsCommandV0 {
12
- oneof command {
13
- AddSubscriptionV0 add = 1;
14
- RemoveSubscriptionV0 remove = 2;
15
- }
16
- }
17
- oneof version { PlatformEventsCommandV0 v0 = 1; }
18
- }
19
-
20
- message PlatformEventsResponse {
21
- message PlatformEventsResponseV0 {
22
- oneof response {
23
- PlatformEventMessageV0 event = 1;
24
- AckV0 ack = 2;
25
- PlatformErrorV0 error = 3;
26
- }
27
- }
28
- oneof version { PlatformEventsResponseV0 v0 = 1; }
29
- }
30
-
31
- message AddSubscriptionV0 {
32
- string client_subscription_id = 1;
33
- PlatformFilterV0 filter = 2;
34
- }
35
-
36
- message RemoveSubscriptionV0 {
37
- string client_subscription_id = 1;
38
- }
39
-
40
- message AckV0 {
41
- string client_subscription_id = 1;
42
- string op = 2; // "add" | "remove"
43
- }
44
-
45
- message PlatformErrorV0 {
46
- string client_subscription_id = 1;
47
- uint32 code = 2;
48
- string message = 3;
49
- }
50
-
51
- message PlatformEventMessageV0 {
52
- string client_subscription_id = 1;
53
- PlatformEventV0 event = 2;
54
- }
55
-
56
- // Initial placeholder filter and event to be refined during integration
57
- // Filter for StateTransitionResult events
58
- message StateTransitionResultFilter {
59
- // When set, only match StateTransitionResult events for this tx hash.
60
- optional bytes tx_hash = 1;
61
- }
62
-
63
- message PlatformFilterV0 {
64
- oneof kind {
65
- bool all = 1; // subscribe to all platform events
66
- bool block_committed = 2; // subscribe to BlockCommitted events only
67
- StateTransitionResultFilter state_transition_result = 3; // subscribe to StateTransitionResult events (optionally filtered by tx_hash)
68
- }
69
- }
70
-
71
- message PlatformEventV0 {
72
- message BlockMetadata {
73
- uint64 height = 1 [ jstype = JS_STRING ];
74
- uint64 time_ms = 2 [ jstype = JS_STRING ];
75
- bytes block_id_hash = 3;
76
- }
77
-
78
- message BlockCommitted {
79
- BlockMetadata meta = 1;
80
- uint32 tx_count = 2;
81
- }
82
-
83
- message StateTransitionFinalized {
84
- BlockMetadata meta = 1;
85
- bytes tx_hash = 2;
86
- }
87
-
88
- oneof event {
89
- BlockCommitted block_committed = 1;
90
- StateTransitionFinalized state_transition_finalized = 2;
91
- }
92
- }
93
-
94
9
  service Platform {
95
10
  rpc broadcastStateTransition(BroadcastStateTransitionRequest)
96
11
  returns (BroadcastStateTransitionResponse);
@@ -122,7 +37,8 @@ service Platform {
122
37
  rpc getDocuments(GetDocumentsRequest) returns (GetDocumentsResponse);
123
38
  rpc getIdentityByPublicKeyHash(GetIdentityByPublicKeyHashRequest)
124
39
  returns (GetIdentityByPublicKeyHashResponse);
125
- rpc getIdentityByNonUniquePublicKeyHash(GetIdentityByNonUniquePublicKeyHashRequest)
40
+ rpc getIdentityByNonUniquePublicKeyHash(
41
+ GetIdentityByNonUniquePublicKeyHashRequest)
126
42
  returns (GetIdentityByNonUniquePublicKeyHashResponse);
127
43
  rpc waitForStateTransitionResult(WaitForStateTransitionResultRequest)
128
44
  returns (WaitForStateTransitionResultResponse);
@@ -134,7 +50,8 @@ service Platform {
134
50
  GetProtocolVersionUpgradeVoteStatusRequest)
135
51
  returns (GetProtocolVersionUpgradeVoteStatusResponse);
136
52
  rpc getEpochsInfo(GetEpochsInfoRequest) returns (GetEpochsInfoResponse);
137
- rpc getFinalizedEpochInfos(GetFinalizedEpochInfosRequest) returns (GetFinalizedEpochInfosResponse);
53
+ rpc getFinalizedEpochInfos(GetFinalizedEpochInfosRequest)
54
+ returns (GetFinalizedEpochInfosResponse);
138
55
  // What votes are currently happening for a specific contested index
139
56
  rpc getContestedResources(GetContestedResourcesRequest)
140
57
  returns (GetContestedResourcesResponse);
@@ -187,10 +104,6 @@ service Platform {
187
104
  rpc getGroupActions(GetGroupActionsRequest) returns (GetGroupActionsResponse);
188
105
  rpc getGroupActionSigners(GetGroupActionSignersRequest)
189
106
  returns (GetGroupActionSignersResponse);
190
-
191
- // Bi-directional stream for multiplexed platform events subscriptions
192
- rpc SubscribePlatformEvents(stream PlatformEventsCommand)
193
- returns (stream PlatformEventsResponse);
194
107
  }
195
108
 
196
109
  // Proof message includes cryptographic proofs for validating responses
@@ -700,9 +613,7 @@ message GetIdentityByNonUniquePublicKeyHashRequest {
700
613
 
701
614
  message GetIdentityByNonUniquePublicKeyHashResponse {
702
615
  message GetIdentityByNonUniquePublicKeyHashResponseV0 {
703
- message IdentityResponse {
704
- optional bytes identity = 1;
705
- }
616
+ message IdentityResponse { optional bytes identity = 1; }
706
617
 
707
618
  message IdentityProvedResponse {
708
619
  Proof grovedb_identity_public_key_hash_proof = 1;
@@ -713,7 +624,7 @@ message GetIdentityByNonUniquePublicKeyHashResponse {
713
624
  IdentityProvedResponse proof = 2;
714
625
  }
715
626
 
716
- ResponseMetadata metadata = 3; // Metadata about the blockchain state
627
+ ResponseMetadata metadata = 3; // Metadata about the blockchain state
717
628
  }
718
629
  oneof version { GetIdentityByNonUniquePublicKeyHashResponseV0 v0 = 1; }
719
630
  }
@@ -890,11 +801,11 @@ message GetEpochsInfoResponse {
890
801
 
891
802
  message GetFinalizedEpochInfosRequest {
892
803
  message GetFinalizedEpochInfosRequestV0 {
893
- uint32 start_epoch_index = 1; // The starting epoch index
894
- bool start_epoch_index_included = 2; // Whether to include the start epoch
895
- uint32 end_epoch_index = 3; // The ending epoch index
896
- bool end_epoch_index_included = 4; // Whether to include the end epoch
897
- bool prove = 5; // Flag to request a proof as the response
804
+ uint32 start_epoch_index = 1; // The starting epoch index
805
+ bool start_epoch_index_included = 2; // Whether to include the start epoch
806
+ uint32 end_epoch_index = 3; // The ending epoch index
807
+ bool end_epoch_index_included = 4; // Whether to include the end epoch
808
+ bool prove = 5; // Flag to request a proof as the response
898
809
  }
899
810
 
900
811
  oneof version { GetFinalizedEpochInfosRequestV0 v0 = 1; }
@@ -902,9 +813,10 @@ message GetFinalizedEpochInfosRequest {
902
813
 
903
814
  message GetFinalizedEpochInfosResponse {
904
815
  message GetFinalizedEpochInfosResponseV0 {
905
- // FinalizedEpochInfos holds a collection of finalized epoch information entries
816
+ // FinalizedEpochInfos holds a collection of finalized epoch information
817
+ // entries
906
818
  message FinalizedEpochInfos {
907
- repeated FinalizedEpochInfo finalized_epoch_infos =
819
+ repeated FinalizedEpochInfo finalized_epoch_infos =
908
820
  1; // List of finalized information for each requested epoch
909
821
  }
910
822
 
@@ -913,15 +825,17 @@ message GetFinalizedEpochInfosResponse {
913
825
  uint32 number = 1; // The number of the epoch
914
826
  uint64 first_block_height = 2
915
827
  [ jstype = JS_STRING ]; // The height of the first block in this epoch
916
- uint32 first_core_block_height =
828
+ uint32 first_core_block_height =
917
829
  3; // The height of the first Core block in this epoch
918
830
  uint64 first_block_time = 4
919
- [ jstype = JS_STRING ]; // The timestamp of the first block (milliseconds)
920
- double fee_multiplier = 5; // The fee multiplier (converted from permille)
831
+ [ jstype =
832
+ JS_STRING ]; // The timestamp of the first block (milliseconds)
833
+ double fee_multiplier = 5; // The fee multiplier (converted from permille)
921
834
  uint32 protocol_version = 6; // The protocol version for this epoch
922
835
  uint64 total_blocks_in_epoch = 7
923
836
  [ jstype = JS_STRING ]; // Total number of blocks in the epoch
924
- uint32 next_epoch_start_core_block_height = 8; // Core block height where next epoch starts
837
+ uint32 next_epoch_start_core_block_height =
838
+ 8; // Core block height where next epoch starts
925
839
  uint64 total_processing_fees = 9
926
840
  [ jstype = JS_STRING ]; // Total processing fees collected
927
841
  uint64 total_distributed_storage_fees = 10
@@ -930,20 +844,21 @@ message GetFinalizedEpochInfosResponse {
930
844
  [ jstype = JS_STRING ]; // Total storage fees created
931
845
  uint64 core_block_rewards = 12
932
846
  [ jstype = JS_STRING ]; // Rewards from core blocks
933
- repeated BlockProposer block_proposers = 13; // List of block proposers and their counts
847
+ repeated BlockProposer block_proposers =
848
+ 13; // List of block proposers and their counts
934
849
  }
935
850
 
936
851
  // BlockProposer represents a block proposer and their block count
937
852
  message BlockProposer {
938
- bytes proposer_id = 1; // The proposer's identifier
853
+ bytes proposer_id = 1; // The proposer's identifier
939
854
  uint32 block_count = 2; // Number of blocks proposed
940
855
  }
941
856
 
942
857
  oneof result {
943
- FinalizedEpochInfos epochs =
858
+ FinalizedEpochInfos epochs =
944
859
  1; // The actual finalized information about the requested epochs
945
- Proof proof =
946
- 2; // Cryptographic proof of the finalized epoch information, if requested
860
+ Proof proof = 2; // Cryptographic proof of the finalized epoch
861
+ // information, if requested
947
862
  }
948
863
  ResponseMetadata metadata = 3; // Metadata about the blockchain state
949
864
  }
@@ -1545,7 +1460,6 @@ message GetTokenDirectPurchasePricesRequest {
1545
1460
  oneof version { GetTokenDirectPurchasePricesRequestV0 v0 = 1; }
1546
1461
  }
1547
1462
 
1548
-
1549
1463
  // Response to GetTokenDirectPurchasePricesRequest, containing information about
1550
1464
  // direct purchase prices defined for requested token IDs.
1551
1465
  message GetTokenDirectPurchasePricesResponse {
@@ -1606,9 +1520,7 @@ message GetTokenContractInfoRequest {
1606
1520
  bool prove = 2;
1607
1521
  }
1608
1522
 
1609
- oneof version {
1610
- GetTokenContractInfoRequestV0 v0 = 1;
1611
- }
1523
+ oneof version { GetTokenContractInfoRequestV0 v0 = 1; }
1612
1524
  }
1613
1525
 
1614
1526
  // Response to GetTokenContractInfoRequest.
@@ -1635,9 +1547,7 @@ message GetTokenContractInfoResponse {
1635
1547
  ResponseMetadata metadata = 3;
1636
1548
  }
1637
1549
 
1638
- oneof version {
1639
- GetTokenContractInfoResponseV0 v0 = 1;
1640
- }
1550
+ oneof version { GetTokenContractInfoResponseV0 v0 = 1; }
1641
1551
  }
1642
1552
 
1643
1553
  message GetTokenPreProgrammedDistributionsRequest {
@@ -1694,15 +1604,16 @@ message GetTokenPerpetualDistributionLastClaimRequest {
1694
1604
 
1695
1605
  message GetTokenPerpetualDistributionLastClaimRequestV0 {
1696
1606
  // 32‑byte token identifier
1697
- bytes token_id = 1;
1607
+ bytes token_id = 1;
1698
1608
 
1699
- // This should be set if you wish to get back the last claim info as a specific type
1609
+ // This should be set if you wish to get back the last claim info as a
1610
+ // specific type
1700
1611
  optional ContractTokenInfo contract_info = 2;
1701
1612
 
1702
1613
  // Identity whose last‑claim timestamp is requested
1703
1614
  bytes identity_id = 4;
1704
1615
  // Return GroveDB / signature proof instead of raw value
1705
- bool prove = 5;
1616
+ bool prove = 5;
1706
1617
  }
1707
1618
 
1708
1619
  oneof version { GetTokenPerpetualDistributionLastClaimRequestV0 v0 = 1; }
@@ -1715,17 +1626,17 @@ message GetTokenPerpetualDistributionLastClaimResponse {
1715
1626
  oneof paid_at {
1716
1627
  uint64 timestamp_ms = 1 [ jstype = JS_STRING ]; // Unix epoch, ms
1717
1628
  uint64 block_height = 2 [ jstype = JS_STRING ]; // Core‑block height
1718
- uint32 epoch = 3; // Epoch index
1719
- bytes raw_bytes = 4; // Arbitrary encoding
1629
+ uint32 epoch = 3; // Epoch index
1630
+ bytes raw_bytes = 4; // Arbitrary encoding
1720
1631
  }
1721
1632
  }
1722
1633
 
1723
1634
  oneof result {
1724
1635
  LastClaimInfo last_claim = 1; // Direct answer
1725
- Proof proof = 2; // GroveDB / quorum proof
1636
+ Proof proof = 2; // GroveDB / quorum proof
1726
1637
  }
1727
1638
 
1728
- ResponseMetadata metadata = 3; // Chain context
1639
+ ResponseMetadata metadata = 3; // Chain context
1729
1640
  }
1730
1641
 
1731
1642
  oneof version { GetTokenPerpetualDistributionLastClaimResponseV0 v0 = 1; }
@@ -1736,7 +1647,7 @@ message GetTokenTotalSupplyRequest {
1736
1647
  bytes token_id = 1;
1737
1648
  bool prove = 2;
1738
1649
  }
1739
- oneof version {GetTokenTotalSupplyRequestV0 v0 = 1;}
1650
+ oneof version { GetTokenTotalSupplyRequestV0 v0 = 1; }
1740
1651
  }
1741
1652
 
1742
1653
  message GetTokenTotalSupplyResponse {