@dashevo/dapi-grpc 0.24.0-dev.6 → 0.25.0-dev.10

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.
Files changed (32) hide show
  1. package/Cargo.toml +39 -0
  2. package/README.md +3 -3
  3. package/browser.js +13 -5
  4. package/build.rs +65 -0
  5. package/clients/core/v0/nodejs/CorePromiseClient.js +2 -1
  6. package/clients/core/v0/nodejs/core_protoc.js +33 -33
  7. package/clients/core/v0/rust/README.md +3 -0
  8. package/clients/core/v0/rust/core_example.rs +14 -0
  9. package/clients/core/v0/web/CorePromiseClient.js +159 -0
  10. package/clients/core/v0/web/core_pb.d.ts +783 -0
  11. package/clients/core/v0/web/core_pb.js +33 -33
  12. package/clients/core/v0/web/core_pb_service.d.ts +161 -0
  13. package/clients/core/v0/web/core_pb_service.js +317 -0
  14. package/clients/platform/v0/nodejs/PlatformPromiseClient.js +2 -1
  15. package/clients/platform/v0/nodejs/platform_pbjs.js +10012 -1472
  16. package/clients/platform/v0/nodejs/platform_protoc.js +6811 -1243
  17. package/clients/platform/v0/rust/README.md +3 -0
  18. package/clients/platform/v0/rust/platform_example.rs +15 -0
  19. package/clients/platform/v0/web/PlatformPromiseClient.js +130 -0
  20. package/clients/platform/v0/web/platform_pb.d.ts +1312 -0
  21. package/clients/platform/v0/web/platform_pb.js +6811 -1243
  22. package/clients/platform/v0/web/platform_pb_service.d.ts +272 -0
  23. package/clients/platform/v0/web/platform_pb_service.js +501 -0
  24. package/lib/utils/parseMetadata.js +27 -0
  25. package/node.js +4 -0
  26. package/package.json +15 -3
  27. package/protos/platform/v0/platform.proto +157 -8
  28. package/scripts/build.sh +85 -79
  29. package/scripts/patch-protobuf-js.sh +31 -0
  30. package/src/lib.rs +15 -0
  31. package/clients/core/v0/web/core_grpc_web_pb.js +0 -499
  32. package/clients/platform/v0/web/platform_grpc_web_pb.js +0 -509
