@dashevo/dapi-grpc 2.0.0-rc.15 → 2.0.0-rc.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Cargo.toml +1 -1
- package/build.rs +4 -2
- package/clients/drive/v0/nodejs/drive_pbjs.js +2003 -0
- package/clients/platform/v0/nodejs/platform_pbjs.js +2003 -0
- package/clients/platform/v0/nodejs/platform_protoc.js +1902 -0
- package/clients/platform/v0/web/platform_pb.d.ts +251 -0
- package/clients/platform/v0/web/platform_pb.js +1902 -0
- package/clients/platform/v0/web/platform_pb_service.d.ts +19 -0
- package/clients/platform/v0/web/platform_pb_service.js +40 -0
- package/package.json +2 -2
- package/protos/platform/v0/platform.proto +64 -0
|
@@ -202,6 +202,15 @@ type PlatformgetEpochsInfo = {
|
|
|
202
202
|
readonly responseType: typeof platform_pb.GetEpochsInfoResponse;
|
|
203
203
|
};
|
|
204
204
|
|
|
205
|
+
type PlatformgetFinalizedEpochInfos = {
|
|
206
|
+
readonly methodName: string;
|
|
207
|
+
readonly service: typeof Platform;
|
|
208
|
+
readonly requestStream: false;
|
|
209
|
+
readonly responseStream: false;
|
|
210
|
+
readonly requestType: typeof platform_pb.GetFinalizedEpochInfosRequest;
|
|
211
|
+
readonly responseType: typeof platform_pb.GetFinalizedEpochInfosResponse;
|
|
212
|
+
};
|
|
213
|
+
|
|
205
214
|
type PlatformgetContestedResources = {
|
|
206
215
|
readonly methodName: string;
|
|
207
216
|
readonly service: typeof Platform;
|
|
@@ -442,6 +451,7 @@ export class Platform {
|
|
|
442
451
|
static readonly getProtocolVersionUpgradeState: PlatformgetProtocolVersionUpgradeState;
|
|
443
452
|
static readonly getProtocolVersionUpgradeVoteStatus: PlatformgetProtocolVersionUpgradeVoteStatus;
|
|
444
453
|
static readonly getEpochsInfo: PlatformgetEpochsInfo;
|
|
454
|
+
static readonly getFinalizedEpochInfos: PlatformgetFinalizedEpochInfos;
|
|
445
455
|
static readonly getContestedResources: PlatformgetContestedResources;
|
|
446
456
|
static readonly getContestedResourceVoteState: PlatformgetContestedResourceVoteState;
|
|
447
457
|
static readonly getContestedResourceVotersForIdentity: PlatformgetContestedResourceVotersForIdentity;
|
|
@@ -698,6 +708,15 @@ export class PlatformClient {
|
|
|
698
708
|
requestMessage: platform_pb.GetEpochsInfoRequest,
|
|
699
709
|
callback: (error: ServiceError|null, responseMessage: platform_pb.GetEpochsInfoResponse|null) => void
|
|
700
710
|
): UnaryResponse;
|
|
711
|
+
getFinalizedEpochInfos(
|
|
712
|
+
requestMessage: platform_pb.GetFinalizedEpochInfosRequest,
|
|
713
|
+
metadata: grpc.Metadata,
|
|
714
|
+
callback: (error: ServiceError|null, responseMessage: platform_pb.GetFinalizedEpochInfosResponse|null) => void
|
|
715
|
+
): UnaryResponse;
|
|
716
|
+
getFinalizedEpochInfos(
|
|
717
|
+
requestMessage: platform_pb.GetFinalizedEpochInfosRequest,
|
|
718
|
+
callback: (error: ServiceError|null, responseMessage: platform_pb.GetFinalizedEpochInfosResponse|null) => void
|
|
719
|
+
): UnaryResponse;
|
|
701
720
|
getContestedResources(
|
|
702
721
|
requestMessage: platform_pb.GetContestedResourcesRequest,
|
|
703
722
|
metadata: grpc.Metadata,
|
|
@@ -208,6 +208,15 @@ Platform.getEpochsInfo = {
|
|
|
208
208
|
responseType: platform_pb.GetEpochsInfoResponse
|
|
209
209
|
};
|
|
210
210
|
|
|
211
|
+
Platform.getFinalizedEpochInfos = {
|
|
212
|
+
methodName: "getFinalizedEpochInfos",
|
|
213
|
+
service: Platform,
|
|
214
|
+
requestStream: false,
|
|
215
|
+
responseStream: false,
|
|
216
|
+
requestType: platform_pb.GetFinalizedEpochInfosRequest,
|
|
217
|
+
responseType: platform_pb.GetFinalizedEpochInfosResponse
|
|
218
|
+
};
|
|
219
|
+
|
|
211
220
|
Platform.getContestedResources = {
|
|
212
221
|
methodName: "getContestedResources",
|
|
213
222
|
service: Platform,
|
|
@@ -1113,6 +1122,37 @@ PlatformClient.prototype.getEpochsInfo = function getEpochsInfo(requestMessage,
|
|
|
1113
1122
|
};
|
|
1114
1123
|
};
|
|
1115
1124
|
|
|
1125
|
+
PlatformClient.prototype.getFinalizedEpochInfos = function getFinalizedEpochInfos(requestMessage, metadata, callback) {
|
|
1126
|
+
if (arguments.length === 2) {
|
|
1127
|
+
callback = arguments[1];
|
|
1128
|
+
}
|
|
1129
|
+
var client = grpc.unary(Platform.getFinalizedEpochInfos, {
|
|
1130
|
+
request: requestMessage,
|
|
1131
|
+
host: this.serviceHost,
|
|
1132
|
+
metadata: metadata,
|
|
1133
|
+
transport: this.options.transport,
|
|
1134
|
+
debug: this.options.debug,
|
|
1135
|
+
onEnd: function (response) {
|
|
1136
|
+
if (callback) {
|
|
1137
|
+
if (response.status !== grpc.Code.OK) {
|
|
1138
|
+
var err = new Error(response.statusMessage);
|
|
1139
|
+
err.code = response.status;
|
|
1140
|
+
err.metadata = response.trailers;
|
|
1141
|
+
callback(err, null);
|
|
1142
|
+
} else {
|
|
1143
|
+
callback(null, response.message);
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
});
|
|
1148
|
+
return {
|
|
1149
|
+
cancel: function () {
|
|
1150
|
+
callback = null;
|
|
1151
|
+
client.close();
|
|
1152
|
+
}
|
|
1153
|
+
};
|
|
1154
|
+
};
|
|
1155
|
+
|
|
1116
1156
|
PlatformClient.prototype.getContestedResources = function getContestedResources(requestMessage, metadata, callback) {
|
|
1117
1157
|
if (arguments.length === 2) {
|
|
1118
1158
|
callback = arguments[1];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dashevo/dapi-grpc",
|
|
3
|
-
"version": "2.0.0-rc.
|
|
3
|
+
"version": "2.0.0-rc.17",
|
|
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.0.0-rc.
|
|
48
|
+
"@dashevo/grpc-common": "2.0.0-rc.17",
|
|
49
49
|
"@dashevo/protobufjs": "6.10.5",
|
|
50
50
|
"@grpc/grpc-js": "1.4.4",
|
|
51
51
|
"@improbable-eng/grpc-web": "^0.15.0",
|
|
@@ -49,6 +49,7 @@ service Platform {
|
|
|
49
49
|
GetProtocolVersionUpgradeVoteStatusRequest)
|
|
50
50
|
returns (GetProtocolVersionUpgradeVoteStatusResponse);
|
|
51
51
|
rpc getEpochsInfo(GetEpochsInfoRequest) returns (GetEpochsInfoResponse);
|
|
52
|
+
rpc getFinalizedEpochInfos(GetFinalizedEpochInfosRequest) returns (GetFinalizedEpochInfosResponse);
|
|
52
53
|
// What votes are currently happening for a specific contested index
|
|
53
54
|
rpc getContestedResources(GetContestedResourcesRequest)
|
|
54
55
|
returns (GetContestedResourcesResponse);
|
|
@@ -798,6 +799,69 @@ message GetEpochsInfoResponse {
|
|
|
798
799
|
oneof version { GetEpochsInfoResponseV0 v0 = 1; }
|
|
799
800
|
}
|
|
800
801
|
|
|
802
|
+
message GetFinalizedEpochInfosRequest {
|
|
803
|
+
message GetFinalizedEpochInfosRequestV0 {
|
|
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
|
|
809
|
+
}
|
|
810
|
+
|
|
811
|
+
oneof version { GetFinalizedEpochInfosRequestV0 v0 = 1; }
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
message GetFinalizedEpochInfosResponse {
|
|
815
|
+
message GetFinalizedEpochInfosResponseV0 {
|
|
816
|
+
// FinalizedEpochInfos holds a collection of finalized epoch information entries
|
|
817
|
+
message FinalizedEpochInfos {
|
|
818
|
+
repeated FinalizedEpochInfo finalized_epoch_infos =
|
|
819
|
+
1; // List of finalized information for each requested epoch
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
// FinalizedEpochInfo represents finalized information about a single epoch
|
|
823
|
+
message FinalizedEpochInfo {
|
|
824
|
+
uint32 number = 1; // The number of the epoch
|
|
825
|
+
uint64 first_block_height = 2
|
|
826
|
+
[ jstype = JS_STRING ]; // The height of the first block in this epoch
|
|
827
|
+
uint32 first_core_block_height =
|
|
828
|
+
3; // The height of the first Core block in this epoch
|
|
829
|
+
uint64 first_block_time = 4
|
|
830
|
+
[ jstype = JS_STRING ]; // The timestamp of the first block (milliseconds)
|
|
831
|
+
double fee_multiplier = 5; // The fee multiplier (converted from permille)
|
|
832
|
+
uint32 protocol_version = 6; // The protocol version for this epoch
|
|
833
|
+
uint64 total_blocks_in_epoch = 7
|
|
834
|
+
[ jstype = JS_STRING ]; // Total number of blocks in the epoch
|
|
835
|
+
uint32 next_epoch_start_core_block_height = 8; // Core block height where next epoch starts
|
|
836
|
+
uint64 total_processing_fees = 9
|
|
837
|
+
[ jstype = JS_STRING ]; // Total processing fees collected
|
|
838
|
+
uint64 total_distributed_storage_fees = 10
|
|
839
|
+
[ jstype = JS_STRING ]; // Total storage fees distributed
|
|
840
|
+
uint64 total_created_storage_fees = 11
|
|
841
|
+
[ jstype = JS_STRING ]; // Total storage fees created
|
|
842
|
+
uint64 core_block_rewards = 12
|
|
843
|
+
[ jstype = JS_STRING ]; // Rewards from core blocks
|
|
844
|
+
repeated BlockProposer block_proposers = 13; // List of block proposers and their counts
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
// BlockProposer represents a block proposer and their block count
|
|
848
|
+
message BlockProposer {
|
|
849
|
+
bytes proposer_id = 1; // The proposer's identifier
|
|
850
|
+
uint32 block_count = 2; // Number of blocks proposed
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
oneof result {
|
|
854
|
+
FinalizedEpochInfos epochs =
|
|
855
|
+
1; // The actual finalized information about the requested epochs
|
|
856
|
+
Proof proof =
|
|
857
|
+
2; // Cryptographic proof of the finalized epoch information, if requested
|
|
858
|
+
}
|
|
859
|
+
ResponseMetadata metadata = 3; // Metadata about the blockchain state
|
|
860
|
+
}
|
|
861
|
+
|
|
862
|
+
oneof version { GetFinalizedEpochInfosResponseV0 v0 = 1; }
|
|
863
|
+
}
|
|
864
|
+
|
|
801
865
|
message GetContestedResourcesRequest {
|
|
802
866
|
message GetContestedResourcesRequestV0 {
|
|
803
867
|
message StartAtValueInfo {
|