@@ -0,0 +1,272 @@
1
+ // package: org.dash.platform.dapi.v0
2
+ // file: platform.proto
3
+
4
+ import * as platform_pb from "./platform_pb";
5
+ import {grpc} from "@improbable-eng/grpc-web";
6
+
7
+ type PlatformbroadcastStateTransition = {
8
+ readonly methodName: string;
9
+ readonly service: typeof Platform;
10
+ readonly requestStream: false;
11
+ readonly responseStream: false;
12
+ readonly requestType: typeof platform_pb.BroadcastStateTransitionRequest;
13
+ readonly responseType: typeof platform_pb.BroadcastStateTransitionResponse;
14
+ };
15
+
16
+ type PlatformgetIdentity = {
17
+ readonly methodName: string;
18
+ readonly service: typeof Platform;
19
+ readonly requestStream: false;
20
+ readonly responseStream: false;
21
+ readonly requestType: typeof platform_pb.GetIdentityRequest;
22
+ readonly responseType: typeof platform_pb.GetIdentityResponse;
23
+ };
24
+
25
+ type PlatformgetIdentityKeys = {
26
+ readonly methodName: string;
27
+ readonly service: typeof Platform;
28
+ readonly requestStream: false;
29
+ readonly responseStream: false;
30
+ readonly requestType: typeof platform_pb.GetIdentityKeysRequest;
31
+ readonly responseType: typeof platform_pb.GetIdentityKeysResponse;
32
+ };
33
+
34
+ type PlatformgetIdentityBalance = {
35
+ readonly methodName: string;
36
+ readonly service: typeof Platform;
37
+ readonly requestStream: false;
38
+ readonly responseStream: false;
39
+ readonly requestType: typeof platform_pb.GetIdentityRequest;
40
+ readonly responseType: typeof platform_pb.GetIdentityBalanceResponse;
41
+ };
42
+
43
+ type PlatformgetIdentityBalanceAndRevision = {
44
+ readonly methodName: string;
45
+ readonly service: typeof Platform;
46
+ readonly requestStream: false;
47
+ readonly responseStream: false;
48
+ readonly requestType: typeof platform_pb.GetIdentityRequest;
49
+ readonly responseType: typeof platform_pb.GetIdentityBalanceAndRevisionResponse;
50
+ };
51
+
52
+ type PlatformgetDataContract = {
53
+ readonly methodName: string;
54
+ readonly service: typeof Platform;
55
+ readonly requestStream: false;
56
+ readonly responseStream: false;
57
+ readonly requestType: typeof platform_pb.GetDataContractRequest;
58
+ readonly responseType: typeof platform_pb.GetDataContractResponse;
59
+ };
60
+
61
+ type PlatformgetDataContracts = {
62
+ readonly methodName: string;
63
+ readonly service: typeof Platform;
64
+ readonly requestStream: false;
65
+ readonly responseStream: false;
66
+ readonly requestType: typeof platform_pb.GetDataContractsRequest;
67
+ readonly responseType: typeof platform_pb.GetDataContractsResponse;
68
+ };
69
+
70
+ type PlatformgetDocuments = {
71
+ readonly methodName: string;
72
+ readonly service: typeof Platform;
73
+ readonly requestStream: false;
74
+ readonly responseStream: false;
75
+ readonly requestType: typeof platform_pb.GetDocumentsRequest;
76
+ readonly responseType: typeof platform_pb.GetDocumentsResponse;
77
+ };
78
+
79
+ type PlatformgetIdentitiesByPublicKeyHashes = {
80
+ readonly methodName: string;
81
+ readonly service: typeof Platform;
82
+ readonly requestStream: false;
83
+ readonly responseStream: false;
84
+ readonly requestType: typeof platform_pb.GetIdentitiesByPublicKeyHashesRequest;
85
+ readonly responseType: typeof platform_pb.GetIdentitiesByPublicKeyHashesResponse;
86
+ };
87
+
88
+ type PlatformgetIdentityByPublicKeyHashes = {
89
+ readonly methodName: string;
90
+ readonly service: typeof Platform;
91
+ readonly requestStream: false;
92
+ readonly responseStream: false;
93
+ readonly requestType: typeof platform_pb.GetIdentityByPublicKeyHashesRequest;
94
+ readonly responseType: typeof platform_pb.GetIdentityByPublicKeyHashesResponse;
95
+ };
96
+
97
+ type PlatformwaitForStateTransitionResult = {
98
+ readonly methodName: string;
99
+ readonly service: typeof Platform;
100
+ readonly requestStream: false;
101
+ readonly responseStream: false;
102
+ readonly requestType: typeof platform_pb.WaitForStateTransitionResultRequest;
103
+ readonly responseType: typeof platform_pb.WaitForStateTransitionResultResponse;
104
+ };
105
+
106
+ type PlatformgetConsensusParams = {
107
+ readonly methodName: string;
108
+ readonly service: typeof Platform;
109
+ readonly requestStream: false;
110
+ readonly responseStream: false;
111
+ readonly requestType: typeof platform_pb.GetConsensusParamsRequest;
112
+ readonly responseType: typeof platform_pb.GetConsensusParamsResponse;
113
+ };
114
+
115
+ export class Platform {
116
+ static readonly serviceName: string;
117
+ static readonly broadcastStateTransition: PlatformbroadcastStateTransition;
118
+ static readonly getIdentity: PlatformgetIdentity;
119
+ static readonly getIdentityKeys: PlatformgetIdentityKeys;
120
+ static readonly getIdentityBalance: PlatformgetIdentityBalance;
121
+ static readonly getIdentityBalanceAndRevision: PlatformgetIdentityBalanceAndRevision;
122
+ static readonly getDataContract: PlatformgetDataContract;
123
+ static readonly getDataContracts: PlatformgetDataContracts;
124
+ static readonly getDocuments: PlatformgetDocuments;
125
+ static readonly getIdentitiesByPublicKeyHashes: PlatformgetIdentitiesByPublicKeyHashes;
126
+ static readonly getIdentityByPublicKeyHashes: PlatformgetIdentityByPublicKeyHashes;
127
+ static readonly waitForStateTransitionResult: PlatformwaitForStateTransitionResult;
128
+ static readonly getConsensusParams: PlatformgetConsensusParams;
129
+ }
130
+
131
+ export type ServiceError = { message: string, code: number; metadata: grpc.Metadata }
132
+ export type Status = { details: string, code: number; metadata: grpc.Metadata }
133
+
134
+ interface UnaryResponse {
135
+ cancel(): void;
136
+ }
137
+ interface ResponseStream<T> {
138
+ cancel(): void;
139
+ on(type: 'data', handler: (message: T) => void): ResponseStream<T>;
140
+ on(type: 'end', handler: (status?: Status) => void): ResponseStream<T>;
141
+ on(type: 'status', handler: (status: Status) => void): ResponseStream<T>;
142
+ }
143
+ interface RequestStream<T> {
144
+ write(message: T): RequestStream<T>;
145
+ end(): void;
146
+ cancel(): void;
147
+ on(type: 'end', handler: (status?: Status) => void): RequestStream<T>;
148
+ on(type: 'status', handler: (status: Status) => void): RequestStream<T>;
149
+ }
150
+ interface BidirectionalStream<ReqT, ResT> {
151
+ write(message: ReqT): BidirectionalStream<ReqT, ResT>;
152
+ end(): void;
153
+ cancel(): void;
154
+ on(type: 'data', handler: (message: ResT) => void): BidirectionalStream<ReqT, ResT>;
155
+ on(type: 'end', handler: (status?: Status) => void): BidirectionalStream<ReqT, ResT>;
156
+ on(type: 'status', handler: (status: Status) => void): BidirectionalStream<ReqT, ResT>;
157
+ }
158
+
159
+ export class PlatformClient {
160
+ readonly serviceHost: string;
161
+
162
+ constructor(serviceHost: string, options?: grpc.RpcOptions);
163
+ broadcastStateTransition(
164
+ requestMessage: platform_pb.BroadcastStateTransitionRequest,
165
+ metadata: grpc.Metadata,
166
+ callback: (error: ServiceError|null, responseMessage: platform_pb.BroadcastStateTransitionResponse|null) => void
167
+ ): UnaryResponse;
168
+ broadcastStateTransition(
169
+ requestMessage: platform_pb.BroadcastStateTransitionRequest,
170
+ callback: (error: ServiceError|null, responseMessage: platform_pb.BroadcastStateTransitionResponse|null) => void
171
+ ): UnaryResponse;
172
+ getIdentity(
173
+ requestMessage: platform_pb.GetIdentityRequest,
174
+ metadata: grpc.Metadata,
175
+ callback: (error: ServiceError|null, responseMessage: platform_pb.GetIdentityResponse|null) => void
176
+ ): UnaryResponse;
177
+ getIdentity(
178
+ requestMessage: platform_pb.GetIdentityRequest,
179
+ callback: (error: ServiceError|null, responseMessage: platform_pb.GetIdentityResponse|null) => void
180
+ ): UnaryResponse;
181
+ getIdentityKeys(
182
+ requestMessage: platform_pb.GetIdentityKeysRequest,
183
+ metadata: grpc.Metadata,
184
+ callback: (error: ServiceError|null, responseMessage: platform_pb.GetIdentityKeysResponse|null) => void
185
+ ): UnaryResponse;
186
+ getIdentityKeys(
187
+ requestMessage: platform_pb.GetIdentityKeysRequest,
188
+ callback: (error: ServiceError|null, responseMessage: platform_pb.GetIdentityKeysResponse|null) => void
189
+ ): UnaryResponse;
190
+ getIdentityBalance(
191
+ requestMessage: platform_pb.GetIdentityRequest,
192
+ metadata: grpc.Metadata,
193
+ callback: (error: ServiceError|null, responseMessage: platform_pb.GetIdentityBalanceResponse|null) => void
194
+ ): UnaryResponse;
195
+ getIdentityBalance(
196
+ requestMessage: platform_pb.GetIdentityRequest,
197
+ callback: (error: ServiceError|null, responseMessage: platform_pb.GetIdentityBalanceResponse|null) => void
198
+ ): UnaryResponse;
199
+ getIdentityBalanceAndRevision(
200
+ requestMessage: platform_pb.GetIdentityRequest,
201
+ metadata: grpc.Metadata,
202
+ callback: (error: ServiceError|null, responseMessage: platform_pb.GetIdentityBalanceAndRevisionResponse|null) => void
203
+ ): UnaryResponse;
204
+ getIdentityBalanceAndRevision(
205
+ requestMessage: platform_pb.GetIdentityRequest,
206
+ callback: (error: ServiceError|null, responseMessage: platform_pb.GetIdentityBalanceAndRevisionResponse|null) => void
207
+ ): UnaryResponse;
208
+ getDataContract(
209
+ requestMessage: platform_pb.GetDataContractRequest,
210
+ metadata: grpc.Metadata,
211
+ callback: (error: ServiceError|null, responseMessage: platform_pb.GetDataContractResponse|null) => void
212
+ ): UnaryResponse;
213
+ getDataContract(
214
+ requestMessage: platform_pb.GetDataContractRequest,
215
+ callback: (error: ServiceError|null, responseMessage: platform_pb.GetDataContractResponse|null) => void
216
+ ): UnaryResponse;
217
+ getDataContracts(
218
+ requestMessage: platform_pb.GetDataContractsRequest,
219
+ metadata: grpc.Metadata,
220
+ callback: (error: ServiceError|null, responseMessage: platform_pb.GetDataContractsResponse|null) => void
221
+ ): UnaryResponse;
222
+ getDataContracts(
223
+ requestMessage: platform_pb.GetDataContractsRequest,
224
+ callback: (error: ServiceError|null, responseMessage: platform_pb.GetDataContractsResponse|null) => void
225
+ ): UnaryResponse;
226
+ getDocuments(
227
+ requestMessage: platform_pb.GetDocumentsRequest,
228
+ metadata: grpc.Metadata,
229
+ callback: (error: ServiceError|null, responseMessage: platform_pb.GetDocumentsResponse|null) => void
230
+ ): UnaryResponse;
231
+ getDocuments(
232
+ requestMessage: platform_pb.GetDocumentsRequest,
233
+ callback: (error: ServiceError|null, responseMessage: platform_pb.GetDocumentsResponse|null) => void
234
+ ): UnaryResponse;
235
+ getIdentitiesByPublicKeyHashes(
236
+ requestMessage: platform_pb.GetIdentitiesByPublicKeyHashesRequest,
237
+ metadata: grpc.Metadata,
238
+ callback: (error: ServiceError|null, responseMessage: platform_pb.GetIdentitiesByPublicKeyHashesResponse|null) => void
239
+ ): UnaryResponse;
240
+ getIdentitiesByPublicKeyHashes(
241
+ requestMessage: platform_pb.GetIdentitiesByPublicKeyHashesRequest,
242
+ callback: (error: ServiceError|null, responseMessage: platform_pb.GetIdentitiesByPublicKeyHashesResponse|null) => void
243
+ ): UnaryResponse;
244
+ getIdentityByPublicKeyHashes(
245
+ requestMessage: platform_pb.GetIdentityByPublicKeyHashesRequest,
246
+ metadata: grpc.Metadata,
247
+ callback: (error: ServiceError|null, responseMessage: platform_pb.GetIdentityByPublicKeyHashesResponse|null) => void
248
+ ): UnaryResponse;
249
+ getIdentityByPublicKeyHashes(
250
+ requestMessage: platform_pb.GetIdentityByPublicKeyHashesRequest,
251
+ callback: (error: ServiceError|null, responseMessage: platform_pb.GetIdentityByPublicKeyHashesResponse|null) => void
252
+ ): UnaryResponse;
253
+ waitForStateTransitionResult(
254
+ requestMessage: platform_pb.WaitForStateTransitionResultRequest,
255
+ metadata: grpc.Metadata,
256
+ callback: (error: ServiceError|null, responseMessage: platform_pb.WaitForStateTransitionResultResponse|null) => void
257
+ ): UnaryResponse;
258
+ waitForStateTransitionResult(
259
+ requestMessage: platform_pb.WaitForStateTransitionResultRequest,
260
+ callback: (error: ServiceError|null, responseMessage: platform_pb.WaitForStateTransitionResultResponse|null) => void
261
+ ): UnaryResponse;
262
+ getConsensusParams(
263
+ requestMessage: platform_pb.GetConsensusParamsRequest,
264
+ metadata: grpc.Metadata,
265
+ callback: (error: ServiceError|null, responseMessage: platform_pb.GetConsensusParamsResponse|null) => void
266
+ ): UnaryResponse;
267
+ getConsensusParams(
268
+ requestMessage: platform_pb.GetConsensusParamsRequest,
269
+ callback: (error: ServiceError|null, responseMessage: platform_pb.GetConsensusParamsResponse|null) => void
270
+ ): UnaryResponse;
271
+ }
272
+