diff --git a/Cargo.lock b/Cargo.lock index 567cb66d47..3281c2d24c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -979,6 +979,7 @@ version = "0.25.0-dev.6" dependencies = [ "prost", "prost-build", + "prost-types", ] [[package]] @@ -1200,7 +1201,6 @@ dependencies = [ "ciborium", "costs", "criterion", - "dapi-grpc", "dpp", "enum-map", "grovedb", @@ -1235,6 +1235,7 @@ dependencies = [ "chrono", "ciborium", "clap 4.2.7", + "dapi-grpc", "dashcore-rpc", "dotenvy", "dpp", diff --git a/packages/dapi-grpc/Cargo.toml b/packages/dapi-grpc/Cargo.toml index 5a2e2521aa..046a044931 100644 --- a/packages/dapi-grpc/Cargo.toml +++ b/packages/dapi-grpc/Cargo.toml @@ -13,7 +13,8 @@ edition = "2021" license = "MIT" [dependencies] -prost = { version = "0.11" } +prost = { version = "0.11.9" } +prost-types = { version = "0.11.9" } [build-dependencies] prost-build = { version = "0.11" } diff --git a/packages/dapi-grpc/clients/platform/v0/java/org/dash/platform/dapi/v0/PlatformGrpc.java b/packages/dapi-grpc/clients/platform/v0/java/org/dash/platform/dapi/v0/PlatformGrpc.java index 19071d8783..d298209f80 100644 --- a/packages/dapi-grpc/clients/platform/v0/java/org/dash/platform/dapi/v0/PlatformGrpc.java +++ b/packages/dapi-grpc/clients/platform/v0/java/org/dash/platform/dapi/v0/PlatformGrpc.java @@ -77,6 +77,99 @@ org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityResponse> getGetIdentity return getGetIdentityMethod; } + private static volatile io.grpc.MethodDescriptor getGetIdentityKeysMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "getIdentityKeys", + requestType = org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityKeysRequest.class, + responseType = org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityKeysResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetIdentityKeysMethod() { + io.grpc.MethodDescriptor getGetIdentityKeysMethod; + if ((getGetIdentityKeysMethod = PlatformGrpc.getGetIdentityKeysMethod) == null) { + synchronized (PlatformGrpc.class) { + if ((getGetIdentityKeysMethod = PlatformGrpc.getGetIdentityKeysMethod) == null) { + PlatformGrpc.getGetIdentityKeysMethod = getGetIdentityKeysMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "getIdentityKeys")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityKeysRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityKeysResponse.getDefaultInstance())) + .setSchemaDescriptor(new PlatformMethodDescriptorSupplier("getIdentityKeys")) + .build(); + } + } + } + return getGetIdentityKeysMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetIdentityBalanceMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "getIdentityBalance", + requestType = org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityRequest.class, + responseType = org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityBalanceResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetIdentityBalanceMethod() { + io.grpc.MethodDescriptor getGetIdentityBalanceMethod; + if ((getGetIdentityBalanceMethod = PlatformGrpc.getGetIdentityBalanceMethod) == null) { + synchronized (PlatformGrpc.class) { + if ((getGetIdentityBalanceMethod = PlatformGrpc.getGetIdentityBalanceMethod) == null) { + PlatformGrpc.getGetIdentityBalanceMethod = getGetIdentityBalanceMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "getIdentityBalance")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityBalanceResponse.getDefaultInstance())) + .setSchemaDescriptor(new PlatformMethodDescriptorSupplier("getIdentityBalance")) + .build(); + } + } + } + return getGetIdentityBalanceMethod; + } + + private static volatile io.grpc.MethodDescriptor getGetIdentityBalanceAndRevisionMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "getIdentityBalanceAndRevision", + requestType = org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityRequest.class, + responseType = org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityBalanceAndRevisionResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetIdentityBalanceAndRevisionMethod() { + io.grpc.MethodDescriptor getGetIdentityBalanceAndRevisionMethod; + if ((getGetIdentityBalanceAndRevisionMethod = PlatformGrpc.getGetIdentityBalanceAndRevisionMethod) == null) { + synchronized (PlatformGrpc.class) { + if ((getGetIdentityBalanceAndRevisionMethod = PlatformGrpc.getGetIdentityBalanceAndRevisionMethod) == null) { + PlatformGrpc.getGetIdentityBalanceAndRevisionMethod = getGetIdentityBalanceAndRevisionMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "getIdentityBalanceAndRevision")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityBalanceAndRevisionResponse.getDefaultInstance())) + .setSchemaDescriptor(new PlatformMethodDescriptorSupplier("getIdentityBalanceAndRevision")) + .build(); + } + } + } + return getGetIdentityBalanceAndRevisionMethod; + } + private static volatile io.grpc.MethodDescriptor getGetDataContractMethod; @@ -108,6 +201,37 @@ org.dash.platform.dapi.v0.PlatformOuterClass.GetDataContractResponse> getGetData return getGetDataContractMethod; } + private static volatile io.grpc.MethodDescriptor getGetDataContractsMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "getDataContracts", + requestType = org.dash.platform.dapi.v0.PlatformOuterClass.GetDataContractsRequest.class, + responseType = org.dash.platform.dapi.v0.PlatformOuterClass.GetDataContractsResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetDataContractsMethod() { + io.grpc.MethodDescriptor getGetDataContractsMethod; + if ((getGetDataContractsMethod = PlatformGrpc.getGetDataContractsMethod) == null) { + synchronized (PlatformGrpc.class) { + if ((getGetDataContractsMethod = PlatformGrpc.getGetDataContractsMethod) == null) { + PlatformGrpc.getGetDataContractsMethod = getGetDataContractsMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "getDataContracts")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + org.dash.platform.dapi.v0.PlatformOuterClass.GetDataContractsRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + org.dash.platform.dapi.v0.PlatformOuterClass.GetDataContractsResponse.getDefaultInstance())) + .setSchemaDescriptor(new PlatformMethodDescriptorSupplier("getDataContracts")) + .build(); + } + } + } + return getGetDataContractsMethod; + } + private static volatile io.grpc.MethodDescriptor getGetDocumentsMethod; @@ -170,6 +294,37 @@ org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentitiesByPublicKeyHashesRespo return getGetIdentitiesByPublicKeyHashesMethod; } + private static volatile io.grpc.MethodDescriptor getGetIdentityByPublicKeyHashesMethod; + + @io.grpc.stub.annotations.RpcMethod( + fullMethodName = SERVICE_NAME + '/' + "getIdentityByPublicKeyHashes", + requestType = org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityByPublicKeyHashesRequest.class, + responseType = org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityByPublicKeyHashesResponse.class, + methodType = io.grpc.MethodDescriptor.MethodType.UNARY) + public static io.grpc.MethodDescriptor getGetIdentityByPublicKeyHashesMethod() { + io.grpc.MethodDescriptor getGetIdentityByPublicKeyHashesMethod; + if ((getGetIdentityByPublicKeyHashesMethod = PlatformGrpc.getGetIdentityByPublicKeyHashesMethod) == null) { + synchronized (PlatformGrpc.class) { + if ((getGetIdentityByPublicKeyHashesMethod = PlatformGrpc.getGetIdentityByPublicKeyHashesMethod) == null) { + PlatformGrpc.getGetIdentityByPublicKeyHashesMethod = getGetIdentityByPublicKeyHashesMethod = + io.grpc.MethodDescriptor.newBuilder() + .setType(io.grpc.MethodDescriptor.MethodType.UNARY) + .setFullMethodName(generateFullMethodName(SERVICE_NAME, "getIdentityByPublicKeyHashes")) + .setSampledToLocalTracing(true) + .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityByPublicKeyHashesRequest.getDefaultInstance())) + .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( + org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityByPublicKeyHashesResponse.getDefaultInstance())) + .setSchemaDescriptor(new PlatformMethodDescriptorSupplier("getIdentityByPublicKeyHashes")) + .build(); + } + } + } + return getGetIdentityByPublicKeyHashesMethod; + } + private static volatile io.grpc.MethodDescriptor getWaitForStateTransitionResultMethod; @@ -294,6 +449,30 @@ public void getIdentity(org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentity io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetIdentityMethod(), responseObserver); } + /** + */ + public void getIdentityKeys(org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityKeysRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetIdentityKeysMethod(), responseObserver); + } + + /** + *
+     *  rpc getIdentitiesKeys (GetIdentitiesKeysRequest) returns (GetIdentitiesKeysResponse);
+     * 
+ */ + public void getIdentityBalance(org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetIdentityBalanceMethod(), responseObserver); + } + + /** + */ + public void getIdentityBalanceAndRevision(org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetIdentityBalanceAndRevisionMethod(), responseObserver); + } + /** */ public void getDataContract(org.dash.platform.dapi.v0.PlatformOuterClass.GetDataContractRequest request, @@ -301,6 +480,13 @@ public void getDataContract(org.dash.platform.dapi.v0.PlatformOuterClass.GetData io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetDataContractMethod(), responseObserver); } + /** + */ + public void getDataContracts(org.dash.platform.dapi.v0.PlatformOuterClass.GetDataContractsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetDataContractsMethod(), responseObserver); + } + /** */ public void getDocuments(org.dash.platform.dapi.v0.PlatformOuterClass.GetDocumentsRequest request, @@ -315,6 +501,13 @@ public void getIdentitiesByPublicKeyHashes(org.dash.platform.dapi.v0.PlatformOut io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetIdentitiesByPublicKeyHashesMethod(), responseObserver); } + /** + */ + public void getIdentityByPublicKeyHashes(org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityByPublicKeyHashesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall(getGetIdentityByPublicKeyHashesMethod(), responseObserver); + } + /** */ public void waitForStateTransitionResult(org.dash.platform.dapi.v0.PlatformOuterClass.WaitForStateTransitionResultRequest request, @@ -345,6 +538,27 @@ public void getConsensusParams(org.dash.platform.dapi.v0.PlatformOuterClass.GetC org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityRequest, org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityResponse>( this, METHODID_GET_IDENTITY))) + .addMethod( + getGetIdentityKeysMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityKeysRequest, + org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityKeysResponse>( + this, METHODID_GET_IDENTITY_KEYS))) + .addMethod( + getGetIdentityBalanceMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityRequest, + org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityBalanceResponse>( + this, METHODID_GET_IDENTITY_BALANCE))) + .addMethod( + getGetIdentityBalanceAndRevisionMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityRequest, + org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityBalanceAndRevisionResponse>( + this, METHODID_GET_IDENTITY_BALANCE_AND_REVISION))) .addMethod( getGetDataContractMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( @@ -352,6 +566,13 @@ public void getConsensusParams(org.dash.platform.dapi.v0.PlatformOuterClass.GetC org.dash.platform.dapi.v0.PlatformOuterClass.GetDataContractRequest, org.dash.platform.dapi.v0.PlatformOuterClass.GetDataContractResponse>( this, METHODID_GET_DATA_CONTRACT))) + .addMethod( + getGetDataContractsMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + org.dash.platform.dapi.v0.PlatformOuterClass.GetDataContractsRequest, + org.dash.platform.dapi.v0.PlatformOuterClass.GetDataContractsResponse>( + this, METHODID_GET_DATA_CONTRACTS))) .addMethod( getGetDocumentsMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( @@ -366,6 +587,13 @@ public void getConsensusParams(org.dash.platform.dapi.v0.PlatformOuterClass.GetC org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentitiesByPublicKeyHashesRequest, org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentitiesByPublicKeyHashesResponse>( this, METHODID_GET_IDENTITIES_BY_PUBLIC_KEY_HASHES))) + .addMethod( + getGetIdentityByPublicKeyHashesMethod(), + io.grpc.stub.ServerCalls.asyncUnaryCall( + new MethodHandlers< + org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityByPublicKeyHashesRequest, + org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityByPublicKeyHashesResponse>( + this, METHODID_GET_IDENTITY_BY_PUBLIC_KEY_HASHES))) .addMethod( getWaitForStateTransitionResultMethod(), io.grpc.stub.ServerCalls.asyncUnaryCall( @@ -414,6 +642,33 @@ public void getIdentity(org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentity getChannel().newCall(getGetIdentityMethod(), getCallOptions()), request, responseObserver); } + /** + */ + public void getIdentityKeys(org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityKeysRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetIdentityKeysMethod(), getCallOptions()), request, responseObserver); + } + + /** + *
+     *  rpc getIdentitiesKeys (GetIdentitiesKeysRequest) returns (GetIdentitiesKeysResponse);
+     * 
+ */ + public void getIdentityBalance(org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetIdentityBalanceMethod(), getCallOptions()), request, responseObserver); + } + + /** + */ + public void getIdentityBalanceAndRevision(org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetIdentityBalanceAndRevisionMethod(), getCallOptions()), request, responseObserver); + } + /** */ public void getDataContract(org.dash.platform.dapi.v0.PlatformOuterClass.GetDataContractRequest request, @@ -422,6 +677,14 @@ public void getDataContract(org.dash.platform.dapi.v0.PlatformOuterClass.GetData getChannel().newCall(getGetDataContractMethod(), getCallOptions()), request, responseObserver); } + /** + */ + public void getDataContracts(org.dash.platform.dapi.v0.PlatformOuterClass.GetDataContractsRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetDataContractsMethod(), getCallOptions()), request, responseObserver); + } + /** */ public void getDocuments(org.dash.platform.dapi.v0.PlatformOuterClass.GetDocumentsRequest request, @@ -438,6 +701,14 @@ public void getIdentitiesByPublicKeyHashes(org.dash.platform.dapi.v0.PlatformOut getChannel().newCall(getGetIdentitiesByPublicKeyHashesMethod(), getCallOptions()), request, responseObserver); } + /** + */ + public void getIdentityByPublicKeyHashes(org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityByPublicKeyHashesRequest request, + io.grpc.stub.StreamObserver responseObserver) { + io.grpc.stub.ClientCalls.asyncUnaryCall( + getChannel().newCall(getGetIdentityByPublicKeyHashesMethod(), getCallOptions()), request, responseObserver); + } + /** */ public void waitForStateTransitionResult(org.dash.platform.dapi.v0.PlatformOuterClass.WaitForStateTransitionResultRequest request, @@ -483,6 +754,30 @@ public org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityResponse getIdent getChannel(), getGetIdentityMethod(), getCallOptions(), request); } + /** + */ + public org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityKeysResponse getIdentityKeys(org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityKeysRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetIdentityKeysMethod(), getCallOptions(), request); + } + + /** + *
+     *  rpc getIdentitiesKeys (GetIdentitiesKeysRequest) returns (GetIdentitiesKeysResponse);
+     * 
+ */ + public org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityBalanceResponse getIdentityBalance(org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetIdentityBalanceMethod(), getCallOptions(), request); + } + + /** + */ + public org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityBalanceAndRevisionResponse getIdentityBalanceAndRevision(org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetIdentityBalanceAndRevisionMethod(), getCallOptions(), request); + } + /** */ public org.dash.platform.dapi.v0.PlatformOuterClass.GetDataContractResponse getDataContract(org.dash.platform.dapi.v0.PlatformOuterClass.GetDataContractRequest request) { @@ -490,6 +785,13 @@ public org.dash.platform.dapi.v0.PlatformOuterClass.GetDataContractResponse getD getChannel(), getGetDataContractMethod(), getCallOptions(), request); } + /** + */ + public org.dash.platform.dapi.v0.PlatformOuterClass.GetDataContractsResponse getDataContracts(org.dash.platform.dapi.v0.PlatformOuterClass.GetDataContractsRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetDataContractsMethod(), getCallOptions(), request); + } + /** */ public org.dash.platform.dapi.v0.PlatformOuterClass.GetDocumentsResponse getDocuments(org.dash.platform.dapi.v0.PlatformOuterClass.GetDocumentsRequest request) { @@ -504,6 +806,13 @@ public org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentitiesByPublicKeyHash getChannel(), getGetIdentitiesByPublicKeyHashesMethod(), getCallOptions(), request); } + /** + */ + public org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityByPublicKeyHashesResponse getIdentityByPublicKeyHashes(org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityByPublicKeyHashesRequest request) { + return io.grpc.stub.ClientCalls.blockingUnaryCall( + getChannel(), getGetIdentityByPublicKeyHashesMethod(), getCallOptions(), request); + } + /** */ public org.dash.platform.dapi.v0.PlatformOuterClass.WaitForStateTransitionResultResponse waitForStateTransitionResult(org.dash.platform.dapi.v0.PlatformOuterClass.WaitForStateTransitionResultRequest request) { @@ -549,6 +858,33 @@ public com.google.common.util.concurrent.ListenableFuture getIdentityKeys( + org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityKeysRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetIdentityKeysMethod(), getCallOptions()), request); + } + + /** + *
+     *  rpc getIdentitiesKeys (GetIdentitiesKeysRequest) returns (GetIdentitiesKeysResponse);
+     * 
+ */ + public com.google.common.util.concurrent.ListenableFuture getIdentityBalance( + org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetIdentityBalanceMethod(), getCallOptions()), request); + } + + /** + */ + public com.google.common.util.concurrent.ListenableFuture getIdentityBalanceAndRevision( + org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetIdentityBalanceAndRevisionMethod(), getCallOptions()), request); + } + /** */ public com.google.common.util.concurrent.ListenableFuture getDataContract( @@ -557,6 +893,14 @@ public com.google.common.util.concurrent.ListenableFuture getDataContracts( + org.dash.platform.dapi.v0.PlatformOuterClass.GetDataContractsRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetDataContractsMethod(), getCallOptions()), request); + } + /** */ public com.google.common.util.concurrent.ListenableFuture getDocuments( @@ -573,6 +917,14 @@ public com.google.common.util.concurrent.ListenableFuture getIdentityByPublicKeyHashes( + org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityByPublicKeyHashesRequest request) { + return io.grpc.stub.ClientCalls.futureUnaryCall( + getChannel().newCall(getGetIdentityByPublicKeyHashesMethod(), getCallOptions()), request); + } + /** */ public com.google.common.util.concurrent.ListenableFuture waitForStateTransitionResult( @@ -592,11 +944,16 @@ public com.google.common.util.concurrent.ListenableFuture implements io.grpc.stub.ServerCalls.UnaryMethod, @@ -623,10 +980,26 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv serviceImpl.getIdentity((org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_GET_IDENTITY_KEYS: + serviceImpl.getIdentityKeys((org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityKeysRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_IDENTITY_BALANCE: + serviceImpl.getIdentityBalance((org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; + case METHODID_GET_IDENTITY_BALANCE_AND_REVISION: + serviceImpl.getIdentityBalanceAndRevision((org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; case METHODID_GET_DATA_CONTRACT: serviceImpl.getDataContract((org.dash.platform.dapi.v0.PlatformOuterClass.GetDataContractRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_GET_DATA_CONTRACTS: + serviceImpl.getDataContracts((org.dash.platform.dapi.v0.PlatformOuterClass.GetDataContractsRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; case METHODID_GET_DOCUMENTS: serviceImpl.getDocuments((org.dash.platform.dapi.v0.PlatformOuterClass.GetDocumentsRequest) request, (io.grpc.stub.StreamObserver) responseObserver); @@ -635,6 +1008,10 @@ public void invoke(Req request, io.grpc.stub.StreamObserver responseObserv serviceImpl.getIdentitiesByPublicKeyHashes((org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentitiesByPublicKeyHashesRequest) request, (io.grpc.stub.StreamObserver) responseObserver); break; + case METHODID_GET_IDENTITY_BY_PUBLIC_KEY_HASHES: + serviceImpl.getIdentityByPublicKeyHashes((org.dash.platform.dapi.v0.PlatformOuterClass.GetIdentityByPublicKeyHashesRequest) request, + (io.grpc.stub.StreamObserver) responseObserver); + break; case METHODID_WAIT_FOR_STATE_TRANSITION_RESULT: serviceImpl.waitForStateTransitionResult((org.dash.platform.dapi.v0.PlatformOuterClass.WaitForStateTransitionResultRequest) request, (io.grpc.stub.StreamObserver) responseObserver); @@ -706,9 +1083,14 @@ public static io.grpc.ServiceDescriptor getServiceDescriptor() { .setSchemaDescriptor(new PlatformFileDescriptorSupplier()) .addMethod(getBroadcastStateTransitionMethod()) .addMethod(getGetIdentityMethod()) + .addMethod(getGetIdentityKeysMethod()) + .addMethod(getGetIdentityBalanceMethod()) + .addMethod(getGetIdentityBalanceAndRevisionMethod()) .addMethod(getGetDataContractMethod()) + .addMethod(getGetDataContractsMethod()) .addMethod(getGetDocumentsMethod()) .addMethod(getGetIdentitiesByPublicKeyHashesMethod()) + .addMethod(getGetIdentityByPublicKeyHashesMethod()) .addMethod(getWaitForStateTransitionResultMethod()) .addMethod(getGetConsensusParamsMethod()) .build(); diff --git a/packages/dapi-grpc/clients/platform/v0/nodejs/platform_pbjs.js b/packages/dapi-grpc/clients/platform/v0/nodejs/platform_pbjs.js index ddc2ecef71..0d2969496c 100644 --- a/packages/dapi-grpc/clients/platform/v0/nodejs/platform_pbjs.js +++ b/packages/dapi-grpc/clients/platform/v0/nodejs/platform_pbjs.js @@ -152,6 +152,105 @@ $root.org = (function() { * @variation 2 */ + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentityKeys}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getIdentityKeysCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse} [response] GetIdentityKeysResponse + */ + + /** + * Calls getIdentityKeys. + * @function getIdentityKeys + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityKeysRequest} request GetIdentityKeysRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getIdentityKeysCallback} callback Node-style callback called with the error, if any, and GetIdentityKeysResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getIdentityKeys = function getIdentityKeys(request, callback) { + return this.rpcCall(getIdentityKeys, $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest, $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse, request, callback); + }, "name", { value: "getIdentityKeys" }); + + /** + * Calls getIdentityKeys. + * @function getIdentityKeys + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityKeysRequest} request GetIdentityKeysRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentityBalance}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getIdentityBalanceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceResponse} [response] GetIdentityBalanceResponse + */ + + /** + * Calls getIdentityBalance. + * @function getIdentityBalance + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityRequest} request GetIdentityRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getIdentityBalanceCallback} callback Node-style callback called with the error, if any, and GetIdentityBalanceResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getIdentityBalance = function getIdentityBalance(request, callback) { + return this.rpcCall(getIdentityBalance, $root.org.dash.platform.dapi.v0.GetIdentityRequest, $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse, request, callback); + }, "name", { value: "getIdentityBalance" }); + + /** + * Calls getIdentityBalance. + * @function getIdentityBalance + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityRequest} request GetIdentityRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentityBalanceAndRevision}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getIdentityBalanceAndRevisionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} [response] GetIdentityBalanceAndRevisionResponse + */ + + /** + * Calls getIdentityBalanceAndRevision. + * @function getIdentityBalanceAndRevision + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityRequest} request GetIdentityRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getIdentityBalanceAndRevisionCallback} callback Node-style callback called with the error, if any, and GetIdentityBalanceAndRevisionResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getIdentityBalanceAndRevision = function getIdentityBalanceAndRevision(request, callback) { + return this.rpcCall(getIdentityBalanceAndRevision, $root.org.dash.platform.dapi.v0.GetIdentityRequest, $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse, request, callback); + }, "name", { value: "getIdentityBalanceAndRevision" }); + + /** + * Calls getIdentityBalanceAndRevision. + * @function getIdentityBalanceAndRevision + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityRequest} request GetIdentityRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getDataContract}. * @memberof org.dash.platform.dapi.v0.Platform @@ -185,6 +284,39 @@ $root.org = (function() { * @variation 2 */ + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getDataContracts}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getDataContractsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse} [response] GetDataContractsResponse + */ + + /** + * Calls getDataContracts. + * @function getDataContracts + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetDataContractsRequest} request GetDataContractsRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getDataContractsCallback} callback Node-style callback called with the error, if any, and GetDataContractsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getDataContracts = function getDataContracts(request, callback) { + return this.rpcCall(getDataContracts, $root.org.dash.platform.dapi.v0.GetDataContractsRequest, $root.org.dash.platform.dapi.v0.GetDataContractsResponse, request, callback); + }, "name", { value: "getDataContracts" }); + + /** + * Calls getDataContracts. + * @function getDataContracts + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetDataContractsRequest} request GetDataContractsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getDocuments}. * @memberof org.dash.platform.dapi.v0.Platform @@ -251,6 +383,39 @@ $root.org = (function() { * @variation 2 */ + /** + * Callback as used by {@link org.dash.platform.dapi.v0.Platform#getIdentityByPublicKeyHashes}. + * @memberof org.dash.platform.dapi.v0.Platform + * @typedef getIdentityByPublicKeyHashesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse} [response] GetIdentityByPublicKeyHashesResponse + */ + + /** + * Calls getIdentityByPublicKeyHashes. + * @function getIdentityByPublicKeyHashes + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashesRequest} request GetIdentityByPublicKeyHashesRequest message or plain object + * @param {org.dash.platform.dapi.v0.Platform.getIdentityByPublicKeyHashesCallback} callback Node-style callback called with the error, if any, and GetIdentityByPublicKeyHashesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(Platform.prototype.getIdentityByPublicKeyHashes = function getIdentityByPublicKeyHashes(request, callback) { + return this.rpcCall(getIdentityByPublicKeyHashes, $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest, $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse, request, callback); + }, "name", { value: "getIdentityByPublicKeyHashes" }); + + /** + * Calls getIdentityByPublicKeyHashes. + * @function getIdentityByPublicKeyHashes + * @memberof org.dash.platform.dapi.v0.Platform + * @instance + * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashesRequest} request GetIdentityByPublicKeyHashesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + /** * Callback as used by {@link org.dash.platform.dapi.v0.Platform#waitForStateTransitionResult}. * @memberof org.dash.platform.dapi.v0.Platform @@ -326,7 +491,7 @@ $root.org = (function() { * Properties of a Proof. * @memberof org.dash.platform.dapi.v0 * @interface IProof - * @property {Uint8Array|null} [merkleProof] Proof merkleProof + * @property {Uint8Array|null} [grovedbProof] Proof grovedbProof * @property {Uint8Array|null} [quorumHash] Proof quorumHash * @property {Uint8Array|null} [signature] Proof signature * @property {number|null} [round] Proof round @@ -348,12 +513,12 @@ $root.org = (function() { } /** - * Proof merkleProof. - * @member {Uint8Array} merkleProof + * Proof grovedbProof. + * @member {Uint8Array} grovedbProof * @memberof org.dash.platform.dapi.v0.Proof * @instance */ - Proof.prototype.merkleProof = $util.newBuffer([]); + Proof.prototype.grovedbProof = $util.newBuffer([]); /** * Proof quorumHash. @@ -403,8 +568,8 @@ $root.org = (function() { Proof.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.merkleProof != null && Object.hasOwnProperty.call(message, "merkleProof")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.merkleProof); + if (message.grovedbProof != null && Object.hasOwnProperty.call(message, "grovedbProof")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.grovedbProof); if (message.quorumHash != null && Object.hasOwnProperty.call(message, "quorumHash")) writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.quorumHash); if (message.signature != null && Object.hasOwnProperty.call(message, "signature")) @@ -446,7 +611,7 @@ $root.org = (function() { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.merkleProof = reader.bytes(); + message.grovedbProof = reader.bytes(); break; case 2: message.quorumHash = reader.bytes(); @@ -492,9 +657,9 @@ $root.org = (function() { Proof.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.merkleProof != null && message.hasOwnProperty("merkleProof")) - if (!(message.merkleProof && typeof message.merkleProof.length === "number" || $util.isString(message.merkleProof))) - return "merkleProof: buffer expected"; + if (message.grovedbProof != null && message.hasOwnProperty("grovedbProof")) + if (!(message.grovedbProof && typeof message.grovedbProof.length === "number" || $util.isString(message.grovedbProof))) + return "grovedbProof: buffer expected"; if (message.quorumHash != null && message.hasOwnProperty("quorumHash")) if (!(message.quorumHash && typeof message.quorumHash.length === "number" || $util.isString(message.quorumHash))) return "quorumHash: buffer expected"; @@ -519,11 +684,11 @@ $root.org = (function() { if (object instanceof $root.org.dash.platform.dapi.v0.Proof) return object; var message = new $root.org.dash.platform.dapi.v0.Proof(); - if (object.merkleProof != null) - if (typeof object.merkleProof === "string") - $util.base64.decode(object.merkleProof, message.merkleProof = $util.newBuffer($util.base64.length(object.merkleProof)), 0); - else if (object.merkleProof.length >= 0) - message.merkleProof = object.merkleProof; + if (object.grovedbProof != null) + if (typeof object.grovedbProof === "string") + $util.base64.decode(object.grovedbProof, message.grovedbProof = $util.newBuffer($util.base64.length(object.grovedbProof)), 0); + else if (object.grovedbProof.length >= 0) + message.grovedbProof = object.grovedbProof; if (object.quorumHash != null) if (typeof object.quorumHash === "string") $util.base64.decode(object.quorumHash, message.quorumHash = $util.newBuffer($util.base64.length(object.quorumHash)), 0); @@ -554,11 +719,11 @@ $root.org = (function() { var object = {}; if (options.defaults) { if (options.bytes === String) - object.merkleProof = ""; + object.grovedbProof = ""; else { - object.merkleProof = []; + object.grovedbProof = []; if (options.bytes !== Array) - object.merkleProof = $util.newBuffer(object.merkleProof); + object.grovedbProof = $util.newBuffer(object.grovedbProof); } if (options.bytes === String) object.quorumHash = ""; @@ -576,8 +741,8 @@ $root.org = (function() { } object.round = 0; } - if (message.merkleProof != null && message.hasOwnProperty("merkleProof")) - object.merkleProof = options.bytes === String ? $util.base64.encode(message.merkleProof, 0, message.merkleProof.length) : options.bytes === Array ? Array.prototype.slice.call(message.merkleProof) : message.merkleProof; + if (message.grovedbProof != null && message.hasOwnProperty("grovedbProof")) + object.grovedbProof = options.bytes === String ? $util.base64.encode(message.grovedbProof, 0, message.grovedbProof.length) : options.bytes === Array ? Array.prototype.slice.call(message.grovedbProof) : message.grovedbProof; if (message.quorumHash != null && message.hasOwnProperty("quorumHash")) object.quorumHash = options.bytes === String ? $util.base64.encode(message.quorumHash, 0, message.quorumHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.quorumHash) : message.quorumHash; if (message.signature != null && message.hasOwnProperty("signature")) @@ -634,7 +799,7 @@ $root.org = (function() { * @memberof org.dash.platform.dapi.v0.ResponseMetadata * @instance */ - ResponseMetadata.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + ResponseMetadata.prototype.height = $util.Long ? $util.Long.fromBits(0,0,true) : 0; /** * ResponseMetadata coreChainLockedHeight. @@ -685,7 +850,7 @@ $root.org = (function() { if (!writer) writer = $Writer.create(); if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.height); + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.height); if (message.coreChainLockedHeight != null && Object.hasOwnProperty.call(message, "coreChainLockedHeight")) writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.coreChainLockedHeight); if (message.timeMs != null && Object.hasOwnProperty.call(message, "timeMs")) @@ -727,7 +892,7 @@ $root.org = (function() { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.height = reader.int64(); + message.height = reader.uint64(); break; case 2: message.coreChainLockedHeight = reader.uint32(); @@ -802,13 +967,13 @@ $root.org = (function() { var message = new $root.org.dash.platform.dapi.v0.ResponseMetadata(); if (object.height != null) if ($util.Long) - (message.height = $util.Long.fromValue(object.height)).unsigned = false; + (message.height = $util.Long.fromValue(object.height)).unsigned = true; else if (typeof object.height === "string") message.height = parseInt(object.height, 10); else if (typeof object.height === "number") message.height = object.height; else if (typeof object.height === "object") - message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(true); if (object.coreChainLockedHeight != null) message.coreChainLockedHeight = object.coreChainLockedHeight >>> 0; if (object.timeMs != null) @@ -840,7 +1005,7 @@ $root.org = (function() { var object = {}; if (options.defaults) { if ($util.Long) { - var long = new $util.Long(0, 0, false); + var long = new $util.Long(0, 0, true); object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; } else object.height = options.longs === String ? "0" : 0; @@ -856,7 +1021,7 @@ $root.org = (function() { if (typeof message.height === "number") object.height = options.longs === String ? String(message.height) : message.height; else - 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() : message.height; + 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; if (message.coreChainLockedHeight != null && message.hasOwnProperty("coreChainLockedHeight")) object.coreChainLockedHeight = message.coreChainLockedHeight; if (message.timeMs != null && message.hasOwnProperty("timeMs")) @@ -1950,25 +2115,26 @@ $root.org = (function() { return GetIdentityResponse; })(); - v0.GetDataContractRequest = (function() { + v0.GetIdentityBalanceResponse = (function() { /** - * Properties of a GetDataContractRequest. + * Properties of a GetIdentityBalanceResponse. * @memberof org.dash.platform.dapi.v0 - * @interface IGetDataContractRequest - * @property {Uint8Array|null} [id] GetDataContractRequest id - * @property {boolean|null} [prove] GetDataContractRequest prove + * @interface IGetIdentityBalanceResponse + * @property {google.protobuf.IUInt64Value|null} [balance] GetIdentityBalanceResponse balance + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityBalanceResponse proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityBalanceResponse metadata */ /** - * Constructs a new GetDataContractRequest. + * Constructs a new GetIdentityBalanceResponse. * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetDataContractRequest. - * @implements IGetDataContractRequest + * @classdesc Represents a GetIdentityBalanceResponse. + * @implements IGetIdentityBalanceResponse * @constructor - * @param {org.dash.platform.dapi.v0.IGetDataContractRequest=} [properties] Properties to set + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceResponse=} [properties] Properties to set */ - function GetDataContractRequest(properties) { + function GetIdentityBalanceResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -1976,88 +2142,101 @@ $root.org = (function() { } /** - * GetDataContractRequest id. - * @member {Uint8Array} id - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * GetIdentityBalanceResponse balance. + * @member {google.protobuf.IUInt64Value|null|undefined} balance + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse * @instance */ - GetDataContractRequest.prototype.id = $util.newBuffer([]); + GetIdentityBalanceResponse.prototype.balance = null; /** - * GetDataContractRequest prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * GetIdentityBalanceResponse proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse * @instance */ - GetDataContractRequest.prototype.prove = false; + GetIdentityBalanceResponse.prototype.proof = null; /** - * Creates a new GetDataContractRequest instance using the specified properties. + * GetIdentityBalanceResponse metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse + * @instance + */ + GetIdentityBalanceResponse.prototype.metadata = null; + + /** + * Creates a new GetIdentityBalanceResponse instance using the specified properties. * @function create - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse * @static - * @param {org.dash.platform.dapi.v0.IGetDataContractRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDataContractRequest} GetDataContractRequest instance + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceResponse} GetIdentityBalanceResponse instance */ - GetDataContractRequest.create = function create(properties) { - return new GetDataContractRequest(properties); + GetIdentityBalanceResponse.create = function create(properties) { + return new GetIdentityBalanceResponse(properties); }; /** - * Encodes the specified GetDataContractRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractRequest.verify|verify} messages. + * Encodes the specified GetIdentityBalanceResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceResponse.verify|verify} messages. * @function encode - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse * @static - * @param {org.dash.platform.dapi.v0.IGetDataContractRequest} message GetDataContractRequest message or plain object to encode + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceResponse} message GetIdentityBalanceResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetDataContractRequest.encode = function encode(message, writer) { + GetIdentityBalanceResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.id); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + if (message.balance != null && Object.hasOwnProperty.call(message, "balance")) + $root.google.protobuf.UInt64Value.encode(message.balance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified GetDataContractRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractRequest.verify|verify} messages. + * Encodes the specified GetIdentityBalanceResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceResponse.verify|verify} messages. * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse * @static - * @param {org.dash.platform.dapi.v0.IGetDataContractRequest} message GetDataContractRequest message or plain object to encode + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceResponse} message GetIdentityBalanceResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetDataContractRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetIdentityBalanceResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetDataContractRequest message from the specified reader or buffer. + * Decodes a GetIdentityBalanceResponse message from the specified reader or buffer. * @function decode - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDataContractRequest} GetDataContractRequest + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceResponse} GetIdentityBalanceResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetDataContractRequest.decode = function decode(reader, length) { + GetIdentityBalanceResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.id = reader.bytes(); + message.balance = $root.google.protobuf.UInt64Value.decode(reader, reader.uint32()); break; case 2: - message.prove = reader.bool(); + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -2068,127 +2247,142 @@ $root.org = (function() { }; /** - * Decodes a GetDataContractRequest message from the specified reader or buffer, length delimited. + * Decodes a GetIdentityBalanceResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDataContractRequest} GetDataContractRequest + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceResponse} GetIdentityBalanceResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetDataContractRequest.decodeDelimited = function decodeDelimited(reader) { + GetIdentityBalanceResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetDataContractRequest message. + * Verifies a GetIdentityBalanceResponse message. * @function verify - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetDataContractRequest.verify = function verify(message) { + GetIdentityBalanceResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) - return "id: buffer expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; + if (message.balance != null && message.hasOwnProperty("balance")) { + var error = $root.google.protobuf.UInt64Value.verify(message.balance); + if (error) + return "balance." + error; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } return null; }; /** - * Creates a GetDataContractRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetIdentityBalanceResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse * @static * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDataContractRequest} GetDataContractRequest + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceResponse} GetIdentityBalanceResponse */ - GetDataContractRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractRequest) + GetIdentityBalanceResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse) return object; - var message = new $root.org.dash.platform.dapi.v0.GetDataContractRequest(); - if (object.id != null) - if (typeof object.id === "string") - $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0); - else if (object.id.length >= 0) - message.id = object.id; - if (object.prove != null) - message.prove = Boolean(object.prove); + var message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceResponse(); + if (object.balance != null) { + if (typeof object.balance !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceResponse.balance: object expected"); + message.balance = $root.google.protobuf.UInt64Value.fromObject(object.balance); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceResponse.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceResponse.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } return message; }; /** - * Creates a plain object from a GetDataContractRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetIdentityBalanceResponse message. Also converts values to other types if specified. * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse * @static - * @param {org.dash.platform.dapi.v0.GetDataContractRequest} message GetDataContractRequest + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceResponse} message GetIdentityBalanceResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetDataContractRequest.toObject = function toObject(message, options) { + GetIdentityBalanceResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - if (options.bytes === String) - object.id = ""; - else { - object.id = []; - if (options.bytes !== Array) - object.id = $util.newBuffer(object.id); - } - object.prove = false; + object.balance = null; + object.proof = null; + object.metadata = null; } - if (message.id != null && message.hasOwnProperty("id")) - object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; + if (message.balance != null && message.hasOwnProperty("balance")) + object.balance = $root.google.protobuf.UInt64Value.toObject(message.balance, options); + if (message.proof != null && message.hasOwnProperty("proof")) + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); return object; }; /** - * Converts this GetDataContractRequest to JSON. + * Converts this GetIdentityBalanceResponse to JSON. * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDataContractRequest + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceResponse * @instance * @returns {Object.} JSON object */ - GetDataContractRequest.prototype.toJSON = function toJSON() { + GetIdentityBalanceResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetDataContractRequest; + return GetIdentityBalanceResponse; })(); - v0.GetDataContractResponse = (function() { + v0.GetIdentityBalanceAndRevisionResponse = (function() { /** - * Properties of a GetDataContractResponse. + * Properties of a GetIdentityBalanceAndRevisionResponse. * @memberof org.dash.platform.dapi.v0 - * @interface IGetDataContractResponse - * @property {Uint8Array|null} [dataContract] GetDataContractResponse dataContract - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetDataContractResponse proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetDataContractResponse metadata + * @interface IGetIdentityBalanceAndRevisionResponse + * @property {google.protobuf.IUInt64Value|null} [balance] GetIdentityBalanceAndRevisionResponse balance + * @property {google.protobuf.IUInt64Value|null} [revision] GetIdentityBalanceAndRevisionResponse revision + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityBalanceAndRevisionResponse proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityBalanceAndRevisionResponse metadata */ /** - * Constructs a new GetDataContractResponse. + * Constructs a new GetIdentityBalanceAndRevisionResponse. * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetDataContractResponse. - * @implements IGetDataContractResponse + * @classdesc Represents a GetIdentityBalanceAndRevisionResponse. + * @implements IGetIdentityBalanceAndRevisionResponse * @constructor - * @param {org.dash.platform.dapi.v0.IGetDataContractResponse=} [properties] Properties to set + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionResponse=} [properties] Properties to set */ - function GetDataContractResponse(properties) { + function GetIdentityBalanceAndRevisionResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2196,100 +2390,113 @@ $root.org = (function() { } /** - * GetDataContractResponse dataContract. - * @member {Uint8Array} dataContract - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * GetIdentityBalanceAndRevisionResponse balance. + * @member {google.protobuf.IUInt64Value|null|undefined} balance + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse * @instance */ - GetDataContractResponse.prototype.dataContract = $util.newBuffer([]); + GetIdentityBalanceAndRevisionResponse.prototype.balance = null; /** - * GetDataContractResponse proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * GetIdentityBalanceAndRevisionResponse revision. + * @member {google.protobuf.IUInt64Value|null|undefined} revision + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse * @instance */ - GetDataContractResponse.prototype.proof = null; + GetIdentityBalanceAndRevisionResponse.prototype.revision = null; /** - * GetDataContractResponse metadata. + * GetIdentityBalanceAndRevisionResponse proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse + * @instance + */ + GetIdentityBalanceAndRevisionResponse.prototype.proof = null; + + /** + * GetIdentityBalanceAndRevisionResponse metadata. * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse * @instance */ - GetDataContractResponse.prototype.metadata = null; + GetIdentityBalanceAndRevisionResponse.prototype.metadata = null; /** - * Creates a new GetDataContractResponse instance using the specified properties. + * Creates a new GetIdentityBalanceAndRevisionResponse instance using the specified properties. * @function create - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse * @static - * @param {org.dash.platform.dapi.v0.IGetDataContractResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDataContractResponse} GetDataContractResponse instance + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} GetIdentityBalanceAndRevisionResponse instance */ - GetDataContractResponse.create = function create(properties) { - return new GetDataContractResponse(properties); + GetIdentityBalanceAndRevisionResponse.create = function create(properties) { + return new GetIdentityBalanceAndRevisionResponse(properties); }; /** - * Encodes the specified GetDataContractResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractResponse.verify|verify} messages. + * Encodes the specified GetIdentityBalanceAndRevisionResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.verify|verify} messages. * @function encode - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse * @static - * @param {org.dash.platform.dapi.v0.IGetDataContractResponse} message GetDataContractResponse message or plain object to encode + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionResponse} message GetIdentityBalanceAndRevisionResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetDataContractResponse.encode = function encode(message, writer) { + GetIdentityBalanceAndRevisionResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.dataContract != null && Object.hasOwnProperty.call(message, "dataContract")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.dataContract); + if (message.balance != null && Object.hasOwnProperty.call(message, "balance")) + $root.google.protobuf.UInt64Value.encode(message.balance, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.revision != null && Object.hasOwnProperty.call(message, "revision")) + $root.google.protobuf.UInt64Value.encode(message.revision, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); return writer; }; /** - * Encodes the specified GetDataContractResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractResponse.verify|verify} messages. + * Encodes the specified GetIdentityBalanceAndRevisionResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.verify|verify} messages. * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse * @static - * @param {org.dash.platform.dapi.v0.IGetDataContractResponse} message GetDataContractResponse message or plain object to encode + * @param {org.dash.platform.dapi.v0.IGetIdentityBalanceAndRevisionResponse} message GetIdentityBalanceAndRevisionResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetDataContractResponse.encodeDelimited = function encodeDelimited(message, writer) { + GetIdentityBalanceAndRevisionResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetDataContractResponse message from the specified reader or buffer. + * Decodes a GetIdentityBalanceAndRevisionResponse message from the specified reader or buffer. * @function decode - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDataContractResponse} GetDataContractResponse + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} GetIdentityBalanceAndRevisionResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetDataContractResponse.decode = function decode(reader, length) { + GetIdentityBalanceAndRevisionResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.dataContract = reader.bytes(); + message.balance = $root.google.protobuf.UInt64Value.decode(reader, reader.uint32()); break; case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + message.revision = $root.google.protobuf.UInt64Value.decode(reader, reader.uint32()); break; case 3: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 4: message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); break; default: @@ -2301,35 +2508,42 @@ $root.org = (function() { }; /** - * Decodes a GetDataContractResponse message from the specified reader or buffer, length delimited. + * Decodes a GetIdentityBalanceAndRevisionResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDataContractResponse} GetDataContractResponse + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} GetIdentityBalanceAndRevisionResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetDataContractResponse.decodeDelimited = function decodeDelimited(reader) { + GetIdentityBalanceAndRevisionResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetDataContractResponse message. + * Verifies a GetIdentityBalanceAndRevisionResponse message. * @function verify - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetDataContractResponse.verify = function verify(message) { + GetIdentityBalanceAndRevisionResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.dataContract != null && message.hasOwnProperty("dataContract")) - if (!(message.dataContract && typeof message.dataContract.length === "number" || $util.isString(message.dataContract))) - return "dataContract: buffer expected"; + if (message.balance != null && message.hasOwnProperty("balance")) { + var error = $root.google.protobuf.UInt64Value.verify(message.balance); + if (error) + return "balance." + error; + } + if (message.revision != null && message.hasOwnProperty("revision")) { + var error = $root.google.protobuf.UInt64Value.verify(message.revision); + if (error) + return "revision." + error; + } if (message.proof != null && message.hasOwnProperty("proof")) { var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); if (error) @@ -2344,61 +2558,63 @@ $root.org = (function() { }; /** - * Creates a GetDataContractResponse message from a plain object. Also converts values to their respective internal types. + * Creates a GetIdentityBalanceAndRevisionResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse * @static * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDataContractResponse} GetDataContractResponse + * @returns {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} GetIdentityBalanceAndRevisionResponse */ - GetDataContractResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractResponse) + GetIdentityBalanceAndRevisionResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse) return object; - var message = new $root.org.dash.platform.dapi.v0.GetDataContractResponse(); - if (object.dataContract != null) - if (typeof object.dataContract === "string") - $util.base64.decode(object.dataContract, message.dataContract = $util.newBuffer($util.base64.length(object.dataContract)), 0); - else if (object.dataContract.length >= 0) - message.dataContract = object.dataContract; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse(); + if (object.balance != null) { + if (typeof object.balance !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.balance: object expected"); + message.balance = $root.google.protobuf.UInt64Value.fromObject(object.balance); + } + if (object.revision != null) { + if (typeof object.revision !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.revision: object expected"); + message.revision = $root.google.protobuf.UInt64Value.fromObject(object.revision); + } if (object.proof != null) { if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDataContractResponse.proof: object expected"); + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.proof: object expected"); message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); } if (object.metadata != null) { if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDataContractResponse.metadata: object expected"); + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.metadata: object expected"); message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); } return message; }; /** - * Creates a plain object from a GetDataContractResponse message. Also converts values to other types if specified. + * Creates a plain object from a GetIdentityBalanceAndRevisionResponse message. Also converts values to other types if specified. * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse * @static - * @param {org.dash.platform.dapi.v0.GetDataContractResponse} message GetDataContractResponse + * @param {org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} message GetIdentityBalanceAndRevisionResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetDataContractResponse.toObject = function toObject(message, options) { + GetIdentityBalanceAndRevisionResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - if (options.bytes === String) - object.dataContract = ""; - else { - object.dataContract = []; - if (options.bytes !== Array) - object.dataContract = $util.newBuffer(object.dataContract); - } + object.balance = null; + object.revision = null; object.proof = null; object.metadata = null; } - if (message.dataContract != null && message.hasOwnProperty("dataContract")) - object.dataContract = options.bytes === String ? $util.base64.encode(message.dataContract, 0, message.dataContract.length) : options.bytes === Array ? Array.prototype.slice.call(message.dataContract) : message.dataContract; + if (message.balance != null && message.hasOwnProperty("balance")) + object.balance = $root.google.protobuf.UInt64Value.toObject(message.balance, options); + if (message.revision != null && message.hasOwnProperty("revision")) + object.revision = $root.google.protobuf.UInt64Value.toObject(message.revision, options); if (message.proof != null && message.hasOwnProperty("proof")) object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); if (message.metadata != null && message.hasOwnProperty("metadata")) @@ -2407,44 +2623,39 @@ $root.org = (function() { }; /** - * Converts this GetDataContractResponse to JSON. + * Converts this GetIdentityBalanceAndRevisionResponse to JSON. * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @memberof org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse * @instance * @returns {Object.} JSON object */ - GetDataContractResponse.prototype.toJSON = function toJSON() { + GetIdentityBalanceAndRevisionResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetDataContractResponse; + return GetIdentityBalanceAndRevisionResponse; })(); - v0.GetDocumentsRequest = (function() { + v0.KeyRequestType = (function() { /** - * Properties of a GetDocumentsRequest. + * Properties of a KeyRequestType. * @memberof org.dash.platform.dapi.v0 - * @interface IGetDocumentsRequest - * @property {Uint8Array|null} [dataContractId] GetDocumentsRequest dataContractId - * @property {string|null} [documentType] GetDocumentsRequest documentType - * @property {Uint8Array|null} [where] GetDocumentsRequest where - * @property {Uint8Array|null} [orderBy] GetDocumentsRequest orderBy - * @property {number|null} [limit] GetDocumentsRequest limit - * @property {Uint8Array|null} [startAfter] GetDocumentsRequest startAfter - * @property {Uint8Array|null} [startAt] GetDocumentsRequest startAt - * @property {boolean|null} [prove] GetDocumentsRequest prove + * @interface IKeyRequestType + * @property {org.dash.platform.dapi.v0.IAllKeys|null} [allKeys] KeyRequestType allKeys + * @property {org.dash.platform.dapi.v0.ISpecificKeys|null} [specificKeys] KeyRequestType specificKeys + * @property {org.dash.platform.dapi.v0.ISearchKey|null} [searchKey] KeyRequestType searchKey */ /** - * Constructs a new GetDocumentsRequest. + * Constructs a new KeyRequestType. * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetDocumentsRequest. - * @implements IGetDocumentsRequest + * @classdesc Represents a KeyRequestType. + * @implements IKeyRequestType * @constructor - * @param {org.dash.platform.dapi.v0.IGetDocumentsRequest=} [properties] Properties to set + * @param {org.dash.platform.dapi.v0.IKeyRequestType=} [properties] Properties to set */ - function GetDocumentsRequest(properties) { + function KeyRequestType(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2452,180 +2663,115 @@ $root.org = (function() { } /** - * GetDocumentsRequest dataContractId. - * @member {Uint8Array} dataContractId - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest - * @instance - */ - GetDocumentsRequest.prototype.dataContractId = $util.newBuffer([]); - - /** - * GetDocumentsRequest documentType. - * @member {string} documentType - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest - * @instance - */ - GetDocumentsRequest.prototype.documentType = ""; - - /** - * GetDocumentsRequest where. - * @member {Uint8Array} where - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest - * @instance - */ - GetDocumentsRequest.prototype.where = $util.newBuffer([]); - - /** - * GetDocumentsRequest orderBy. - * @member {Uint8Array} orderBy - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest - * @instance - */ - GetDocumentsRequest.prototype.orderBy = $util.newBuffer([]); - - /** - * GetDocumentsRequest limit. - * @member {number} limit - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest - * @instance - */ - GetDocumentsRequest.prototype.limit = 0; - - /** - * GetDocumentsRequest startAfter. - * @member {Uint8Array} startAfter - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * KeyRequestType allKeys. + * @member {org.dash.platform.dapi.v0.IAllKeys|null|undefined} allKeys + * @memberof org.dash.platform.dapi.v0.KeyRequestType * @instance */ - GetDocumentsRequest.prototype.startAfter = $util.newBuffer([]); + KeyRequestType.prototype.allKeys = null; /** - * GetDocumentsRequest startAt. - * @member {Uint8Array} startAt - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * KeyRequestType specificKeys. + * @member {org.dash.platform.dapi.v0.ISpecificKeys|null|undefined} specificKeys + * @memberof org.dash.platform.dapi.v0.KeyRequestType * @instance */ - GetDocumentsRequest.prototype.startAt = $util.newBuffer([]); + KeyRequestType.prototype.specificKeys = null; /** - * GetDocumentsRequest prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * KeyRequestType searchKey. + * @member {org.dash.platform.dapi.v0.ISearchKey|null|undefined} searchKey + * @memberof org.dash.platform.dapi.v0.KeyRequestType * @instance */ - GetDocumentsRequest.prototype.prove = false; + KeyRequestType.prototype.searchKey = null; // OneOf field names bound to virtual getters and setters var $oneOfFields; /** - * GetDocumentsRequest start. - * @member {"startAfter"|"startAt"|undefined} start - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * KeyRequestType request. + * @member {"allKeys"|"specificKeys"|"searchKey"|undefined} request + * @memberof org.dash.platform.dapi.v0.KeyRequestType * @instance */ - Object.defineProperty(GetDocumentsRequest.prototype, "start", { - get: $util.oneOfGetter($oneOfFields = ["startAfter", "startAt"]), + Object.defineProperty(KeyRequestType.prototype, "request", { + get: $util.oneOfGetter($oneOfFields = ["allKeys", "specificKeys", "searchKey"]), set: $util.oneOfSetter($oneOfFields) }); /** - * Creates a new GetDocumentsRequest instance using the specified properties. + * Creates a new KeyRequestType instance using the specified properties. * @function create - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @memberof org.dash.platform.dapi.v0.KeyRequestType * @static - * @param {org.dash.platform.dapi.v0.IGetDocumentsRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest} GetDocumentsRequest instance + * @param {org.dash.platform.dapi.v0.IKeyRequestType=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.KeyRequestType} KeyRequestType instance */ - GetDocumentsRequest.create = function create(properties) { - return new GetDocumentsRequest(properties); + KeyRequestType.create = function create(properties) { + return new KeyRequestType(properties); }; /** - * Encodes the specified GetDocumentsRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsRequest.verify|verify} messages. + * Encodes the specified KeyRequestType message. Does not implicitly {@link org.dash.platform.dapi.v0.KeyRequestType.verify|verify} messages. * @function encode - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @memberof org.dash.platform.dapi.v0.KeyRequestType * @static - * @param {org.dash.platform.dapi.v0.IGetDocumentsRequest} message GetDocumentsRequest message or plain object to encode + * @param {org.dash.platform.dapi.v0.IKeyRequestType} message KeyRequestType message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetDocumentsRequest.encode = function encode(message, writer) { + KeyRequestType.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.dataContractId != null && Object.hasOwnProperty.call(message, "dataContractId")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.dataContractId); - if (message.documentType != null && Object.hasOwnProperty.call(message, "documentType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.documentType); - if (message.where != null && Object.hasOwnProperty.call(message, "where")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.where); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.orderBy); - if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) - writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.limit); - if (message.startAfter != null && Object.hasOwnProperty.call(message, "startAfter")) - writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.startAfter); - if (message.startAt != null && Object.hasOwnProperty.call(message, "startAt")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.startAt); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.prove); + if (message.allKeys != null && Object.hasOwnProperty.call(message, "allKeys")) + $root.org.dash.platform.dapi.v0.AllKeys.encode(message.allKeys, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.specificKeys != null && Object.hasOwnProperty.call(message, "specificKeys")) + $root.org.dash.platform.dapi.v0.SpecificKeys.encode(message.specificKeys, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.searchKey != null && Object.hasOwnProperty.call(message, "searchKey")) + $root.org.dash.platform.dapi.v0.SearchKey.encode(message.searchKey, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified GetDocumentsRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsRequest.verify|verify} messages. + * Encodes the specified KeyRequestType message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.KeyRequestType.verify|verify} messages. * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @memberof org.dash.platform.dapi.v0.KeyRequestType * @static - * @param {org.dash.platform.dapi.v0.IGetDocumentsRequest} message GetDocumentsRequest message or plain object to encode + * @param {org.dash.platform.dapi.v0.IKeyRequestType} message KeyRequestType message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetDocumentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + KeyRequestType.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetDocumentsRequest message from the specified reader or buffer. + * Decodes a KeyRequestType message from the specified reader or buffer. * @function decode - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @memberof org.dash.platform.dapi.v0.KeyRequestType * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest} GetDocumentsRequest + * @returns {org.dash.platform.dapi.v0.KeyRequestType} KeyRequestType * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetDocumentsRequest.decode = function decode(reader, length) { + KeyRequestType.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.KeyRequestType(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.dataContractId = reader.bytes(); + message.allKeys = $root.org.dash.platform.dapi.v0.AllKeys.decode(reader, reader.uint32()); break; case 2: - message.documentType = reader.string(); + message.specificKeys = $root.org.dash.platform.dapi.v0.SpecificKeys.decode(reader, reader.uint32()); break; case 3: - message.where = reader.bytes(); - break; - case 4: - message.orderBy = reader.bytes(); - break; - case 5: - message.limit = reader.uint32(); - break; - case 6: - message.startAfter = reader.bytes(); - break; - case 7: - message.startAt = reader.bytes(); - break; - case 8: - message.prove = reader.bool(); + message.searchKey = $root.org.dash.platform.dapi.v0.SearchKey.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -2636,211 +2782,156 @@ $root.org = (function() { }; /** - * Decodes a GetDocumentsRequest message from the specified reader or buffer, length delimited. + * Decodes a KeyRequestType message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @memberof org.dash.platform.dapi.v0.KeyRequestType * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest} GetDocumentsRequest + * @returns {org.dash.platform.dapi.v0.KeyRequestType} KeyRequestType * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetDocumentsRequest.decodeDelimited = function decodeDelimited(reader) { + KeyRequestType.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetDocumentsRequest message. + * Verifies a KeyRequestType message. * @function verify - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @memberof org.dash.platform.dapi.v0.KeyRequestType * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetDocumentsRequest.verify = function verify(message) { + KeyRequestType.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; var properties = {}; - if (message.dataContractId != null && message.hasOwnProperty("dataContractId")) - if (!(message.dataContractId && typeof message.dataContractId.length === "number" || $util.isString(message.dataContractId))) - return "dataContractId: buffer expected"; - if (message.documentType != null && message.hasOwnProperty("documentType")) - if (!$util.isString(message.documentType)) - return "documentType: string expected"; - if (message.where != null && message.hasOwnProperty("where")) - if (!(message.where && typeof message.where.length === "number" || $util.isString(message.where))) - return "where: buffer expected"; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - if (!(message.orderBy && typeof message.orderBy.length === "number" || $util.isString(message.orderBy))) - return "orderBy: buffer expected"; - if (message.limit != null && message.hasOwnProperty("limit")) - if (!$util.isInteger(message.limit)) - return "limit: integer expected"; - if (message.startAfter != null && message.hasOwnProperty("startAfter")) { - properties.start = 1; - if (!(message.startAfter && typeof message.startAfter.length === "number" || $util.isString(message.startAfter))) - return "startAfter: buffer expected"; + if (message.allKeys != null && message.hasOwnProperty("allKeys")) { + properties.request = 1; + { + var error = $root.org.dash.platform.dapi.v0.AllKeys.verify(message.allKeys); + if (error) + return "allKeys." + error; + } } - if (message.startAt != null && message.hasOwnProperty("startAt")) { - if (properties.start === 1) - return "start: multiple values"; - properties.start = 1; - if (!(message.startAt && typeof message.startAt.length === "number" || $util.isString(message.startAt))) - return "startAt: buffer expected"; + if (message.specificKeys != null && message.hasOwnProperty("specificKeys")) { + if (properties.request === 1) + return "request: multiple values"; + properties.request = 1; + { + var error = $root.org.dash.platform.dapi.v0.SpecificKeys.verify(message.specificKeys); + if (error) + return "specificKeys." + error; + } + } + if (message.searchKey != null && message.hasOwnProperty("searchKey")) { + if (properties.request === 1) + return "request: multiple values"; + properties.request = 1; + { + var error = $root.org.dash.platform.dapi.v0.SearchKey.verify(message.searchKey); + if (error) + return "searchKey." + error; + } } - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; return null; }; /** - * Creates a GetDocumentsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a KeyRequestType message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @memberof org.dash.platform.dapi.v0.KeyRequestType * @static * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest} GetDocumentsRequest + * @returns {org.dash.platform.dapi.v0.KeyRequestType} KeyRequestType */ - GetDocumentsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsRequest) + KeyRequestType.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.KeyRequestType) return object; - var message = new $root.org.dash.platform.dapi.v0.GetDocumentsRequest(); - if (object.dataContractId != null) - if (typeof object.dataContractId === "string") - $util.base64.decode(object.dataContractId, message.dataContractId = $util.newBuffer($util.base64.length(object.dataContractId)), 0); - else if (object.dataContractId.length >= 0) - message.dataContractId = object.dataContractId; - if (object.documentType != null) - message.documentType = String(object.documentType); - if (object.where != null) - if (typeof object.where === "string") - $util.base64.decode(object.where, message.where = $util.newBuffer($util.base64.length(object.where)), 0); - else if (object.where.length >= 0) - message.where = object.where; - if (object.orderBy != null) - if (typeof object.orderBy === "string") - $util.base64.decode(object.orderBy, message.orderBy = $util.newBuffer($util.base64.length(object.orderBy)), 0); - else if (object.orderBy.length >= 0) - message.orderBy = object.orderBy; - if (object.limit != null) - message.limit = object.limit >>> 0; - if (object.startAfter != null) - if (typeof object.startAfter === "string") - $util.base64.decode(object.startAfter, message.startAfter = $util.newBuffer($util.base64.length(object.startAfter)), 0); - else if (object.startAfter.length >= 0) - message.startAfter = object.startAfter; - if (object.startAt != null) - if (typeof object.startAt === "string") - $util.base64.decode(object.startAt, message.startAt = $util.newBuffer($util.base64.length(object.startAt)), 0); - else if (object.startAt.length >= 0) - message.startAt = object.startAt; - if (object.prove != null) - message.prove = Boolean(object.prove); + var message = new $root.org.dash.platform.dapi.v0.KeyRequestType(); + if (object.allKeys != null) { + if (typeof object.allKeys !== "object") + throw TypeError(".org.dash.platform.dapi.v0.KeyRequestType.allKeys: object expected"); + message.allKeys = $root.org.dash.platform.dapi.v0.AllKeys.fromObject(object.allKeys); + } + if (object.specificKeys != null) { + if (typeof object.specificKeys !== "object") + throw TypeError(".org.dash.platform.dapi.v0.KeyRequestType.specificKeys: object expected"); + message.specificKeys = $root.org.dash.platform.dapi.v0.SpecificKeys.fromObject(object.specificKeys); + } + if (object.searchKey != null) { + if (typeof object.searchKey !== "object") + throw TypeError(".org.dash.platform.dapi.v0.KeyRequestType.searchKey: object expected"); + message.searchKey = $root.org.dash.platform.dapi.v0.SearchKey.fromObject(object.searchKey); + } return message; }; /** - * Creates a plain object from a GetDocumentsRequest message. Also converts values to other types if specified. + * Creates a plain object from a KeyRequestType message. Also converts values to other types if specified. * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @memberof org.dash.platform.dapi.v0.KeyRequestType * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsRequest} message GetDocumentsRequest + * @param {org.dash.platform.dapi.v0.KeyRequestType} message KeyRequestType * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetDocumentsRequest.toObject = function toObject(message, options) { + KeyRequestType.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.dataContractId = ""; - else { - object.dataContractId = []; - if (options.bytes !== Array) - object.dataContractId = $util.newBuffer(object.dataContractId); - } - object.documentType = ""; - if (options.bytes === String) - object.where = ""; - else { - object.where = []; - if (options.bytes !== Array) - object.where = $util.newBuffer(object.where); - } - if (options.bytes === String) - object.orderBy = ""; - else { - object.orderBy = []; - if (options.bytes !== Array) - object.orderBy = $util.newBuffer(object.orderBy); - } - object.limit = 0; - object.prove = false; + if (message.allKeys != null && message.hasOwnProperty("allKeys")) { + object.allKeys = $root.org.dash.platform.dapi.v0.AllKeys.toObject(message.allKeys, options); + if (options.oneofs) + object.request = "allKeys"; } - if (message.dataContractId != null && message.hasOwnProperty("dataContractId")) - object.dataContractId = options.bytes === String ? $util.base64.encode(message.dataContractId, 0, message.dataContractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.dataContractId) : message.dataContractId; - if (message.documentType != null && message.hasOwnProperty("documentType")) - object.documentType = message.documentType; - if (message.where != null && message.hasOwnProperty("where")) - object.where = options.bytes === String ? $util.base64.encode(message.where, 0, message.where.length) : options.bytes === Array ? Array.prototype.slice.call(message.where) : message.where; - if (message.orderBy != null && message.hasOwnProperty("orderBy")) - object.orderBy = options.bytes === String ? $util.base64.encode(message.orderBy, 0, message.orderBy.length) : options.bytes === Array ? Array.prototype.slice.call(message.orderBy) : message.orderBy; - if (message.limit != null && message.hasOwnProperty("limit")) - object.limit = message.limit; - if (message.startAfter != null && message.hasOwnProperty("startAfter")) { - object.startAfter = options.bytes === String ? $util.base64.encode(message.startAfter, 0, message.startAfter.length) : options.bytes === Array ? Array.prototype.slice.call(message.startAfter) : message.startAfter; + if (message.specificKeys != null && message.hasOwnProperty("specificKeys")) { + object.specificKeys = $root.org.dash.platform.dapi.v0.SpecificKeys.toObject(message.specificKeys, options); if (options.oneofs) - object.start = "startAfter"; + object.request = "specificKeys"; } - if (message.startAt != null && message.hasOwnProperty("startAt")) { - object.startAt = options.bytes === String ? $util.base64.encode(message.startAt, 0, message.startAt.length) : options.bytes === Array ? Array.prototype.slice.call(message.startAt) : message.startAt; + if (message.searchKey != null && message.hasOwnProperty("searchKey")) { + object.searchKey = $root.org.dash.platform.dapi.v0.SearchKey.toObject(message.searchKey, options); if (options.oneofs) - object.start = "startAt"; + object.request = "searchKey"; } - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; return object; }; /** - * Converts this GetDocumentsRequest to JSON. + * Converts this KeyRequestType to JSON. * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @memberof org.dash.platform.dapi.v0.KeyRequestType * @instance * @returns {Object.} JSON object */ - GetDocumentsRequest.prototype.toJSON = function toJSON() { + KeyRequestType.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetDocumentsRequest; + return KeyRequestType; })(); - v0.GetDocumentsResponse = (function() { + v0.AllKeys = (function() { /** - * Properties of a GetDocumentsResponse. + * Properties of an AllKeys. * @memberof org.dash.platform.dapi.v0 - * @interface IGetDocumentsResponse - * @property {Array.|null} [documents] GetDocumentsResponse documents - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetDocumentsResponse proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetDocumentsResponse metadata + * @interface IAllKeys */ /** - * Constructs a new GetDocumentsResponse. + * Constructs a new AllKeys. * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetDocumentsResponse. - * @implements IGetDocumentsResponse + * @classdesc Represents an AllKeys. + * @implements IAllKeys * @constructor - * @param {org.dash.platform.dapi.v0.IGetDocumentsResponse=} [properties] Properties to set + * @param {org.dash.platform.dapi.v0.IAllKeys=} [properties] Properties to set */ - function GetDocumentsResponse(properties) { - this.documents = []; + function AllKeys(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2848,105 +2939,63 @@ $root.org = (function() { } /** - * GetDocumentsResponse documents. - * @member {Array.} documents - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @instance - */ - GetDocumentsResponse.prototype.documents = $util.emptyArray; - - /** - * GetDocumentsResponse proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @instance - */ - GetDocumentsResponse.prototype.proof = null; - - /** - * GetDocumentsResponse metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse - * @instance - */ - GetDocumentsResponse.prototype.metadata = null; - - /** - * Creates a new GetDocumentsResponse instance using the specified properties. + * Creates a new AllKeys instance using the specified properties. * @function create - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @memberof org.dash.platform.dapi.v0.AllKeys * @static - * @param {org.dash.platform.dapi.v0.IGetDocumentsResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse} GetDocumentsResponse instance + * @param {org.dash.platform.dapi.v0.IAllKeys=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.AllKeys} AllKeys instance */ - GetDocumentsResponse.create = function create(properties) { - return new GetDocumentsResponse(properties); + AllKeys.create = function create(properties) { + return new AllKeys(properties); }; /** - * Encodes the specified GetDocumentsResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.verify|verify} messages. + * Encodes the specified AllKeys message. Does not implicitly {@link org.dash.platform.dapi.v0.AllKeys.verify|verify} messages. * @function encode - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @memberof org.dash.platform.dapi.v0.AllKeys * @static - * @param {org.dash.platform.dapi.v0.IGetDocumentsResponse} message GetDocumentsResponse message or plain object to encode + * @param {org.dash.platform.dapi.v0.IAllKeys} message AllKeys message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetDocumentsResponse.encode = function encode(message, writer) { + AllKeys.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.documents != null && message.documents.length) - for (var i = 0; i < message.documents.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.documents[i]); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified GetDocumentsResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.verify|verify} messages. + * Encodes the specified AllKeys message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.AllKeys.verify|verify} messages. * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @memberof org.dash.platform.dapi.v0.AllKeys * @static - * @param {org.dash.platform.dapi.v0.IGetDocumentsResponse} message GetDocumentsResponse message or plain object to encode + * @param {org.dash.platform.dapi.v0.IAllKeys} message AllKeys message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetDocumentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + AllKeys.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetDocumentsResponse message from the specified reader or buffer. + * Decodes an AllKeys message from the specified reader or buffer. * @function decode - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @memberof org.dash.platform.dapi.v0.AllKeys * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse} GetDocumentsResponse + * @returns {org.dash.platform.dapi.v0.AllKeys} AllKeys * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetDocumentsResponse.decode = function decode(reader, length) { + AllKeys.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.AllKeys(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { - case 1: - if (!(message.documents && message.documents.length)) - message.documents = []; - message.documents.push(reader.bytes()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); - break; default: reader.skipType(tag & 7); break; @@ -2956,152 +3005,95 @@ $root.org = (function() { }; /** - * Decodes a GetDocumentsResponse message from the specified reader or buffer, length delimited. + * Decodes an AllKeys message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @memberof org.dash.platform.dapi.v0.AllKeys * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse} GetDocumentsResponse + * @returns {org.dash.platform.dapi.v0.AllKeys} AllKeys * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetDocumentsResponse.decodeDelimited = function decodeDelimited(reader) { + AllKeys.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetDocumentsResponse message. + * Verifies an AllKeys message. * @function verify - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @memberof org.dash.platform.dapi.v0.AllKeys * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetDocumentsResponse.verify = function verify(message) { + AllKeys.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.documents != null && message.hasOwnProperty("documents")) { - if (!Array.isArray(message.documents)) - return "documents: array expected"; - for (var i = 0; i < message.documents.length; ++i) - if (!(message.documents[i] && typeof message.documents[i].length === "number" || $util.isString(message.documents[i]))) - return "documents: buffer[] expected"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; - } return null; }; /** - * Creates a GetDocumentsResponse message from a plain object. Also converts values to their respective internal types. + * Creates an AllKeys message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @memberof org.dash.platform.dapi.v0.AllKeys * @static * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse} GetDocumentsResponse + * @returns {org.dash.platform.dapi.v0.AllKeys} AllKeys */ - GetDocumentsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsResponse) + AllKeys.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.AllKeys) return object; - var message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse(); - if (object.documents) { - if (!Array.isArray(object.documents)) - throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.documents: array expected"); - message.documents = []; - for (var i = 0; i < object.documents.length; ++i) - if (typeof object.documents[i] === "string") - $util.base64.decode(object.documents[i], message.documents[i] = $util.newBuffer($util.base64.length(object.documents[i])), 0); - else if (object.documents[i].length >= 0) - message.documents[i] = object.documents[i]; - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); - } - return message; + return new $root.org.dash.platform.dapi.v0.AllKeys(); }; /** - * Creates a plain object from a GetDocumentsResponse message. Also converts values to other types if specified. + * Creates a plain object from an AllKeys message. Also converts values to other types if specified. * @function toObject - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @memberof org.dash.platform.dapi.v0.AllKeys * @static - * @param {org.dash.platform.dapi.v0.GetDocumentsResponse} message GetDocumentsResponse + * @param {org.dash.platform.dapi.v0.AllKeys} message AllKeys * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetDocumentsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.documents = []; - if (options.defaults) { - object.proof = null; - object.metadata = null; - } - if (message.documents && message.documents.length) { - object.documents = []; - for (var j = 0; j < message.documents.length; ++j) - object.documents[j] = options.bytes === String ? $util.base64.encode(message.documents[j], 0, message.documents[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.documents[j]) : message.documents[j]; - } - if (message.proof != null && message.hasOwnProperty("proof")) - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); - return object; + AllKeys.toObject = function toObject() { + return {}; }; /** - * Converts this GetDocumentsResponse to JSON. + * Converts this AllKeys to JSON. * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @memberof org.dash.platform.dapi.v0.AllKeys * @instance * @returns {Object.} JSON object */ - GetDocumentsResponse.prototype.toJSON = function toJSON() { + AllKeys.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetDocumentsResponse; + return AllKeys; })(); - v0.GetIdentitiesByPublicKeyHashesRequest = (function() { + v0.SpecificKeys = (function() { /** - * Properties of a GetIdentitiesByPublicKeyHashesRequest. + * Properties of a SpecificKeys. * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentitiesByPublicKeyHashesRequest - * @property {Array.|null} [publicKeyHashes] GetIdentitiesByPublicKeyHashesRequest publicKeyHashes - * @property {boolean|null} [prove] GetIdentitiesByPublicKeyHashesRequest prove + * @interface ISpecificKeys + * @property {Array.|null} [keyIds] SpecificKeys keyIds */ /** - * Constructs a new GetIdentitiesByPublicKeyHashesRequest. + * Constructs a new SpecificKeys. * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentitiesByPublicKeyHashesRequest. - * @implements IGetIdentitiesByPublicKeyHashesRequest + * @classdesc Represents a SpecificKeys. + * @implements ISpecificKeys * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentitiesByPublicKeyHashesRequest=} [properties] Properties to set + * @param {org.dash.platform.dapi.v0.ISpecificKeys=} [properties] Properties to set */ - function GetIdentitiesByPublicKeyHashesRequest(properties) { - this.publicKeyHashes = []; + function SpecificKeys(properties) { + this.keyIds = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3109,91 +3101,86 @@ $root.org = (function() { } /** - * GetIdentitiesByPublicKeyHashesRequest publicKeyHashes. - * @member {Array.} publicKeyHashes - * @memberof org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest + * SpecificKeys keyIds. + * @member {Array.} keyIds + * @memberof org.dash.platform.dapi.v0.SpecificKeys * @instance */ - GetIdentitiesByPublicKeyHashesRequest.prototype.publicKeyHashes = $util.emptyArray; + SpecificKeys.prototype.keyIds = $util.emptyArray; /** - * GetIdentitiesByPublicKeyHashesRequest prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest - * @instance - */ - GetIdentitiesByPublicKeyHashesRequest.prototype.prove = false; - - /** - * Creates a new GetIdentitiesByPublicKeyHashesRequest instance using the specified properties. + * Creates a new SpecificKeys instance using the specified properties. * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest + * @memberof org.dash.platform.dapi.v0.SpecificKeys * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesByPublicKeyHashesRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest} GetIdentitiesByPublicKeyHashesRequest instance + * @param {org.dash.platform.dapi.v0.ISpecificKeys=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.SpecificKeys} SpecificKeys instance */ - GetIdentitiesByPublicKeyHashesRequest.create = function create(properties) { - return new GetIdentitiesByPublicKeyHashesRequest(properties); + SpecificKeys.create = function create(properties) { + return new SpecificKeys(properties); }; /** - * Encodes the specified GetIdentitiesByPublicKeyHashesRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.verify|verify} messages. + * Encodes the specified SpecificKeys message. Does not implicitly {@link org.dash.platform.dapi.v0.SpecificKeys.verify|verify} messages. * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest + * @memberof org.dash.platform.dapi.v0.SpecificKeys * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesByPublicKeyHashesRequest} message GetIdentitiesByPublicKeyHashesRequest message or plain object to encode + * @param {org.dash.platform.dapi.v0.ISpecificKeys} message SpecificKeys message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetIdentitiesByPublicKeyHashesRequest.encode = function encode(message, writer) { + SpecificKeys.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.publicKeyHashes != null && message.publicKeyHashes.length) - for (var i = 0; i < message.publicKeyHashes.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.publicKeyHashes[i]); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + if (message.keyIds != null && message.keyIds.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.keyIds.length; ++i) + writer.uint32(message.keyIds[i]); + writer.ldelim(); + } return writer; }; /** - * Encodes the specified GetIdentitiesByPublicKeyHashesRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.verify|verify} messages. + * Encodes the specified SpecificKeys message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.SpecificKeys.verify|verify} messages. * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest + * @memberof org.dash.platform.dapi.v0.SpecificKeys * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesByPublicKeyHashesRequest} message GetIdentitiesByPublicKeyHashesRequest message or plain object to encode + * @param {org.dash.platform.dapi.v0.ISpecificKeys} message SpecificKeys message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetIdentitiesByPublicKeyHashesRequest.encodeDelimited = function encodeDelimited(message, writer) { + SpecificKeys.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetIdentitiesByPublicKeyHashesRequest message from the specified reader or buffer. + * Decodes a SpecificKeys message from the specified reader or buffer. * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest + * @memberof org.dash.platform.dapi.v0.SpecificKeys * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest} GetIdentitiesByPublicKeyHashesRequest + * @returns {org.dash.platform.dapi.v0.SpecificKeys} SpecificKeys * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetIdentitiesByPublicKeyHashesRequest.decode = function decode(reader, length) { + SpecificKeys.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.SpecificKeys(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.publicKeyHashes && message.publicKeyHashes.length)) - message.publicKeyHashes = []; - message.publicKeyHashes.push(reader.bytes()); - break; - case 2: - message.prove = reader.bool(); + if (!(message.keyIds && message.keyIds.length)) + message.keyIds = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.keyIds.push(reader.uint32()); + } else + message.keyIds.push(reader.uint32()); break; default: reader.skipType(tag & 7); @@ -3204,134 +3191,120 @@ $root.org = (function() { }; /** - * Decodes a GetIdentitiesByPublicKeyHashesRequest message from the specified reader or buffer, length delimited. + * Decodes a SpecificKeys message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest + * @memberof org.dash.platform.dapi.v0.SpecificKeys * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest} GetIdentitiesByPublicKeyHashesRequest + * @returns {org.dash.platform.dapi.v0.SpecificKeys} SpecificKeys * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetIdentitiesByPublicKeyHashesRequest.decodeDelimited = function decodeDelimited(reader) { + SpecificKeys.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetIdentitiesByPublicKeyHashesRequest message. + * Verifies a SpecificKeys message. * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest + * @memberof org.dash.platform.dapi.v0.SpecificKeys * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetIdentitiesByPublicKeyHashesRequest.verify = function verify(message) { + SpecificKeys.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.publicKeyHashes != null && message.hasOwnProperty("publicKeyHashes")) { - if (!Array.isArray(message.publicKeyHashes)) - return "publicKeyHashes: array expected"; - for (var i = 0; i < message.publicKeyHashes.length; ++i) - if (!(message.publicKeyHashes[i] && typeof message.publicKeyHashes[i].length === "number" || $util.isString(message.publicKeyHashes[i]))) - return "publicKeyHashes: buffer[] expected"; + if (message.keyIds != null && message.hasOwnProperty("keyIds")) { + if (!Array.isArray(message.keyIds)) + return "keyIds: array expected"; + for (var i = 0; i < message.keyIds.length; ++i) + if (!$util.isInteger(message.keyIds[i])) + return "keyIds: integer[] expected"; } - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; return null; }; /** - * Creates a GetIdentitiesByPublicKeyHashesRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SpecificKeys message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest + * @memberof org.dash.platform.dapi.v0.SpecificKeys * @static * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest} GetIdentitiesByPublicKeyHashesRequest + * @returns {org.dash.platform.dapi.v0.SpecificKeys} SpecificKeys */ - GetIdentitiesByPublicKeyHashesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest) + SpecificKeys.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.SpecificKeys) return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest(); - if (object.publicKeyHashes) { - if (!Array.isArray(object.publicKeyHashes)) - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.publicKeyHashes: array expected"); - message.publicKeyHashes = []; - for (var i = 0; i < object.publicKeyHashes.length; ++i) - if (typeof object.publicKeyHashes[i] === "string") - $util.base64.decode(object.publicKeyHashes[i], message.publicKeyHashes[i] = $util.newBuffer($util.base64.length(object.publicKeyHashes[i])), 0); - else if (object.publicKeyHashes[i].length >= 0) - message.publicKeyHashes[i] = object.publicKeyHashes[i]; + var message = new $root.org.dash.platform.dapi.v0.SpecificKeys(); + if (object.keyIds) { + if (!Array.isArray(object.keyIds)) + throw TypeError(".org.dash.platform.dapi.v0.SpecificKeys.keyIds: array expected"); + message.keyIds = []; + for (var i = 0; i < object.keyIds.length; ++i) + message.keyIds[i] = object.keyIds[i] >>> 0; } - if (object.prove != null) - message.prove = Boolean(object.prove); return message; }; /** - * Creates a plain object from a GetIdentitiesByPublicKeyHashesRequest message. Also converts values to other types if specified. + * Creates a plain object from a SpecificKeys message. Also converts values to other types if specified. * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest + * @memberof org.dash.platform.dapi.v0.SpecificKeys * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest} message GetIdentitiesByPublicKeyHashesRequest + * @param {org.dash.platform.dapi.v0.SpecificKeys} message SpecificKeys * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetIdentitiesByPublicKeyHashesRequest.toObject = function toObject(message, options) { + SpecificKeys.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.arrays || options.defaults) - object.publicKeyHashes = []; - if (options.defaults) - object.prove = false; - if (message.publicKeyHashes && message.publicKeyHashes.length) { - object.publicKeyHashes = []; - for (var j = 0; j < message.publicKeyHashes.length; ++j) - object.publicKeyHashes[j] = options.bytes === String ? $util.base64.encode(message.publicKeyHashes[j], 0, message.publicKeyHashes[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.publicKeyHashes[j]) : message.publicKeyHashes[j]; + object.keyIds = []; + if (message.keyIds && message.keyIds.length) { + object.keyIds = []; + for (var j = 0; j < message.keyIds.length; ++j) + object.keyIds[j] = message.keyIds[j]; } - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; return object; }; /** - * Converts this GetIdentitiesByPublicKeyHashesRequest to JSON. + * Converts this SpecificKeys to JSON. * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest + * @memberof org.dash.platform.dapi.v0.SpecificKeys * @instance * @returns {Object.} JSON object */ - GetIdentitiesByPublicKeyHashesRequest.prototype.toJSON = function toJSON() { + SpecificKeys.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetIdentitiesByPublicKeyHashesRequest; + return SpecificKeys; })(); - v0.GetIdentitiesByPublicKeyHashesResponse = (function() { + v0.SearchKey = (function() { /** - * Properties of a GetIdentitiesByPublicKeyHashesResponse. + * Properties of a SearchKey. * @memberof org.dash.platform.dapi.v0 - * @interface IGetIdentitiesByPublicKeyHashesResponse - * @property {Array.|null} [identities] GetIdentitiesByPublicKeyHashesResponse identities - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentitiesByPublicKeyHashesResponse proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentitiesByPublicKeyHashesResponse metadata + * @interface ISearchKey + * @property {Object.|null} [purposeMap] SearchKey purposeMap */ /** - * Constructs a new GetIdentitiesByPublicKeyHashesResponse. + * Constructs a new SearchKey. * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetIdentitiesByPublicKeyHashesResponse. - * @implements IGetIdentitiesByPublicKeyHashesResponse + * @classdesc Represents a SearchKey. + * @implements ISearchKey * @constructor - * @param {org.dash.platform.dapi.v0.IGetIdentitiesByPublicKeyHashesResponse=} [properties] Properties to set + * @param {org.dash.platform.dapi.v0.ISearchKey=} [properties] Properties to set */ - function GetIdentitiesByPublicKeyHashesResponse(properties) { - this.identities = []; + function SearchKey(properties) { + this.purposeMap = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3339,104 +3312,97 @@ $root.org = (function() { } /** - * GetIdentitiesByPublicKeyHashesResponse identities. - * @member {Array.} identities - * @memberof org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse - * @instance - */ - GetIdentitiesByPublicKeyHashesResponse.prototype.identities = $util.emptyArray; - - /** - * GetIdentitiesByPublicKeyHashesResponse proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse - * @instance - */ - GetIdentitiesByPublicKeyHashesResponse.prototype.proof = null; - - /** - * GetIdentitiesByPublicKeyHashesResponse metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse + * SearchKey purposeMap. + * @member {Object.} purposeMap + * @memberof org.dash.platform.dapi.v0.SearchKey * @instance */ - GetIdentitiesByPublicKeyHashesResponse.prototype.metadata = null; + SearchKey.prototype.purposeMap = $util.emptyObject; /** - * Creates a new GetIdentitiesByPublicKeyHashesResponse instance using the specified properties. + * Creates a new SearchKey instance using the specified properties. * @function create - * @memberof org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse + * @memberof org.dash.platform.dapi.v0.SearchKey * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesByPublicKeyHashesResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} GetIdentitiesByPublicKeyHashesResponse instance + * @param {org.dash.platform.dapi.v0.ISearchKey=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.SearchKey} SearchKey instance */ - GetIdentitiesByPublicKeyHashesResponse.create = function create(properties) { - return new GetIdentitiesByPublicKeyHashesResponse(properties); + SearchKey.create = function create(properties) { + return new SearchKey(properties); }; /** - * Encodes the specified GetIdentitiesByPublicKeyHashesResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.verify|verify} messages. + * Encodes the specified SearchKey message. Does not implicitly {@link org.dash.platform.dapi.v0.SearchKey.verify|verify} messages. * @function encode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse + * @memberof org.dash.platform.dapi.v0.SearchKey * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesByPublicKeyHashesResponse} message GetIdentitiesByPublicKeyHashesResponse message or plain object to encode + * @param {org.dash.platform.dapi.v0.ISearchKey} message SearchKey message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetIdentitiesByPublicKeyHashesResponse.encode = function encode(message, writer) { + SearchKey.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.identities != null && message.identities.length) - for (var i = 0; i < message.identities.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identities[i]); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.purposeMap != null && Object.hasOwnProperty.call(message, "purposeMap")) + for (var keys = Object.keys(message.purposeMap), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 0 =*/8).uint32(keys[i]); + $root.org.dash.platform.dapi.v0.SecurityLevelMap.encode(message.purposeMap[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } return writer; }; /** - * Encodes the specified GetIdentitiesByPublicKeyHashesResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.verify|verify} messages. + * Encodes the specified SearchKey message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.SearchKey.verify|verify} messages. * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse + * @memberof org.dash.platform.dapi.v0.SearchKey * @static - * @param {org.dash.platform.dapi.v0.IGetIdentitiesByPublicKeyHashesResponse} message GetIdentitiesByPublicKeyHashesResponse message or plain object to encode + * @param {org.dash.platform.dapi.v0.ISearchKey} message SearchKey message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetIdentitiesByPublicKeyHashesResponse.encodeDelimited = function encodeDelimited(message, writer) { + SearchKey.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetIdentitiesByPublicKeyHashesResponse message from the specified reader or buffer. + * Decodes a SearchKey message from the specified reader or buffer. * @function decode - * @memberof org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse + * @memberof org.dash.platform.dapi.v0.SearchKey * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} GetIdentitiesByPublicKeyHashesResponse + * @returns {org.dash.platform.dapi.v0.SearchKey} SearchKey * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetIdentitiesByPublicKeyHashesResponse.decode = function decode(reader, length) { + SearchKey.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.SearchKey(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - if (!(message.identities && message.identities.length)) - message.identities = []; - message.identities.push(reader.bytes()); - break; - case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); - break; - case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + if (message.purposeMap === $util.emptyObject) + message.purposeMap = {}; + var end2 = reader.uint32() + reader.pos; + key = 0; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.uint32(); + break; + case 2: + value = $root.org.dash.platform.dapi.v0.SecurityLevelMap.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.purposeMap[key] = value; break; default: reader.skipType(tag & 7); @@ -3447,151 +3413,131 @@ $root.org = (function() { }; /** - * Decodes a GetIdentitiesByPublicKeyHashesResponse message from the specified reader or buffer, length delimited. + * Decodes a SearchKey message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse + * @memberof org.dash.platform.dapi.v0.SearchKey * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} GetIdentitiesByPublicKeyHashesResponse + * @returns {org.dash.platform.dapi.v0.SearchKey} SearchKey * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetIdentitiesByPublicKeyHashesResponse.decodeDelimited = function decodeDelimited(reader) { + SearchKey.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetIdentitiesByPublicKeyHashesResponse message. + * Verifies a SearchKey message. * @function verify - * @memberof org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse + * @memberof org.dash.platform.dapi.v0.SearchKey * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetIdentitiesByPublicKeyHashesResponse.verify = function verify(message) { + SearchKey.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.identities != null && message.hasOwnProperty("identities")) { - if (!Array.isArray(message.identities)) - return "identities: array expected"; - for (var i = 0; i < message.identities.length; ++i) - if (!(message.identities[i] && typeof message.identities[i].length === "number" || $util.isString(message.identities[i]))) - return "identities: buffer[] expected"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); - if (error) - return "metadata." + error; + if (message.purposeMap != null && message.hasOwnProperty("purposeMap")) { + if (!$util.isObject(message.purposeMap)) + return "purposeMap: object expected"; + var key = Object.keys(message.purposeMap); + for (var i = 0; i < key.length; ++i) { + if (!$util.key32Re.test(key[i])) + return "purposeMap: integer key{k:uint32} expected"; + { + var error = $root.org.dash.platform.dapi.v0.SecurityLevelMap.verify(message.purposeMap[key[i]]); + if (error) + return "purposeMap." + error; + } + } } return null; }; /** - * Creates a GetIdentitiesByPublicKeyHashesResponse message from a plain object. Also converts values to their respective internal types. + * Creates a SearchKey message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse + * @memberof org.dash.platform.dapi.v0.SearchKey * @static * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} GetIdentitiesByPublicKeyHashesResponse + * @returns {org.dash.platform.dapi.v0.SearchKey} SearchKey */ - GetIdentitiesByPublicKeyHashesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse) + SearchKey.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.SearchKey) return object; - var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse(); - if (object.identities) { - if (!Array.isArray(object.identities)) - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.identities: array expected"); - message.identities = []; - for (var i = 0; i < object.identities.length; ++i) - if (typeof object.identities[i] === "string") - $util.base64.decode(object.identities[i], message.identities[i] = $util.newBuffer($util.base64.length(object.identities[i])), 0); - else if (object.identities[i].length >= 0) - message.identities[i] = object.identities[i]; - } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + var message = new $root.org.dash.platform.dapi.v0.SearchKey(); + if (object.purposeMap) { + if (typeof object.purposeMap !== "object") + throw TypeError(".org.dash.platform.dapi.v0.SearchKey.purposeMap: object expected"); + message.purposeMap = {}; + for (var keys = Object.keys(object.purposeMap), i = 0; i < keys.length; ++i) { + if (typeof object.purposeMap[keys[i]] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.SearchKey.purposeMap: object expected"); + message.purposeMap[keys[i]] = $root.org.dash.platform.dapi.v0.SecurityLevelMap.fromObject(object.purposeMap[keys[i]]); + } } return message; }; /** - * Creates a plain object from a GetIdentitiesByPublicKeyHashesResponse message. Also converts values to other types if specified. + * Creates a plain object from a SearchKey message. Also converts values to other types if specified. * @function toObject - * @memberof org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse + * @memberof org.dash.platform.dapi.v0.SearchKey * @static - * @param {org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} message GetIdentitiesByPublicKeyHashesResponse + * @param {org.dash.platform.dapi.v0.SearchKey} message SearchKey * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetIdentitiesByPublicKeyHashesResponse.toObject = function toObject(message, options) { + SearchKey.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.arrays || options.defaults) - object.identities = []; - if (options.defaults) { - object.proof = null; - object.metadata = null; - } - if (message.identities && message.identities.length) { - object.identities = []; - for (var j = 0; j < message.identities.length; ++j) - object.identities[j] = options.bytes === String ? $util.base64.encode(message.identities[j], 0, message.identities[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.identities[j]) : message.identities[j]; + if (options.objects || options.defaults) + object.purposeMap = {}; + var keys2; + if (message.purposeMap && (keys2 = Object.keys(message.purposeMap)).length) { + object.purposeMap = {}; + for (var j = 0; j < keys2.length; ++j) + object.purposeMap[keys2[j]] = $root.org.dash.platform.dapi.v0.SecurityLevelMap.toObject(message.purposeMap[keys2[j]], options); } - if (message.proof != null && message.hasOwnProperty("proof")) - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); return object; }; /** - * Converts this GetIdentitiesByPublicKeyHashesResponse to JSON. + * Converts this SearchKey to JSON. * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse + * @memberof org.dash.platform.dapi.v0.SearchKey * @instance * @returns {Object.} JSON object */ - GetIdentitiesByPublicKeyHashesResponse.prototype.toJSON = function toJSON() { + SearchKey.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetIdentitiesByPublicKeyHashesResponse; + return SearchKey; })(); - v0.WaitForStateTransitionResultRequest = (function() { + v0.SecurityLevelMap = (function() { /** - * Properties of a WaitForStateTransitionResultRequest. + * Properties of a SecurityLevelMap. * @memberof org.dash.platform.dapi.v0 - * @interface IWaitForStateTransitionResultRequest - * @property {Uint8Array|null} [stateTransitionHash] WaitForStateTransitionResultRequest stateTransitionHash - * @property {boolean|null} [prove] WaitForStateTransitionResultRequest prove + * @interface ISecurityLevelMap + * @property {Object.|null} [securityLevelMap] SecurityLevelMap securityLevelMap */ /** - * Constructs a new WaitForStateTransitionResultRequest. + * Constructs a new SecurityLevelMap. * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a WaitForStateTransitionResultRequest. - * @implements IWaitForStateTransitionResultRequest + * @classdesc Represents a SecurityLevelMap. + * @implements ISecurityLevelMap * @constructor - * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultRequest=} [properties] Properties to set + * @param {org.dash.platform.dapi.v0.ISecurityLevelMap=} [properties] Properties to set */ - function WaitForStateTransitionResultRequest(properties) { + function SecurityLevelMap(properties) { + this.securityLevelMap = {}; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3599,88 +3545,95 @@ $root.org = (function() { } /** - * WaitForStateTransitionResultRequest stateTransitionHash. - * @member {Uint8Array} stateTransitionHash - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest - * @instance - */ - WaitForStateTransitionResultRequest.prototype.stateTransitionHash = $util.newBuffer([]); - - /** - * WaitForStateTransitionResultRequest prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * SecurityLevelMap securityLevelMap. + * @member {Object.} securityLevelMap + * @memberof org.dash.platform.dapi.v0.SecurityLevelMap * @instance */ - WaitForStateTransitionResultRequest.prototype.prove = false; + SecurityLevelMap.prototype.securityLevelMap = $util.emptyObject; /** - * Creates a new WaitForStateTransitionResultRequest instance using the specified properties. + * Creates a new SecurityLevelMap instance using the specified properties. * @function create - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @memberof org.dash.platform.dapi.v0.SecurityLevelMap * @static - * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest} WaitForStateTransitionResultRequest instance + * @param {org.dash.platform.dapi.v0.ISecurityLevelMap=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.SecurityLevelMap} SecurityLevelMap instance */ - WaitForStateTransitionResultRequest.create = function create(properties) { - return new WaitForStateTransitionResultRequest(properties); + SecurityLevelMap.create = function create(properties) { + return new SecurityLevelMap(properties); }; /** - * Encodes the specified WaitForStateTransitionResultRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.verify|verify} messages. + * Encodes the specified SecurityLevelMap message. Does not implicitly {@link org.dash.platform.dapi.v0.SecurityLevelMap.verify|verify} messages. * @function encode - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @memberof org.dash.platform.dapi.v0.SecurityLevelMap * @static - * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultRequest} message WaitForStateTransitionResultRequest message or plain object to encode + * @param {org.dash.platform.dapi.v0.ISecurityLevelMap} message SecurityLevelMap message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WaitForStateTransitionResultRequest.encode = function encode(message, writer) { + SecurityLevelMap.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.stateTransitionHash != null && Object.hasOwnProperty.call(message, "stateTransitionHash")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.stateTransitionHash); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + if (message.securityLevelMap != null && Object.hasOwnProperty.call(message, "securityLevelMap")) + for (var keys = Object.keys(message.securityLevelMap), i = 0; i < keys.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 0 =*/8).uint32(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.securityLevelMap[keys[i]]).ldelim(); return writer; }; /** - * Encodes the specified WaitForStateTransitionResultRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.verify|verify} messages. + * Encodes the specified SecurityLevelMap message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.SecurityLevelMap.verify|verify} messages. * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @memberof org.dash.platform.dapi.v0.SecurityLevelMap * @static - * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultRequest} message WaitForStateTransitionResultRequest message or plain object to encode + * @param {org.dash.platform.dapi.v0.ISecurityLevelMap} message SecurityLevelMap message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WaitForStateTransitionResultRequest.encodeDelimited = function encodeDelimited(message, writer) { + SecurityLevelMap.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a WaitForStateTransitionResultRequest message from the specified reader or buffer. + * Decodes a SecurityLevelMap message from the specified reader or buffer. * @function decode - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @memberof org.dash.platform.dapi.v0.SecurityLevelMap * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest} WaitForStateTransitionResultRequest + * @returns {org.dash.platform.dapi.v0.SecurityLevelMap} SecurityLevelMap * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WaitForStateTransitionResultRequest.decode = function decode(reader, length) { + SecurityLevelMap.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.SecurityLevelMap(), key, value; while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.stateTransitionHash = reader.bytes(); - break; - case 2: - message.prove = reader.bool(); + if (message.securityLevelMap === $util.emptyObject) + message.securityLevelMap = {}; + var end2 = reader.uint32() + reader.pos; + key = 0; + value = 0; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.uint32(); + break; + case 2: + value = reader.int32(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.securityLevelMap[key] = value; break; default: reader.skipType(tag & 7); @@ -3691,127 +3644,156 @@ $root.org = (function() { }; /** - * Decodes a WaitForStateTransitionResultRequest message from the specified reader or buffer, length delimited. + * Decodes a SecurityLevelMap message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @memberof org.dash.platform.dapi.v0.SecurityLevelMap * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest} WaitForStateTransitionResultRequest + * @returns {org.dash.platform.dapi.v0.SecurityLevelMap} SecurityLevelMap * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WaitForStateTransitionResultRequest.decodeDelimited = function decodeDelimited(reader) { + SecurityLevelMap.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a WaitForStateTransitionResultRequest message. + * Verifies a SecurityLevelMap message. * @function verify - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @memberof org.dash.platform.dapi.v0.SecurityLevelMap * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - WaitForStateTransitionResultRequest.verify = function verify(message) { + SecurityLevelMap.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.stateTransitionHash != null && message.hasOwnProperty("stateTransitionHash")) - if (!(message.stateTransitionHash && typeof message.stateTransitionHash.length === "number" || $util.isString(message.stateTransitionHash))) - return "stateTransitionHash: buffer expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; + if (message.securityLevelMap != null && message.hasOwnProperty("securityLevelMap")) { + if (!$util.isObject(message.securityLevelMap)) + return "securityLevelMap: object expected"; + var key = Object.keys(message.securityLevelMap); + for (var i = 0; i < key.length; ++i) { + if (!$util.key32Re.test(key[i])) + return "securityLevelMap: integer key{k:uint32} expected"; + switch (message.securityLevelMap[key[i]]) { + default: + return "securityLevelMap: enum value{k:uint32} expected"; + case 0: + case 1: + break; + } + } + } return null; }; /** - * Creates a WaitForStateTransitionResultRequest message from a plain object. Also converts values to their respective internal types. + * Creates a SecurityLevelMap message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @memberof org.dash.platform.dapi.v0.SecurityLevelMap * @static * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest} WaitForStateTransitionResultRequest + * @returns {org.dash.platform.dapi.v0.SecurityLevelMap} SecurityLevelMap */ - WaitForStateTransitionResultRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest) + SecurityLevelMap.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.SecurityLevelMap) return object; - var message = new $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest(); - if (object.stateTransitionHash != null) - if (typeof object.stateTransitionHash === "string") - $util.base64.decode(object.stateTransitionHash, message.stateTransitionHash = $util.newBuffer($util.base64.length(object.stateTransitionHash)), 0); - else if (object.stateTransitionHash.length >= 0) - message.stateTransitionHash = object.stateTransitionHash; - if (object.prove != null) - message.prove = Boolean(object.prove); + var message = new $root.org.dash.platform.dapi.v0.SecurityLevelMap(); + if (object.securityLevelMap) { + if (typeof object.securityLevelMap !== "object") + throw TypeError(".org.dash.platform.dapi.v0.SecurityLevelMap.securityLevelMap: object expected"); + message.securityLevelMap = {}; + for (var keys = Object.keys(object.securityLevelMap), i = 0; i < keys.length; ++i) + switch (object.securityLevelMap[keys[i]]) { + case "CURRENT_KEY_OF_KIND_REQUEST": + case 0: + message.securityLevelMap[keys[i]] = 0; + break; + case "ALL_KEYS_OF_KIND_REQUEST": + case 1: + message.securityLevelMap[keys[i]] = 1; + break; + } + } return message; }; /** - * Creates a plain object from a WaitForStateTransitionResultRequest message. Also converts values to other types if specified. + * Creates a plain object from a SecurityLevelMap message. Also converts values to other types if specified. * @function toObject - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @memberof org.dash.platform.dapi.v0.SecurityLevelMap * @static - * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest} message WaitForStateTransitionResultRequest + * @param {org.dash.platform.dapi.v0.SecurityLevelMap} message SecurityLevelMap * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - WaitForStateTransitionResultRequest.toObject = function toObject(message, options) { + SecurityLevelMap.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.stateTransitionHash = ""; - else { - object.stateTransitionHash = []; - if (options.bytes !== Array) - object.stateTransitionHash = $util.newBuffer(object.stateTransitionHash); - } - object.prove = false; + if (options.objects || options.defaults) + object.securityLevelMap = {}; + var keys2; + if (message.securityLevelMap && (keys2 = Object.keys(message.securityLevelMap)).length) { + object.securityLevelMap = {}; + for (var j = 0; j < keys2.length; ++j) + object.securityLevelMap[keys2[j]] = options.enums === String ? $root.org.dash.platform.dapi.v0.SecurityLevelMap.KeyKindRequestType[message.securityLevelMap[keys2[j]]] : message.securityLevelMap[keys2[j]]; } - if (message.stateTransitionHash != null && message.hasOwnProperty("stateTransitionHash")) - object.stateTransitionHash = options.bytes === String ? $util.base64.encode(message.stateTransitionHash, 0, message.stateTransitionHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.stateTransitionHash) : message.stateTransitionHash; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; return object; }; /** - * Converts this WaitForStateTransitionResultRequest to JSON. + * Converts this SecurityLevelMap to JSON. * @function toJSON - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @memberof org.dash.platform.dapi.v0.SecurityLevelMap * @instance * @returns {Object.} JSON object */ - WaitForStateTransitionResultRequest.prototype.toJSON = function toJSON() { + SecurityLevelMap.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return WaitForStateTransitionResultRequest; + /** + * KeyKindRequestType enum. + * @name org.dash.platform.dapi.v0.SecurityLevelMap.KeyKindRequestType + * @enum {number} + * @property {number} CURRENT_KEY_OF_KIND_REQUEST=0 CURRENT_KEY_OF_KIND_REQUEST value + * @property {number} ALL_KEYS_OF_KIND_REQUEST=1 ALL_KEYS_OF_KIND_REQUEST value + */ + SecurityLevelMap.KeyKindRequestType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CURRENT_KEY_OF_KIND_REQUEST"] = 0; + values[valuesById[1] = "ALL_KEYS_OF_KIND_REQUEST"] = 1; + return values; + })(); + + return SecurityLevelMap; })(); - v0.WaitForStateTransitionResultResponse = (function() { + v0.GetIdentityKeysRequest = (function() { /** - * Properties of a WaitForStateTransitionResultResponse. + * Properties of a GetIdentityKeysRequest. * @memberof org.dash.platform.dapi.v0 - * @interface IWaitForStateTransitionResultResponse - * @property {org.dash.platform.dapi.v0.IStateTransitionBroadcastError|null} [error] WaitForStateTransitionResultResponse error - * @property {org.dash.platform.dapi.v0.IProof|null} [proof] WaitForStateTransitionResultResponse proof - * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] WaitForStateTransitionResultResponse metadata + * @interface IGetIdentityKeysRequest + * @property {Uint8Array|null} [identityId] GetIdentityKeysRequest identityId + * @property {org.dash.platform.dapi.v0.IKeyRequestType|null} [requestType] GetIdentityKeysRequest requestType + * @property {google.protobuf.IUInt32Value|null} [limit] GetIdentityKeysRequest limit + * @property {google.protobuf.IUInt32Value|null} [offset] GetIdentityKeysRequest offset + * @property {boolean|null} [prove] GetIdentityKeysRequest prove */ /** - * Constructs a new WaitForStateTransitionResultResponse. + * Constructs a new GetIdentityKeysRequest. * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a WaitForStateTransitionResultResponse. - * @implements IWaitForStateTransitionResultResponse + * @classdesc Represents a GetIdentityKeysRequest. + * @implements IGetIdentityKeysRequest * @constructor - * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultResponse=} [properties] Properties to set + * @param {org.dash.platform.dapi.v0.IGetIdentityKeysRequest=} [properties] Properties to set */ - function WaitForStateTransitionResultResponse(properties) { + function GetIdentityKeysRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -3819,115 +3801,127 @@ $root.org = (function() { } /** - * WaitForStateTransitionResultResponse error. - * @member {org.dash.platform.dapi.v0.IStateTransitionBroadcastError|null|undefined} error - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * GetIdentityKeysRequest identityId. + * @member {Uint8Array} identityId + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest * @instance */ - WaitForStateTransitionResultResponse.prototype.error = null; + GetIdentityKeysRequest.prototype.identityId = $util.newBuffer([]); /** - * WaitForStateTransitionResultResponse proof. - * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * GetIdentityKeysRequest requestType. + * @member {org.dash.platform.dapi.v0.IKeyRequestType|null|undefined} requestType + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest * @instance */ - WaitForStateTransitionResultResponse.prototype.proof = null; + GetIdentityKeysRequest.prototype.requestType = null; /** - * WaitForStateTransitionResultResponse metadata. - * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * GetIdentityKeysRequest limit. + * @member {google.protobuf.IUInt32Value|null|undefined} limit + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest * @instance */ - WaitForStateTransitionResultResponse.prototype.metadata = null; + GetIdentityKeysRequest.prototype.limit = null; - // OneOf field names bound to virtual getters and setters - var $oneOfFields; + /** + * GetIdentityKeysRequest offset. + * @member {google.protobuf.IUInt32Value|null|undefined} offset + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest + * @instance + */ + GetIdentityKeysRequest.prototype.offset = null; /** - * WaitForStateTransitionResultResponse responses. - * @member {"error"|"proof"|undefined} responses - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * GetIdentityKeysRequest prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest * @instance */ - Object.defineProperty(WaitForStateTransitionResultResponse.prototype, "responses", { - get: $util.oneOfGetter($oneOfFields = ["error", "proof"]), - set: $util.oneOfSetter($oneOfFields) - }); + GetIdentityKeysRequest.prototype.prove = false; /** - * Creates a new WaitForStateTransitionResultResponse instance using the specified properties. + * Creates a new GetIdentityKeysRequest instance using the specified properties. * @function create - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest * @static - * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse} WaitForStateTransitionResultResponse instance + * @param {org.dash.platform.dapi.v0.IGetIdentityKeysRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysRequest} GetIdentityKeysRequest instance */ - WaitForStateTransitionResultResponse.create = function create(properties) { - return new WaitForStateTransitionResultResponse(properties); + GetIdentityKeysRequest.create = function create(properties) { + return new GetIdentityKeysRequest(properties); }; /** - * Encodes the specified WaitForStateTransitionResultResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.verify|verify} messages. + * Encodes the specified GetIdentityKeysRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysRequest.verify|verify} messages. * @function encode - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest * @static - * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultResponse} message WaitForStateTransitionResultResponse message or plain object to encode + * @param {org.dash.platform.dapi.v0.IGetIdentityKeysRequest} message GetIdentityKeysRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WaitForStateTransitionResultResponse.encode = function encode(message, writer) { + GetIdentityKeysRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.error != null && Object.hasOwnProperty.call(message, "error")) - $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError.encode(message.error, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) - $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.identityId != null && Object.hasOwnProperty.call(message, "identityId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityId); + if (message.requestType != null && Object.hasOwnProperty.call(message, "requestType")) + $root.org.dash.platform.dapi.v0.KeyRequestType.encode(message.requestType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + $root.google.protobuf.UInt32Value.encode(message.limit, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + $root.google.protobuf.UInt32Value.encode(message.offset, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.prove); return writer; }; /** - * Encodes the specified WaitForStateTransitionResultResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.verify|verify} messages. + * Encodes the specified GetIdentityKeysRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysRequest.verify|verify} messages. * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest * @static - * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultResponse} message WaitForStateTransitionResultResponse message or plain object to encode + * @param {org.dash.platform.dapi.v0.IGetIdentityKeysRequest} message GetIdentityKeysRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - WaitForStateTransitionResultResponse.encodeDelimited = function encodeDelimited(message, writer) { + GetIdentityKeysRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a WaitForStateTransitionResultResponse message from the specified reader or buffer. + * Decodes a GetIdentityKeysRequest message from the specified reader or buffer. * @function decode - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse} WaitForStateTransitionResultResponse + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysRequest} GetIdentityKeysRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WaitForStateTransitionResultResponse.decode = function decode(reader, length) { + GetIdentityKeysRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.error = $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError.decode(reader, reader.uint32()); + message.identityId = reader.bytes(); break; case 2: - message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + message.requestType = $root.org.dash.platform.dapi.v0.KeyRequestType.decode(reader, reader.uint32()); break; case 3: - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + message.limit = $root.google.protobuf.UInt32Value.decode(reader, reader.uint32()); + break; + case 4: + message.offset = $root.google.protobuf.UInt32Value.decode(reader, reader.uint32()); + break; + case 5: + message.prove = reader.bool(); break; default: reader.skipType(tag & 7); @@ -3938,153 +3932,166 @@ $root.org = (function() { }; /** - * Decodes a WaitForStateTransitionResultResponse message from the specified reader or buffer, length delimited. + * Decodes a GetIdentityKeysRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse} WaitForStateTransitionResultResponse + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysRequest} GetIdentityKeysRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - WaitForStateTransitionResultResponse.decodeDelimited = function decodeDelimited(reader) { + GetIdentityKeysRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a WaitForStateTransitionResultResponse message. + * Verifies a GetIdentityKeysRequest message. * @function verify - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - WaitForStateTransitionResultResponse.verify = function verify(message) { + GetIdentityKeysRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - var properties = {}; - if (message.error != null && message.hasOwnProperty("error")) { - properties.responses = 1; - { - var error = $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError.verify(message.error); - if (error) - return "error." + error; - } + if (message.identityId != null && message.hasOwnProperty("identityId")) + if (!(message.identityId && typeof message.identityId.length === "number" || $util.isString(message.identityId))) + return "identityId: buffer expected"; + if (message.requestType != null && message.hasOwnProperty("requestType")) { + var error = $root.org.dash.platform.dapi.v0.KeyRequestType.verify(message.requestType); + if (error) + return "requestType." + error; } - if (message.proof != null && message.hasOwnProperty("proof")) { - if (properties.responses === 1) - return "responses: multiple values"; - properties.responses = 1; - { - var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); - if (error) - return "proof." + error; - } + if (message.limit != null && message.hasOwnProperty("limit")) { + var error = $root.google.protobuf.UInt32Value.verify(message.limit); + if (error) + return "limit." + error; } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (message.offset != null && message.hasOwnProperty("offset")) { + var error = $root.google.protobuf.UInt32Value.verify(message.offset); if (error) - return "metadata." + error; + return "offset." + error; } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; return null; }; /** - * Creates a WaitForStateTransitionResultResponse message from a plain object. Also converts values to their respective internal types. + * Creates a GetIdentityKeysRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest * @static * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse} WaitForStateTransitionResultResponse + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysRequest} GetIdentityKeysRequest */ - WaitForStateTransitionResultResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse) + GetIdentityKeysRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest) return object; - var message = new $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse(); - if (object.error != null) { - if (typeof object.error !== "object") - throw TypeError(".org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.error: object expected"); - message.error = $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError.fromObject(object.error); + var message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysRequest(); + if (object.identityId != null) + if (typeof object.identityId === "string") + $util.base64.decode(object.identityId, message.identityId = $util.newBuffer($util.base64.length(object.identityId)), 0); + else if (object.identityId.length >= 0) + message.identityId = object.identityId; + if (object.requestType != null) { + if (typeof object.requestType !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysRequest.requestType: object expected"); + message.requestType = $root.org.dash.platform.dapi.v0.KeyRequestType.fromObject(object.requestType); } - if (object.proof != null) { - if (typeof object.proof !== "object") - throw TypeError(".org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.proof: object expected"); - message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + if (object.limit != null) { + if (typeof object.limit !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysRequest.limit: object expected"); + message.limit = $root.google.protobuf.UInt32Value.fromObject(object.limit); } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.metadata: object expected"); - message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + if (object.offset != null) { + if (typeof object.offset !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysRequest.offset: object expected"); + message.offset = $root.google.protobuf.UInt32Value.fromObject(object.offset); } + if (object.prove != null) + message.prove = Boolean(object.prove); return message; }; /** - * Creates a plain object from a WaitForStateTransitionResultResponse message. Also converts values to other types if specified. + * Creates a plain object from a GetIdentityKeysRequest message. Also converts values to other types if specified. * @function toObject - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest * @static - * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse} message WaitForStateTransitionResultResponse + * @param {org.dash.platform.dapi.v0.GetIdentityKeysRequest} message GetIdentityKeysRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - WaitForStateTransitionResultResponse.toObject = function toObject(message, options) { + GetIdentityKeysRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.metadata = null; - if (message.error != null && message.hasOwnProperty("error")) { - object.error = $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError.toObject(message.error, options); - if (options.oneofs) - object.responses = "error"; - } - if (message.proof != null && message.hasOwnProperty("proof")) { - object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); - if (options.oneofs) - object.responses = "proof"; + if (options.defaults) { + if (options.bytes === String) + object.identityId = ""; + else { + object.identityId = []; + if (options.bytes !== Array) + object.identityId = $util.newBuffer(object.identityId); + } + object.requestType = null; + object.limit = null; + object.offset = null; + object.prove = false; } - if (message.metadata != null && message.hasOwnProperty("metadata")) - object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + if (message.identityId != null && message.hasOwnProperty("identityId")) + object.identityId = options.bytes === String ? $util.base64.encode(message.identityId, 0, message.identityId.length) : options.bytes === Array ? Array.prototype.slice.call(message.identityId) : message.identityId; + if (message.requestType != null && message.hasOwnProperty("requestType")) + object.requestType = $root.org.dash.platform.dapi.v0.KeyRequestType.toObject(message.requestType, options); + if (message.limit != null && message.hasOwnProperty("limit")) + object.limit = $root.google.protobuf.UInt32Value.toObject(message.limit, options); + if (message.offset != null && message.hasOwnProperty("offset")) + object.offset = $root.google.protobuf.UInt32Value.toObject(message.offset, options); + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; return object; }; /** - * Converts this WaitForStateTransitionResultResponse to JSON. + * Converts this GetIdentityKeysRequest to JSON. * @function toJSON - * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysRequest * @instance * @returns {Object.} JSON object */ - WaitForStateTransitionResultResponse.prototype.toJSON = function toJSON() { + GetIdentityKeysRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return WaitForStateTransitionResultResponse; + return GetIdentityKeysRequest; })(); - v0.ConsensusParamsBlock = (function() { + v0.GetIdentityKeysResponse = (function() { /** - * Properties of a ConsensusParamsBlock. + * Properties of a GetIdentityKeysResponse. * @memberof org.dash.platform.dapi.v0 - * @interface IConsensusParamsBlock - * @property {string|null} [maxBytes] ConsensusParamsBlock maxBytes - * @property {string|null} [maxGas] ConsensusParamsBlock maxGas - * @property {string|null} [timeIotaMs] ConsensusParamsBlock timeIotaMs + * @interface IGetIdentityKeysResponse + * @property {org.dash.platform.dapi.v0.GetIdentityKeysResponse.IKeys|null} [keys] GetIdentityKeysResponse keys + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityKeysResponse proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityKeysResponse metadata */ /** - * Constructs a new ConsensusParamsBlock. + * Constructs a new GetIdentityKeysResponse. * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a ConsensusParamsBlock. - * @implements IConsensusParamsBlock + * @classdesc Represents a GetIdentityKeysResponse. + * @implements IGetIdentityKeysResponse * @constructor - * @param {org.dash.platform.dapi.v0.IConsensusParamsBlock=} [properties] Properties to set + * @param {org.dash.platform.dapi.v0.IGetIdentityKeysResponse=} [properties] Properties to set */ - function ConsensusParamsBlock(properties) { + function GetIdentityKeysResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4092,101 +4099,115 @@ $root.org = (function() { } /** - * ConsensusParamsBlock maxBytes. - * @member {string} maxBytes - * @memberof org.dash.platform.dapi.v0.ConsensusParamsBlock + * GetIdentityKeysResponse keys. + * @member {org.dash.platform.dapi.v0.GetIdentityKeysResponse.IKeys|null|undefined} keys + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse * @instance */ - ConsensusParamsBlock.prototype.maxBytes = ""; + GetIdentityKeysResponse.prototype.keys = null; /** - * ConsensusParamsBlock maxGas. - * @member {string} maxGas - * @memberof org.dash.platform.dapi.v0.ConsensusParamsBlock + * GetIdentityKeysResponse proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse * @instance */ - ConsensusParamsBlock.prototype.maxGas = ""; + GetIdentityKeysResponse.prototype.proof = null; /** - * ConsensusParamsBlock timeIotaMs. - * @member {string} timeIotaMs - * @memberof org.dash.platform.dapi.v0.ConsensusParamsBlock + * GetIdentityKeysResponse metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse * @instance */ - ConsensusParamsBlock.prototype.timeIotaMs = ""; + GetIdentityKeysResponse.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; /** - * Creates a new ConsensusParamsBlock instance using the specified properties. + * GetIdentityKeysResponse result. + * @member {"keys"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse + * @instance + */ + Object.defineProperty(GetIdentityKeysResponse.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["keys", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityKeysResponse instance using the specified properties. * @function create - * @memberof org.dash.platform.dapi.v0.ConsensusParamsBlock + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse * @static - * @param {org.dash.platform.dapi.v0.IConsensusParamsBlock=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.ConsensusParamsBlock} ConsensusParamsBlock instance + * @param {org.dash.platform.dapi.v0.IGetIdentityKeysResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse} GetIdentityKeysResponse instance */ - ConsensusParamsBlock.create = function create(properties) { - return new ConsensusParamsBlock(properties); + GetIdentityKeysResponse.create = function create(properties) { + return new GetIdentityKeysResponse(properties); }; /** - * Encodes the specified ConsensusParamsBlock message. Does not implicitly {@link org.dash.platform.dapi.v0.ConsensusParamsBlock.verify|verify} messages. + * Encodes the specified GetIdentityKeysResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysResponse.verify|verify} messages. * @function encode - * @memberof org.dash.platform.dapi.v0.ConsensusParamsBlock + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse * @static - * @param {org.dash.platform.dapi.v0.IConsensusParamsBlock} message ConsensusParamsBlock message or plain object to encode + * @param {org.dash.platform.dapi.v0.IGetIdentityKeysResponse} message GetIdentityKeysResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ConsensusParamsBlock.encode = function encode(message, writer) { + GetIdentityKeysResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.maxBytes != null && Object.hasOwnProperty.call(message, "maxBytes")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.maxBytes); - if (message.maxGas != null && Object.hasOwnProperty.call(message, "maxGas")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.maxGas); - if (message.timeIotaMs != null && Object.hasOwnProperty.call(message, "timeIotaMs")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.timeIotaMs); + if (message.keys != null && Object.hasOwnProperty.call(message, "keys")) + $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.encode(message.keys, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified ConsensusParamsBlock message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.ConsensusParamsBlock.verify|verify} messages. + * Encodes the specified GetIdentityKeysResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysResponse.verify|verify} messages. * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.ConsensusParamsBlock + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse * @static - * @param {org.dash.platform.dapi.v0.IConsensusParamsBlock} message ConsensusParamsBlock message or plain object to encode + * @param {org.dash.platform.dapi.v0.IGetIdentityKeysResponse} message GetIdentityKeysResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ConsensusParamsBlock.encodeDelimited = function encodeDelimited(message, writer) { + GetIdentityKeysResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ConsensusParamsBlock message from the specified reader or buffer. + * Decodes a GetIdentityKeysResponse message from the specified reader or buffer. * @function decode - * @memberof org.dash.platform.dapi.v0.ConsensusParamsBlock + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.ConsensusParamsBlock} ConsensusParamsBlock + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse} GetIdentityKeysResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ConsensusParamsBlock.decode = function decode(reader, length) { + GetIdentityKeysResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.ConsensusParamsBlock(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.maxBytes = reader.string(); + message.keys = $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.decode(reader, reader.uint32()); break; case 2: - message.maxGas = reader.string(); + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); break; case 3: - message.timeIotaMs = reader.string(); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -4197,126 +4218,362 @@ $root.org = (function() { }; /** - * Decodes a ConsensusParamsBlock message from the specified reader or buffer, length delimited. + * Decodes a GetIdentityKeysResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.ConsensusParamsBlock + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.ConsensusParamsBlock} ConsensusParamsBlock + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse} GetIdentityKeysResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ConsensusParamsBlock.decodeDelimited = function decodeDelimited(reader) { + GetIdentityKeysResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ConsensusParamsBlock message. + * Verifies a GetIdentityKeysResponse message. * @function verify - * @memberof org.dash.platform.dapi.v0.ConsensusParamsBlock + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ConsensusParamsBlock.verify = function verify(message) { + GetIdentityKeysResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) - if (!$util.isString(message.maxBytes)) - return "maxBytes: string expected"; - if (message.maxGas != null && message.hasOwnProperty("maxGas")) - if (!$util.isString(message.maxGas)) - return "maxGas: string expected"; - if (message.timeIotaMs != null && message.hasOwnProperty("timeIotaMs")) - if (!$util.isString(message.timeIotaMs)) - return "timeIotaMs: string expected"; + var properties = {}; + if (message.keys != null && message.hasOwnProperty("keys")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.verify(message.keys); + if (error) + return "keys." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } return null; }; /** - * Creates a ConsensusParamsBlock message from a plain object. Also converts values to their respective internal types. + * Creates a GetIdentityKeysResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof org.dash.platform.dapi.v0.ConsensusParamsBlock + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse * @static * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.ConsensusParamsBlock} ConsensusParamsBlock + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse} GetIdentityKeysResponse */ - ConsensusParamsBlock.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.ConsensusParamsBlock) + GetIdentityKeysResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse) return object; - var message = new $root.org.dash.platform.dapi.v0.ConsensusParamsBlock(); - if (object.maxBytes != null) - message.maxBytes = String(object.maxBytes); - if (object.maxGas != null) - message.maxGas = String(object.maxGas); - if (object.timeIotaMs != null) - message.timeIotaMs = String(object.timeIotaMs); + var message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse(); + if (object.keys != null) { + if (typeof object.keys !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysResponse.keys: object expected"); + message.keys = $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.fromObject(object.keys); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysResponse.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysResponse.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } return message; }; /** - * Creates a plain object from a ConsensusParamsBlock message. Also converts values to other types if specified. + * Creates a plain object from a GetIdentityKeysResponse message. Also converts values to other types if specified. * @function toObject - * @memberof org.dash.platform.dapi.v0.ConsensusParamsBlock + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse * @static - * @param {org.dash.platform.dapi.v0.ConsensusParamsBlock} message ConsensusParamsBlock + * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse} message GetIdentityKeysResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ConsensusParamsBlock.toObject = function toObject(message, options) { + GetIdentityKeysResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - object.maxBytes = ""; - object.maxGas = ""; - object.timeIotaMs = ""; + if (options.defaults) + object.metadata = null; + if (message.keys != null && message.hasOwnProperty("keys")) { + object.keys = $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.toObject(message.keys, options); + if (options.oneofs) + object.result = "keys"; } - if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) - object.maxBytes = message.maxBytes; - if (message.maxGas != null && message.hasOwnProperty("maxGas")) - object.maxGas = message.maxGas; - if (message.timeIotaMs != null && message.hasOwnProperty("timeIotaMs")) - object.timeIotaMs = message.timeIotaMs; + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); return object; }; /** - * Converts this ConsensusParamsBlock to JSON. + * Converts this GetIdentityKeysResponse to JSON. * @function toJSON - * @memberof org.dash.platform.dapi.v0.ConsensusParamsBlock + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse * @instance * @returns {Object.} JSON object */ - ConsensusParamsBlock.prototype.toJSON = function toJSON() { + GetIdentityKeysResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ConsensusParamsBlock; + GetIdentityKeysResponse.Keys = (function() { + + /** + * Properties of a Keys. + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse + * @interface IKeys + * @property {Array.|null} [keysBytes] Keys keysBytes + */ + + /** + * Constructs a new Keys. + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse + * @classdesc Represents a Keys. + * @implements IKeys + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.IKeys=} [properties] Properties to set + */ + function Keys(properties) { + this.keysBytes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Keys keysBytes. + * @member {Array.} keysBytes + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys + * @instance + */ + Keys.prototype.keysBytes = $util.emptyArray; + + /** + * Creates a new Keys instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.IKeys=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys} Keys instance + */ + Keys.create = function create(properties) { + return new Keys(properties); + }; + + /** + * Encodes the specified Keys message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.IKeys} message Keys message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Keys.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.keysBytes != null && message.keysBytes.length) + for (var i = 0; i < message.keysBytes.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.keysBytes[i]); + return writer; + }; + + /** + * Encodes the specified Keys message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.IKeys} message Keys message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Keys.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Keys message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys} Keys + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Keys.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.keysBytes && message.keysBytes.length)) + message.keysBytes = []; + message.keysBytes.push(reader.bytes()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Keys message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys} Keys + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Keys.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Keys message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Keys.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.keysBytes != null && message.hasOwnProperty("keysBytes")) { + if (!Array.isArray(message.keysBytes)) + return "keysBytes: array expected"; + for (var i = 0; i < message.keysBytes.length; ++i) + if (!(message.keysBytes[i] && typeof message.keysBytes[i].length === "number" || $util.isString(message.keysBytes[i]))) + return "keysBytes: buffer[] expected"; + } + return null; + }; + + /** + * Creates a Keys message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys} Keys + */ + Keys.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys(); + if (object.keysBytes) { + if (!Array.isArray(object.keysBytes)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.keysBytes: array expected"); + message.keysBytes = []; + for (var i = 0; i < object.keysBytes.length; ++i) + if (typeof object.keysBytes[i] === "string") + $util.base64.decode(object.keysBytes[i], message.keysBytes[i] = $util.newBuffer($util.base64.length(object.keysBytes[i])), 0); + else if (object.keysBytes[i].length >= 0) + message.keysBytes[i] = object.keysBytes[i]; + } + return message; + }; + + /** + * Creates a plain object from a Keys message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys} message Keys + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Keys.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.keysBytes = []; + if (message.keysBytes && message.keysBytes.length) { + object.keysBytes = []; + for (var j = 0; j < message.keysBytes.length; ++j) + object.keysBytes[j] = options.bytes === String ? $util.base64.encode(message.keysBytes[j], 0, message.keysBytes[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.keysBytes[j]) : message.keysBytes[j]; + } + return object; + }; + + /** + * Converts this Keys to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys + * @instance + * @returns {Object.} JSON object + */ + Keys.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Keys; + })(); + + return GetIdentityKeysResponse; })(); - v0.ConsensusParamsEvidence = (function() { + v0.GetIdentitiesKeysRequest = (function() { /** - * Properties of a ConsensusParamsEvidence. + * Properties of a GetIdentitiesKeysRequest. * @memberof org.dash.platform.dapi.v0 - * @interface IConsensusParamsEvidence - * @property {string|null} [maxAgeNumBlocks] ConsensusParamsEvidence maxAgeNumBlocks - * @property {string|null} [maxAgeDuration] ConsensusParamsEvidence maxAgeDuration - * @property {string|null} [maxBytes] ConsensusParamsEvidence maxBytes + * @interface IGetIdentitiesKeysRequest + * @property {Array.|null} [identityIds] GetIdentitiesKeysRequest identityIds + * @property {org.dash.platform.dapi.v0.IKeyRequestType|null} [requestType] GetIdentitiesKeysRequest requestType + * @property {google.protobuf.IUInt32Value|null} [limit] GetIdentitiesKeysRequest limit + * @property {google.protobuf.IUInt32Value|null} [offset] GetIdentitiesKeysRequest offset + * @property {boolean|null} [prove] GetIdentitiesKeysRequest prove */ /** - * Constructs a new ConsensusParamsEvidence. + * Constructs a new GetIdentitiesKeysRequest. * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a ConsensusParamsEvidence. - * @implements IConsensusParamsEvidence + * @classdesc Represents a GetIdentitiesKeysRequest. + * @implements IGetIdentitiesKeysRequest * @constructor - * @param {org.dash.platform.dapi.v0.IConsensusParamsEvidence=} [properties] Properties to set + * @param {org.dash.platform.dapi.v0.IGetIdentitiesKeysRequest=} [properties] Properties to set */ - function ConsensusParamsEvidence(properties) { + function GetIdentitiesKeysRequest(properties) { + this.identityIds = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4324,101 +4581,130 @@ $root.org = (function() { } /** - * ConsensusParamsEvidence maxAgeNumBlocks. - * @member {string} maxAgeNumBlocks - * @memberof org.dash.platform.dapi.v0.ConsensusParamsEvidence + * GetIdentitiesKeysRequest identityIds. + * @member {Array.} identityIds + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysRequest * @instance */ - ConsensusParamsEvidence.prototype.maxAgeNumBlocks = ""; + GetIdentitiesKeysRequest.prototype.identityIds = $util.emptyArray; /** - * ConsensusParamsEvidence maxAgeDuration. - * @member {string} maxAgeDuration - * @memberof org.dash.platform.dapi.v0.ConsensusParamsEvidence + * GetIdentitiesKeysRequest requestType. + * @member {org.dash.platform.dapi.v0.IKeyRequestType|null|undefined} requestType + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysRequest * @instance */ - ConsensusParamsEvidence.prototype.maxAgeDuration = ""; + GetIdentitiesKeysRequest.prototype.requestType = null; /** - * ConsensusParamsEvidence maxBytes. - * @member {string} maxBytes - * @memberof org.dash.platform.dapi.v0.ConsensusParamsEvidence + * GetIdentitiesKeysRequest limit. + * @member {google.protobuf.IUInt32Value|null|undefined} limit + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysRequest * @instance */ - ConsensusParamsEvidence.prototype.maxBytes = ""; + GetIdentitiesKeysRequest.prototype.limit = null; /** - * Creates a new ConsensusParamsEvidence instance using the specified properties. + * GetIdentitiesKeysRequest offset. + * @member {google.protobuf.IUInt32Value|null|undefined} offset + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysRequest + * @instance + */ + GetIdentitiesKeysRequest.prototype.offset = null; + + /** + * GetIdentitiesKeysRequest prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysRequest + * @instance + */ + GetIdentitiesKeysRequest.prototype.prove = false; + + /** + * Creates a new GetIdentitiesKeysRequest instance using the specified properties. * @function create - * @memberof org.dash.platform.dapi.v0.ConsensusParamsEvidence + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysRequest * @static - * @param {org.dash.platform.dapi.v0.IConsensusParamsEvidence=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.ConsensusParamsEvidence} ConsensusParamsEvidence instance + * @param {org.dash.platform.dapi.v0.IGetIdentitiesKeysRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesKeysRequest} GetIdentitiesKeysRequest instance */ - ConsensusParamsEvidence.create = function create(properties) { - return new ConsensusParamsEvidence(properties); + GetIdentitiesKeysRequest.create = function create(properties) { + return new GetIdentitiesKeysRequest(properties); }; /** - * Encodes the specified ConsensusParamsEvidence message. Does not implicitly {@link org.dash.platform.dapi.v0.ConsensusParamsEvidence.verify|verify} messages. + * Encodes the specified GetIdentitiesKeysRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.verify|verify} messages. * @function encode - * @memberof org.dash.platform.dapi.v0.ConsensusParamsEvidence + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysRequest * @static - * @param {org.dash.platform.dapi.v0.IConsensusParamsEvidence} message ConsensusParamsEvidence message or plain object to encode + * @param {org.dash.platform.dapi.v0.IGetIdentitiesKeysRequest} message GetIdentitiesKeysRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ConsensusParamsEvidence.encode = function encode(message, writer) { + GetIdentitiesKeysRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.maxAgeNumBlocks != null && Object.hasOwnProperty.call(message, "maxAgeNumBlocks")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.maxAgeNumBlocks); - if (message.maxAgeDuration != null && Object.hasOwnProperty.call(message, "maxAgeDuration")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.maxAgeDuration); - if (message.maxBytes != null && Object.hasOwnProperty.call(message, "maxBytes")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.maxBytes); + if (message.identityIds != null && message.identityIds.length) + for (var i = 0; i < message.identityIds.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identityIds[i]); + if (message.requestType != null && Object.hasOwnProperty.call(message, "requestType")) + $root.org.dash.platform.dapi.v0.KeyRequestType.encode(message.requestType, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + $root.google.protobuf.UInt32Value.encode(message.limit, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.offset != null && Object.hasOwnProperty.call(message, "offset")) + $root.google.protobuf.UInt32Value.encode(message.offset, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.prove); return writer; }; /** - * Encodes the specified ConsensusParamsEvidence message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.ConsensusParamsEvidence.verify|verify} messages. + * Encodes the specified GetIdentitiesKeysRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.verify|verify} messages. * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.ConsensusParamsEvidence + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysRequest * @static - * @param {org.dash.platform.dapi.v0.IConsensusParamsEvidence} message ConsensusParamsEvidence message or plain object to encode + * @param {org.dash.platform.dapi.v0.IGetIdentitiesKeysRequest} message GetIdentitiesKeysRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - ConsensusParamsEvidence.encodeDelimited = function encodeDelimited(message, writer) { + GetIdentitiesKeysRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a ConsensusParamsEvidence message from the specified reader or buffer. + * Decodes a GetIdentitiesKeysRequest message from the specified reader or buffer. * @function decode - * @memberof org.dash.platform.dapi.v0.ConsensusParamsEvidence + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.ConsensusParamsEvidence} ConsensusParamsEvidence + * @returns {org.dash.platform.dapi.v0.GetIdentitiesKeysRequest} GetIdentitiesKeysRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ConsensusParamsEvidence.decode = function decode(reader, length) { + GetIdentitiesKeysRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.ConsensusParamsEvidence(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.maxAgeNumBlocks = reader.string(); + if (!(message.identityIds && message.identityIds.length)) + message.identityIds = []; + message.identityIds.push(reader.bytes()); break; case 2: - message.maxAgeDuration = reader.string(); + message.requestType = $root.org.dash.platform.dapi.v0.KeyRequestType.decode(reader, reader.uint32()); break; case 3: - message.maxBytes = reader.string(); + message.limit = $root.google.protobuf.UInt32Value.decode(reader, reader.uint32()); + break; + case 4: + message.offset = $root.google.protobuf.UInt32Value.decode(reader, reader.uint32()); + break; + case 5: + message.prove = reader.bool(); break; default: reader.skipType(tag & 7); @@ -4429,125 +4715,419 @@ $root.org = (function() { }; /** - * Decodes a ConsensusParamsEvidence message from the specified reader or buffer, length delimited. + * Decodes a GetIdentitiesKeysRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.ConsensusParamsEvidence + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.ConsensusParamsEvidence} ConsensusParamsEvidence + * @returns {org.dash.platform.dapi.v0.GetIdentitiesKeysRequest} GetIdentitiesKeysRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - ConsensusParamsEvidence.decodeDelimited = function decodeDelimited(reader) { + GetIdentitiesKeysRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a ConsensusParamsEvidence message. + * Verifies a GetIdentitiesKeysRequest message. * @function verify - * @memberof org.dash.platform.dapi.v0.ConsensusParamsEvidence + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - ConsensusParamsEvidence.verify = function verify(message) { + GetIdentitiesKeysRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.maxAgeNumBlocks != null && message.hasOwnProperty("maxAgeNumBlocks")) - if (!$util.isString(message.maxAgeNumBlocks)) - return "maxAgeNumBlocks: string expected"; - if (message.maxAgeDuration != null && message.hasOwnProperty("maxAgeDuration")) - if (!$util.isString(message.maxAgeDuration)) - return "maxAgeDuration: string expected"; - if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) - if (!$util.isString(message.maxBytes)) - return "maxBytes: string expected"; + if (message.identityIds != null && message.hasOwnProperty("identityIds")) { + if (!Array.isArray(message.identityIds)) + return "identityIds: array expected"; + for (var i = 0; i < message.identityIds.length; ++i) + if (!(message.identityIds[i] && typeof message.identityIds[i].length === "number" || $util.isString(message.identityIds[i]))) + return "identityIds: buffer[] expected"; + } + if (message.requestType != null && message.hasOwnProperty("requestType")) { + var error = $root.org.dash.platform.dapi.v0.KeyRequestType.verify(message.requestType); + if (error) + return "requestType." + error; + } + if (message.limit != null && message.hasOwnProperty("limit")) { + var error = $root.google.protobuf.UInt32Value.verify(message.limit); + if (error) + return "limit." + error; + } + if (message.offset != null && message.hasOwnProperty("offset")) { + var error = $root.google.protobuf.UInt32Value.verify(message.offset); + if (error) + return "offset." + error; + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; return null; }; /** - * Creates a ConsensusParamsEvidence message from a plain object. Also converts values to their respective internal types. + * Creates a GetIdentitiesKeysRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof org.dash.platform.dapi.v0.ConsensusParamsEvidence + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysRequest * @static * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.ConsensusParamsEvidence} ConsensusParamsEvidence + * @returns {org.dash.platform.dapi.v0.GetIdentitiesKeysRequest} GetIdentitiesKeysRequest */ - ConsensusParamsEvidence.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.ConsensusParamsEvidence) + GetIdentitiesKeysRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest) return object; - var message = new $root.org.dash.platform.dapi.v0.ConsensusParamsEvidence(); - if (object.maxAgeNumBlocks != null) - message.maxAgeNumBlocks = String(object.maxAgeNumBlocks); - if (object.maxAgeDuration != null) - message.maxAgeDuration = String(object.maxAgeDuration); - if (object.maxBytes != null) - message.maxBytes = String(object.maxBytes); + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest(); + if (object.identityIds) { + if (!Array.isArray(object.identityIds)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.identityIds: array expected"); + message.identityIds = []; + for (var i = 0; i < object.identityIds.length; ++i) + if (typeof object.identityIds[i] === "string") + $util.base64.decode(object.identityIds[i], message.identityIds[i] = $util.newBuffer($util.base64.length(object.identityIds[i])), 0); + else if (object.identityIds[i].length >= 0) + message.identityIds[i] = object.identityIds[i]; + } + if (object.requestType != null) { + if (typeof object.requestType !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.requestType: object expected"); + message.requestType = $root.org.dash.platform.dapi.v0.KeyRequestType.fromObject(object.requestType); + } + if (object.limit != null) { + if (typeof object.limit !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.limit: object expected"); + message.limit = $root.google.protobuf.UInt32Value.fromObject(object.limit); + } + if (object.offset != null) { + if (typeof object.offset !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.offset: object expected"); + message.offset = $root.google.protobuf.UInt32Value.fromObject(object.offset); + } + if (object.prove != null) + message.prove = Boolean(object.prove); return message; }; /** - * Creates a plain object from a ConsensusParamsEvidence message. Also converts values to other types if specified. + * Creates a plain object from a GetIdentitiesKeysRequest message. Also converts values to other types if specified. * @function toObject - * @memberof org.dash.platform.dapi.v0.ConsensusParamsEvidence + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysRequest * @static - * @param {org.dash.platform.dapi.v0.ConsensusParamsEvidence} message ConsensusParamsEvidence + * @param {org.dash.platform.dapi.v0.GetIdentitiesKeysRequest} message GetIdentitiesKeysRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - ConsensusParamsEvidence.toObject = function toObject(message, options) { + GetIdentitiesKeysRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.identityIds = []; if (options.defaults) { - object.maxAgeNumBlocks = ""; - object.maxAgeDuration = ""; - object.maxBytes = ""; + object.requestType = null; + object.limit = null; + object.offset = null; + object.prove = false; } - if (message.maxAgeNumBlocks != null && message.hasOwnProperty("maxAgeNumBlocks")) - object.maxAgeNumBlocks = message.maxAgeNumBlocks; - if (message.maxAgeDuration != null && message.hasOwnProperty("maxAgeDuration")) - object.maxAgeDuration = message.maxAgeDuration; - if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) - object.maxBytes = message.maxBytes; - return object; - }; - + if (message.identityIds && message.identityIds.length) { + object.identityIds = []; + for (var j = 0; j < message.identityIds.length; ++j) + object.identityIds[j] = options.bytes === String ? $util.base64.encode(message.identityIds[j], 0, message.identityIds[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.identityIds[j]) : message.identityIds[j]; + } + if (message.requestType != null && message.hasOwnProperty("requestType")) + object.requestType = $root.org.dash.platform.dapi.v0.KeyRequestType.toObject(message.requestType, options); + if (message.limit != null && message.hasOwnProperty("limit")) + object.limit = $root.google.protobuf.UInt32Value.toObject(message.limit, options); + if (message.offset != null && message.hasOwnProperty("offset")) + object.offset = $root.google.protobuf.UInt32Value.toObject(message.offset, options); + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + /** - * Converts this ConsensusParamsEvidence to JSON. + * Converts this GetIdentitiesKeysRequest to JSON. * @function toJSON - * @memberof org.dash.platform.dapi.v0.ConsensusParamsEvidence + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysRequest * @instance * @returns {Object.} JSON object */ - ConsensusParamsEvidence.prototype.toJSON = function toJSON() { + GetIdentitiesKeysRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return ConsensusParamsEvidence; + GetIdentitiesKeysRequest.SecurityLevelMap = (function() { + + /** + * Properties of a SecurityLevelMap. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysRequest + * @interface ISecurityLevelMap + * @property {Object.|null} [securityLevelMap] SecurityLevelMap securityLevelMap + */ + + /** + * Constructs a new SecurityLevelMap. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysRequest + * @classdesc Represents a SecurityLevelMap. + * @implements ISecurityLevelMap + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.ISecurityLevelMap=} [properties] Properties to set + */ + function SecurityLevelMap(properties) { + this.securityLevelMap = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SecurityLevelMap securityLevelMap. + * @member {Object.} securityLevelMap + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap + * @instance + */ + SecurityLevelMap.prototype.securityLevelMap = $util.emptyObject; + + /** + * Creates a new SecurityLevelMap instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.ISecurityLevelMap=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap} SecurityLevelMap instance + */ + SecurityLevelMap.create = function create(properties) { + return new SecurityLevelMap(properties); + }; + + /** + * Encodes the specified SecurityLevelMap message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.ISecurityLevelMap} message SecurityLevelMap message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityLevelMap.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.securityLevelMap != null && Object.hasOwnProperty.call(message, "securityLevelMap")) + for (var keys = Object.keys(message.securityLevelMap), i = 0; i < keys.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 0 =*/8).uint32(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.securityLevelMap[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified SecurityLevelMap message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.ISecurityLevelMap} message SecurityLevelMap message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SecurityLevelMap.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SecurityLevelMap message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap} SecurityLevelMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityLevelMap.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (message.securityLevelMap === $util.emptyObject) + message.securityLevelMap = {}; + var end2 = reader.uint32() + reader.pos; + key = 0; + value = 0; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.uint32(); + break; + case 2: + value = reader.int32(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.securityLevelMap[key] = value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SecurityLevelMap message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap} SecurityLevelMap + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SecurityLevelMap.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SecurityLevelMap message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SecurityLevelMap.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.securityLevelMap != null && message.hasOwnProperty("securityLevelMap")) { + if (!$util.isObject(message.securityLevelMap)) + return "securityLevelMap: object expected"; + var key = Object.keys(message.securityLevelMap); + for (var i = 0; i < key.length; ++i) { + if (!$util.key32Re.test(key[i])) + return "securityLevelMap: integer key{k:uint32} expected"; + switch (message.securityLevelMap[key[i]]) { + default: + return "securityLevelMap: enum value{k:uint32} expected"; + case 0: + break; + } + } + } + return null; + }; + + /** + * Creates a SecurityLevelMap message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap} SecurityLevelMap + */ + SecurityLevelMap.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap(); + if (object.securityLevelMap) { + if (typeof object.securityLevelMap !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap.securityLevelMap: object expected"); + message.securityLevelMap = {}; + for (var keys = Object.keys(object.securityLevelMap), i = 0; i < keys.length; ++i) + switch (object.securityLevelMap[keys[i]]) { + case "CURRENT_KEY_OF_KIND_REQUEST": + case 0: + message.securityLevelMap[keys[i]] = 0; + break; + } + } + return message; + }; + + /** + * Creates a plain object from a SecurityLevelMap message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap} message SecurityLevelMap + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SecurityLevelMap.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.securityLevelMap = {}; + var keys2; + if (message.securityLevelMap && (keys2 = Object.keys(message.securityLevelMap)).length) { + object.securityLevelMap = {}; + for (var j = 0; j < keys2.length; ++j) + object.securityLevelMap[keys2[j]] = options.enums === String ? $root.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap.KeyKindRequestType[message.securityLevelMap[keys2[j]]] : message.securityLevelMap[keys2[j]]; + } + return object; + }; + + /** + * Converts this SecurityLevelMap to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap + * @instance + * @returns {Object.} JSON object + */ + SecurityLevelMap.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * KeyKindRequestType enum. + * @name org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap.KeyKindRequestType + * @enum {number} + * @property {number} CURRENT_KEY_OF_KIND_REQUEST=0 CURRENT_KEY_OF_KIND_REQUEST value + */ + SecurityLevelMap.KeyKindRequestType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "CURRENT_KEY_OF_KIND_REQUEST"] = 0; + return values; + })(); + + return SecurityLevelMap; + })(); + + return GetIdentitiesKeysRequest; })(); - v0.GetConsensusParamsRequest = (function() { + v0.GetIdentitiesKeysResponse = (function() { /** - * Properties of a GetConsensusParamsRequest. + * Properties of a GetIdentitiesKeysResponse. * @memberof org.dash.platform.dapi.v0 - * @interface IGetConsensusParamsRequest - * @property {number|Long|null} [height] GetConsensusParamsRequest height - * @property {boolean|null} [prove] GetConsensusParamsRequest prove + * @interface IGetIdentitiesKeysResponse + * @property {org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.IPublicKeyEntries|null} [publicKeys] GetIdentitiesKeysResponse publicKeys + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentitiesKeysResponse proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentitiesKeysResponse metadata */ /** - * Constructs a new GetConsensusParamsRequest. + * Constructs a new GetIdentitiesKeysResponse. * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetConsensusParamsRequest. - * @implements IGetConsensusParamsRequest + * @classdesc Represents a GetIdentitiesKeysResponse. + * @implements IGetIdentitiesKeysResponse * @constructor - * @param {org.dash.platform.dapi.v0.IGetConsensusParamsRequest=} [properties] Properties to set + * @param {org.dash.platform.dapi.v0.IGetIdentitiesKeysResponse=} [properties] Properties to set */ - function GetConsensusParamsRequest(properties) { + function GetIdentitiesKeysResponse(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4555,88 +5135,115 @@ $root.org = (function() { } /** - * GetConsensusParamsRequest height. - * @member {number|Long} height - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * GetIdentitiesKeysResponse publicKeys. + * @member {org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.IPublicKeyEntries|null|undefined} publicKeys + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse * @instance */ - GetConsensusParamsRequest.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + GetIdentitiesKeysResponse.prototype.publicKeys = null; /** - * GetConsensusParamsRequest prove. - * @member {boolean} prove - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * GetIdentitiesKeysResponse proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse * @instance */ - GetConsensusParamsRequest.prototype.prove = false; + GetIdentitiesKeysResponse.prototype.proof = null; /** - * Creates a new GetConsensusParamsRequest instance using the specified properties. + * GetIdentitiesKeysResponse metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse + * @instance + */ + GetIdentitiesKeysResponse.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentitiesKeysResponse result. + * @member {"publicKeys"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse + * @instance + */ + Object.defineProperty(GetIdentitiesKeysResponse.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["publicKeys", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentitiesKeysResponse instance using the specified properties. * @function create - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse * @static - * @param {org.dash.platform.dapi.v0.IGetConsensusParamsRequest=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest} GetConsensusParamsRequest instance + * @param {org.dash.platform.dapi.v0.IGetIdentitiesKeysResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesKeysResponse} GetIdentitiesKeysResponse instance */ - GetConsensusParamsRequest.create = function create(properties) { - return new GetConsensusParamsRequest(properties); + GetIdentitiesKeysResponse.create = function create(properties) { + return new GetIdentitiesKeysResponse(properties); }; /** - * Encodes the specified GetConsensusParamsRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsRequest.verify|verify} messages. + * Encodes the specified GetIdentitiesKeysResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.verify|verify} messages. * @function encode - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse * @static - * @param {org.dash.platform.dapi.v0.IGetConsensusParamsRequest} message GetConsensusParamsRequest message or plain object to encode + * @param {org.dash.platform.dapi.v0.IGetIdentitiesKeysResponse} message GetIdentitiesKeysResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetConsensusParamsRequest.encode = function encode(message, writer) { + GetIdentitiesKeysResponse.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.height); - if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + if (message.publicKeys != null && Object.hasOwnProperty.call(message, "publicKeys")) + $root.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.encode(message.publicKeys, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified GetConsensusParamsRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsRequest.verify|verify} messages. + * Encodes the specified GetIdentitiesKeysResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.verify|verify} messages. * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse * @static - * @param {org.dash.platform.dapi.v0.IGetConsensusParamsRequest} message GetConsensusParamsRequest message or plain object to encode + * @param {org.dash.platform.dapi.v0.IGetIdentitiesKeysResponse} message GetIdentitiesKeysResponse message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetConsensusParamsRequest.encodeDelimited = function encodeDelimited(message, writer) { + GetIdentitiesKeysResponse.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetConsensusParamsRequest message from the specified reader or buffer. + * Decodes a GetIdentitiesKeysResponse message from the specified reader or buffer. * @function decode - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest} GetConsensusParamsRequest + * @returns {org.dash.platform.dapi.v0.GetIdentitiesKeysResponse} GetIdentitiesKeysResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetConsensusParamsRequest.decode = function decode(reader, length) { + GetIdentitiesKeysResponse.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.height = reader.int64(); + message.publicKeys = $root.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.decode(reader, reader.uint32()); break; case 2: - message.prove = reader.bool(); + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); break; default: reader.skipType(tag & 7); @@ -4647,131 +5254,780 @@ $root.org = (function() { }; /** - * Decodes a GetConsensusParamsRequest message from the specified reader or buffer, length delimited. + * Decodes a GetIdentitiesKeysResponse message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest} GetConsensusParamsRequest + * @returns {org.dash.platform.dapi.v0.GetIdentitiesKeysResponse} GetIdentitiesKeysResponse * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetConsensusParamsRequest.decodeDelimited = function decodeDelimited(reader) { + GetIdentitiesKeysResponse.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetConsensusParamsRequest message. + * Verifies a GetIdentitiesKeysResponse message. * @function verify - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetConsensusParamsRequest.verify = function verify(message) { + GetIdentitiesKeysResponse.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.height != null && message.hasOwnProperty("height")) - if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) - return "height: integer|Long expected"; - if (message.prove != null && message.hasOwnProperty("prove")) - if (typeof message.prove !== "boolean") - return "prove: boolean expected"; + var properties = {}; + if (message.publicKeys != null && message.hasOwnProperty("publicKeys")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.verify(message.publicKeys); + if (error) + return "publicKeys." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } return null; }; /** - * Creates a GetConsensusParamsRequest message from a plain object. Also converts values to their respective internal types. + * Creates a GetIdentitiesKeysResponse message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse * @static * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest} GetConsensusParamsRequest + * @returns {org.dash.platform.dapi.v0.GetIdentitiesKeysResponse} GetIdentitiesKeysResponse */ - GetConsensusParamsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest) + GetIdentitiesKeysResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse) return object; - var message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest(); - if (object.height != null) - if ($util.Long) - (message.height = $util.Long.fromValue(object.height)).unsigned = false; - else if (typeof object.height === "string") - message.height = parseInt(object.height, 10); - else if (typeof object.height === "number") - message.height = object.height; - else if (typeof object.height === "object") - message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); - if (object.prove != null) - message.prove = Boolean(object.prove); + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse(); + if (object.publicKeys != null) { + if (typeof object.publicKeys !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.publicKeys: object expected"); + message.publicKeys = $root.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.fromObject(object.publicKeys); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } return message; }; /** - * Creates a plain object from a GetConsensusParamsRequest message. Also converts values to other types if specified. + * Creates a plain object from a GetIdentitiesKeysResponse message. Also converts values to other types if specified. * @function toObject - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse * @static - * @param {org.dash.platform.dapi.v0.GetConsensusParamsRequest} message GetConsensusParamsRequest + * @param {org.dash.platform.dapi.v0.GetIdentitiesKeysResponse} message GetIdentitiesKeysResponse * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetConsensusParamsRequest.toObject = function toObject(message, options) { + GetIdentitiesKeysResponse.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.height = options.longs === String ? "0" : 0; - object.prove = false; + if (options.defaults) + object.metadata = null; + if (message.publicKeys != null && message.hasOwnProperty("publicKeys")) { + object.publicKeys = $root.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.toObject(message.publicKeys, options); + if (options.oneofs) + object.result = "publicKeys"; } - if (message.height != null && message.hasOwnProperty("height")) - if (typeof message.height === "number") - object.height = options.longs === String ? String(message.height) : message.height; - else - 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() : message.height; - if (message.prove != null && message.hasOwnProperty("prove")) - object.prove = message.prove; + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); return object; }; /** - * Converts this GetConsensusParamsRequest to JSON. + * Converts this GetIdentitiesKeysResponse to JSON. * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse * @instance * @returns {Object.} JSON object */ - GetConsensusParamsRequest.prototype.toJSON = function toJSON() { + GetIdentitiesKeysResponse.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetConsensusParamsRequest; + GetIdentitiesKeysResponse.PublicKey = (function() { + + /** + * Properties of a PublicKey. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse + * @interface IPublicKey + * @property {Uint8Array|null} [value] PublicKey value + */ + + /** + * Constructs a new PublicKey. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse + * @classdesc Represents a PublicKey. + * @implements IPublicKey + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.IPublicKey=} [properties] Properties to set + */ + function PublicKey(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PublicKey value. + * @member {Uint8Array} value + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey + * @instance + */ + PublicKey.prototype.value = $util.newBuffer([]); + + /** + * Creates a new PublicKey instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.IPublicKey=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey} PublicKey instance + */ + PublicKey.create = function create(properties) { + return new PublicKey(properties); + }; + + /** + * Encodes the specified PublicKey message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.IPublicKey} message PublicKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublicKey.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified PublicKey message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.IPublicKey} message PublicKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublicKey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PublicKey message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey} PublicKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublicKey.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PublicKey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey} PublicKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublicKey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PublicKey message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PublicKey.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates a PublicKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey} PublicKey + */ + PublicKey.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey(); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from a PublicKey message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey} message PublicKey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PublicKey.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this PublicKey to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey + * @instance + * @returns {Object.} JSON object + */ + PublicKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PublicKey; + })(); + + GetIdentitiesKeysResponse.PublicKeyEntry = (function() { + + /** + * Properties of a PublicKeyEntry. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse + * @interface IPublicKeyEntry + * @property {Uint8Array|null} [key] PublicKeyEntry key + * @property {org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.IPublicKey|null} [value] PublicKeyEntry value + */ + + /** + * Constructs a new PublicKeyEntry. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse + * @classdesc Represents a PublicKeyEntry. + * @implements IPublicKeyEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.IPublicKeyEntry=} [properties] Properties to set + */ + function PublicKeyEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PublicKeyEntry key. + * @member {Uint8Array} key + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry + * @instance + */ + PublicKeyEntry.prototype.key = $util.newBuffer([]); + + /** + * PublicKeyEntry value. + * @member {org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.IPublicKey|null|undefined} value + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry + * @instance + */ + PublicKeyEntry.prototype.value = null; + + /** + * Creates a new PublicKeyEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.IPublicKeyEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry} PublicKeyEntry instance + */ + PublicKeyEntry.create = function create(properties) { + return new PublicKeyEntry(properties); + }; + + /** + * Encodes the specified PublicKeyEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.IPublicKeyEntry} message PublicKeyEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublicKeyEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + $root.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey.encode(message.value, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PublicKeyEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.IPublicKeyEntry} message PublicKeyEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublicKeyEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PublicKeyEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry} PublicKeyEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublicKeyEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.value = $root.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PublicKeyEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry} PublicKeyEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublicKeyEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PublicKeyEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PublicKeyEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) + return "key: buffer expected"; + if (message.value != null && message.hasOwnProperty("value")) { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey.verify(message.value); + if (error) + return "value." + error; + } + return null; + }; + + /** + * Creates a PublicKeyEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry} PublicKeyEntry + */ + PublicKeyEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry(); + if (object.key != null) + if (typeof object.key === "string") + $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); + else if (object.key.length >= 0) + message.key = object.key; + if (object.value != null) { + if (typeof object.value !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.value: object expected"); + message.value = $root.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey.fromObject(object.value); + } + return message; + }; + + /** + * Creates a plain object from a PublicKeyEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry} message PublicKeyEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PublicKeyEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.key = ""; + else { + object.key = []; + if (options.bytes !== Array) + object.key = $util.newBuffer(object.key); + } + object.value = null; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; + if (message.value != null && message.hasOwnProperty("value")) + object.value = $root.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey.toObject(message.value, options); + return object; + }; + + /** + * Converts this PublicKeyEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry + * @instance + * @returns {Object.} JSON object + */ + PublicKeyEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PublicKeyEntry; + })(); + + GetIdentitiesKeysResponse.PublicKeyEntries = (function() { + + /** + * Properties of a PublicKeyEntries. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse + * @interface IPublicKeyEntries + * @property {Array.|null} [publicKeyEntries] PublicKeyEntries publicKeyEntries + */ + + /** + * Constructs a new PublicKeyEntries. + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse + * @classdesc Represents a PublicKeyEntries. + * @implements IPublicKeyEntries + * @constructor + * @param {org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.IPublicKeyEntries=} [properties] Properties to set + */ + function PublicKeyEntries(properties) { + this.publicKeyEntries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PublicKeyEntries publicKeyEntries. + * @member {Array.} publicKeyEntries + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries + * @instance + */ + PublicKeyEntries.prototype.publicKeyEntries = $util.emptyArray; + + /** + * Creates a new PublicKeyEntries instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.IPublicKeyEntries=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries} PublicKeyEntries instance + */ + PublicKeyEntries.create = function create(properties) { + return new PublicKeyEntries(properties); + }; + + /** + * Encodes the specified PublicKeyEntries message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.IPublicKeyEntries} message PublicKeyEntries message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublicKeyEntries.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.publicKeyEntries != null && message.publicKeyEntries.length) + for (var i = 0; i < message.publicKeyEntries.length; ++i) + $root.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.encode(message.publicKeyEntries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PublicKeyEntries message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.IPublicKeyEntries} message PublicKeyEntries message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PublicKeyEntries.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PublicKeyEntries message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries} PublicKeyEntries + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublicKeyEntries.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.publicKeyEntries && message.publicKeyEntries.length)) + message.publicKeyEntries = []; + message.publicKeyEntries.push($root.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PublicKeyEntries message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries} PublicKeyEntries + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PublicKeyEntries.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PublicKeyEntries message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PublicKeyEntries.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.publicKeyEntries != null && message.hasOwnProperty("publicKeyEntries")) { + if (!Array.isArray(message.publicKeyEntries)) + return "publicKeyEntries: array expected"; + for (var i = 0; i < message.publicKeyEntries.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.verify(message.publicKeyEntries[i]); + if (error) + return "publicKeyEntries." + error; + } + } + return null; + }; + + /** + * Creates a PublicKeyEntries message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries} PublicKeyEntries + */ + PublicKeyEntries.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries(); + if (object.publicKeyEntries) { + if (!Array.isArray(object.publicKeyEntries)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.publicKeyEntries: array expected"); + message.publicKeyEntries = []; + for (var i = 0; i < object.publicKeyEntries.length; ++i) { + if (typeof object.publicKeyEntries[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.publicKeyEntries: object expected"); + message.publicKeyEntries[i] = $root.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.fromObject(object.publicKeyEntries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PublicKeyEntries message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries} message PublicKeyEntries + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PublicKeyEntries.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.publicKeyEntries = []; + if (message.publicKeyEntries && message.publicKeyEntries.length) { + object.publicKeyEntries = []; + for (var j = 0; j < message.publicKeyEntries.length; ++j) + object.publicKeyEntries[j] = $root.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.toObject(message.publicKeyEntries[j], options); + } + return object; + }; + + /** + * Converts this PublicKeyEntries to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries + * @instance + * @returns {Object.} JSON object + */ + PublicKeyEntries.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PublicKeyEntries; + })(); + + return GetIdentitiesKeysResponse; })(); - v0.GetConsensusParamsResponse = (function() { + v0.GetDataContractRequest = (function() { /** - * Properties of a GetConsensusParamsResponse. + * Properties of a GetDataContractRequest. * @memberof org.dash.platform.dapi.v0 - * @interface IGetConsensusParamsResponse - * @property {org.dash.platform.dapi.v0.IConsensusParamsBlock|null} [block] GetConsensusParamsResponse block - * @property {org.dash.platform.dapi.v0.IConsensusParamsEvidence|null} [evidence] GetConsensusParamsResponse evidence + * @interface IGetDataContractRequest + * @property {Uint8Array|null} [id] GetDataContractRequest id + * @property {boolean|null} [prove] GetDataContractRequest prove */ /** - * Constructs a new GetConsensusParamsResponse. + * Constructs a new GetDataContractRequest. * @memberof org.dash.platform.dapi.v0 - * @classdesc Represents a GetConsensusParamsResponse. - * @implements IGetConsensusParamsResponse + * @classdesc Represents a GetDataContractRequest. + * @implements IGetDataContractRequest * @constructor - * @param {org.dash.platform.dapi.v0.IGetConsensusParamsResponse=} [properties] Properties to set + * @param {org.dash.platform.dapi.v0.IGetDataContractRequest=} [properties] Properties to set */ - function GetConsensusParamsResponse(properties) { + function GetDataContractRequest(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -4779,88 +6035,88 @@ $root.org = (function() { } /** - * GetConsensusParamsResponse block. - * @member {org.dash.platform.dapi.v0.IConsensusParamsBlock|null|undefined} block - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * GetDataContractRequest id. + * @member {Uint8Array} id + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest * @instance */ - GetConsensusParamsResponse.prototype.block = null; + GetDataContractRequest.prototype.id = $util.newBuffer([]); /** - * GetConsensusParamsResponse evidence. - * @member {org.dash.platform.dapi.v0.IConsensusParamsEvidence|null|undefined} evidence - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * GetDataContractRequest prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest * @instance */ - GetConsensusParamsResponse.prototype.evidence = null; + GetDataContractRequest.prototype.prove = false; /** - * Creates a new GetConsensusParamsResponse instance using the specified properties. + * Creates a new GetDataContractRequest instance using the specified properties. * @function create - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest * @static - * @param {org.dash.platform.dapi.v0.IGetConsensusParamsResponse=} [properties] Properties to set - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse} GetConsensusParamsResponse instance + * @param {org.dash.platform.dapi.v0.IGetDataContractRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractRequest} GetDataContractRequest instance */ - GetConsensusParamsResponse.create = function create(properties) { - return new GetConsensusParamsResponse(properties); + GetDataContractRequest.create = function create(properties) { + return new GetDataContractRequest(properties); }; /** - * Encodes the specified GetConsensusParamsResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsResponse.verify|verify} messages. + * Encodes the specified GetDataContractRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractRequest.verify|verify} messages. * @function encode - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest * @static - * @param {org.dash.platform.dapi.v0.IGetConsensusParamsResponse} message GetConsensusParamsResponse message or plain object to encode + * @param {org.dash.platform.dapi.v0.IGetDataContractRequest} message GetDataContractRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetConsensusParamsResponse.encode = function encode(message, writer) { + GetDataContractRequest.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.block != null && Object.hasOwnProperty.call(message, "block")) - $root.org.dash.platform.dapi.v0.ConsensusParamsBlock.encode(message.block, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.evidence != null && Object.hasOwnProperty.call(message, "evidence")) - $root.org.dash.platform.dapi.v0.ConsensusParamsEvidence.encode(message.evidence, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.id); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); return writer; }; /** - * Encodes the specified GetConsensusParamsResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsResponse.verify|verify} messages. + * Encodes the specified GetDataContractRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractRequest.verify|verify} messages. * @function encodeDelimited - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest * @static - * @param {org.dash.platform.dapi.v0.IGetConsensusParamsResponse} message GetConsensusParamsResponse message or plain object to encode + * @param {org.dash.platform.dapi.v0.IGetDataContractRequest} message GetDataContractRequest message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - GetConsensusParamsResponse.encodeDelimited = function encodeDelimited(message, writer) { + GetDataContractRequest.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a GetConsensusParamsResponse message from the specified reader or buffer. + * Decodes a GetDataContractRequest message from the specified reader or buffer. * @function decode - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse} GetConsensusParamsResponse + * @returns {org.dash.platform.dapi.v0.GetDataContractRequest} GetDataContractRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetConsensusParamsResponse.decode = function decode(reader, length) { + GetDataContractRequest.decode = function decode(reader, length) { if (!(reader instanceof $Reader)) reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractRequest(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.block = $root.org.dash.platform.dapi.v0.ConsensusParamsBlock.decode(reader, reader.uint32()); + message.id = reader.bytes(); break; case 2: - message.evidence = $root.org.dash.platform.dapi.v0.ConsensusParamsEvidence.decode(reader, reader.uint32()); + message.prove = reader.bool(); break; default: reader.skipType(tag & 7); @@ -4871,140 +6127,7096 @@ $root.org = (function() { }; /** - * Decodes a GetConsensusParamsResponse message from the specified reader or buffer, length delimited. + * Decodes a GetDataContractRequest message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse} GetConsensusParamsResponse + * @returns {org.dash.platform.dapi.v0.GetDataContractRequest} GetDataContractRequest * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - GetConsensusParamsResponse.decodeDelimited = function decodeDelimited(reader) { + GetDataContractRequest.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a GetConsensusParamsResponse message. + * Verifies a GetDataContractRequest message. * @function verify - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - GetConsensusParamsResponse.verify = function verify(message) { + GetDataContractRequest.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.block != null && message.hasOwnProperty("block")) { - var error = $root.org.dash.platform.dapi.v0.ConsensusParamsBlock.verify(message.block); - if (error) - return "block." + error; - } - if (message.evidence != null && message.hasOwnProperty("evidence")) { - var error = $root.org.dash.platform.dapi.v0.ConsensusParamsEvidence.verify(message.evidence); - if (error) - return "evidence." + error; - } + if (message.id != null && message.hasOwnProperty("id")) + if (!(message.id && typeof message.id.length === "number" || $util.isString(message.id))) + return "id: buffer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; return null; }; /** - * Creates a GetConsensusParamsResponse message from a plain object. Also converts values to their respective internal types. + * Creates a GetDataContractRequest message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest * @static * @param {Object.} object Plain object - * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse} GetConsensusParamsResponse + * @returns {org.dash.platform.dapi.v0.GetDataContractRequest} GetDataContractRequest */ - GetConsensusParamsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse) + GetDataContractRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractRequest) return object; - var message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse(); - if (object.block != null) { - if (typeof object.block !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetConsensusParamsResponse.block: object expected"); - message.block = $root.org.dash.platform.dapi.v0.ConsensusParamsBlock.fromObject(object.block); - } - if (object.evidence != null) { - if (typeof object.evidence !== "object") - throw TypeError(".org.dash.platform.dapi.v0.GetConsensusParamsResponse.evidence: object expected"); - message.evidence = $root.org.dash.platform.dapi.v0.ConsensusParamsEvidence.fromObject(object.evidence); - } + var message = new $root.org.dash.platform.dapi.v0.GetDataContractRequest(); + if (object.id != null) + if (typeof object.id === "string") + $util.base64.decode(object.id, message.id = $util.newBuffer($util.base64.length(object.id)), 0); + else if (object.id.length >= 0) + message.id = object.id; + if (object.prove != null) + message.prove = Boolean(object.prove); return message; }; /** - * Creates a plain object from a GetConsensusParamsResponse message. Also converts values to other types if specified. + * Creates a plain object from a GetDataContractRequest message. Also converts values to other types if specified. * @function toObject - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest * @static - * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse} message GetConsensusParamsResponse + * @param {org.dash.platform.dapi.v0.GetDataContractRequest} message GetDataContractRequest * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - GetConsensusParamsResponse.toObject = function toObject(message, options) { + GetDataContractRequest.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; if (options.defaults) { - object.block = null; - object.evidence = null; + if (options.bytes === String) + object.id = ""; + else { + object.id = []; + if (options.bytes !== Array) + object.id = $util.newBuffer(object.id); + } + object.prove = false; } - if (message.block != null && message.hasOwnProperty("block")) - object.block = $root.org.dash.platform.dapi.v0.ConsensusParamsBlock.toObject(message.block, options); - if (message.evidence != null && message.hasOwnProperty("evidence")) - object.evidence = $root.org.dash.platform.dapi.v0.ConsensusParamsEvidence.toObject(message.evidence, options); + if (message.id != null && message.hasOwnProperty("id")) + object.id = options.bytes === String ? $util.base64.encode(message.id, 0, message.id.length) : options.bytes === Array ? Array.prototype.slice.call(message.id) : message.id; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; return object; }; /** - * Converts this GetConsensusParamsResponse to JSON. + * Converts this GetDataContractRequest to JSON. * @function toJSON - * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @memberof org.dash.platform.dapi.v0.GetDataContractRequest * @instance * @returns {Object.} JSON object */ - GetConsensusParamsResponse.prototype.toJSON = function toJSON() { + GetDataContractRequest.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return GetConsensusParamsResponse; + return GetDataContractRequest; })(); - return v0; - })(); + v0.GetDataContractResponse = (function() { - return dapi; - })(); + /** + * Properties of a GetDataContractResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetDataContractResponse + * @property {Uint8Array|null} [dataContract] GetDataContractResponse dataContract + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetDataContractResponse proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetDataContractResponse metadata + */ - return platform; - })(); + /** + * Constructs a new GetDataContractResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetDataContractResponse. + * @implements IGetDataContractResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetDataContractResponse=} [properties] Properties to set + */ + function GetDataContractResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } - return dash; - })(); + /** + * GetDataContractResponse dataContract. + * @member {Uint8Array} dataContract + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @instance + */ + GetDataContractResponse.prototype.dataContract = $util.newBuffer([]); - return org; -})(); + /** + * GetDataContractResponse proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @instance + */ + GetDataContractResponse.prototype.proof = null; -$root.google = (function() { + /** + * GetDataContractResponse metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @instance + */ + GetDataContractResponse.prototype.metadata = null; - /** - * Namespace google. - * @exports google - * @namespace - */ - var google = {}; + /** + * Creates a new GetDataContractResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractResponse} GetDataContractResponse instance + */ + GetDataContractResponse.create = function create(properties) { + return new GetDataContractResponse(properties); + }; - google.protobuf = (function() { + /** + * Encodes the specified GetDataContractResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractResponse} message GetDataContractResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataContract != null && Object.hasOwnProperty.call(message, "dataContract")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.dataContract); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; - /** - * Namespace protobuf. - * @memberof google - * @namespace - */ - var protobuf = {}; + /** + * Encodes the specified GetDataContractResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractResponse} message GetDataContractResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataContractResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractResponse} GetDataContractResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dataContract = reader.bytes(); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDataContractResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractResponse} GetDataContractResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataContractResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataContractResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataContract != null && message.hasOwnProperty("dataContract")) + if (!(message.dataContract && typeof message.dataContract.length === "number" || $util.isString(message.dataContract))) + return "dataContract: buffer expected"; + if (message.proof != null && message.hasOwnProperty("proof")) { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetDataContractResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractResponse} GetDataContractResponse + */ + GetDataContractResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractResponse(); + if (object.dataContract != null) + if (typeof object.dataContract === "string") + $util.base64.decode(object.dataContract, message.dataContract = $util.newBuffer($util.base64.length(object.dataContract)), 0); + else if (object.dataContract.length >= 0) + message.dataContract = object.dataContract; + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractResponse.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractResponse.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetDataContractResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractResponse} message GetDataContractResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataContractResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.dataContract = ""; + else { + object.dataContract = []; + if (options.bytes !== Array) + object.dataContract = $util.newBuffer(object.dataContract); + } + object.proof = null; + object.metadata = null; + } + if (message.dataContract != null && message.hasOwnProperty("dataContract")) + object.dataContract = options.bytes === String ? $util.base64.encode(message.dataContract, 0, message.dataContract.length) : options.bytes === Array ? Array.prototype.slice.call(message.dataContract) : message.dataContract; + if (message.proof != null && message.hasOwnProperty("proof")) + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetDataContractResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractResponse + * @instance + * @returns {Object.} JSON object + */ + GetDataContractResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetDataContractResponse; + })(); + + v0.GetDataContractsRequest = (function() { + + /** + * Properties of a GetDataContractsRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetDataContractsRequest + * @property {Array.|null} [ids] GetDataContractsRequest ids + * @property {boolean|null} [prove] GetDataContractsRequest prove + */ + + /** + * Constructs a new GetDataContractsRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetDataContractsRequest. + * @implements IGetDataContractsRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetDataContractsRequest=} [properties] Properties to set + */ + function GetDataContractsRequest(properties) { + this.ids = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDataContractsRequest ids. + * @member {Array.} ids + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @instance + */ + GetDataContractsRequest.prototype.ids = $util.emptyArray; + + /** + * GetDataContractsRequest prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @instance + */ + GetDataContractsRequest.prototype.prove = false; + + /** + * Creates a new GetDataContractsRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractsRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractsRequest} GetDataContractsRequest instance + */ + GetDataContractsRequest.create = function create(properties) { + return new GetDataContractsRequest(properties); + }; + + /** + * Encodes the specified GetDataContractsRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractsRequest} message GetDataContractsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ids != null && message.ids.length) + for (var i = 0; i < message.ids.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.ids[i]); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetDataContractsRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractsRequest} message GetDataContractsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataContractsRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractsRequest} GetDataContractsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.ids && message.ids.length)) + message.ids = []; + message.ids.push(reader.bytes()); + break; + case 2: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDataContractsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractsRequest} GetDataContractsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataContractsRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataContractsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ids != null && message.hasOwnProperty("ids")) { + if (!Array.isArray(message.ids)) + return "ids: array expected"; + for (var i = 0; i < message.ids.length; ++i) + if (!(message.ids[i] && typeof message.ids[i].length === "number" || $util.isString(message.ids[i]))) + return "ids: buffer[] expected"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetDataContractsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractsRequest} GetDataContractsRequest + */ + GetDataContractsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractsRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractsRequest(); + if (object.ids) { + if (!Array.isArray(object.ids)) + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsRequest.ids: array expected"); + message.ids = []; + for (var i = 0; i < object.ids.length; ++i) + if (typeof object.ids[i] === "string") + $util.base64.decode(object.ids[i], message.ids[i] = $util.newBuffer($util.base64.length(object.ids[i])), 0); + else if (object.ids[i].length >= 0) + message.ids[i] = object.ids[i]; + } + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetDataContractsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsRequest} message GetDataContractsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataContractsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.ids = []; + if (options.defaults) + object.prove = false; + if (message.ids && message.ids.length) { + object.ids = []; + for (var j = 0; j < message.ids.length; ++j) + object.ids[j] = options.bytes === String ? $util.base64.encode(message.ids[j], 0, message.ids[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.ids[j]) : message.ids[j]; + } + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetDataContractsRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractsRequest + * @instance + * @returns {Object.} JSON object + */ + GetDataContractsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetDataContractsRequest; + })(); + + v0.GetDataContractsResponse = (function() { + + /** + * Properties of a GetDataContractsResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetDataContractsResponse + * @property {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContracts|null} [dataContracts] GetDataContractsResponse dataContracts + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetDataContractsResponse proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetDataContractsResponse metadata + */ + + /** + * Constructs a new GetDataContractsResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetDataContractsResponse. + * @implements IGetDataContractsResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetDataContractsResponse=} [properties] Properties to set + */ + function GetDataContractsResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDataContractsResponse dataContracts. + * @member {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContracts|null|undefined} dataContracts + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @instance + */ + GetDataContractsResponse.prototype.dataContracts = null; + + /** + * GetDataContractsResponse proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @instance + */ + GetDataContractsResponse.prototype.proof = null; + + /** + * GetDataContractsResponse metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @instance + */ + GetDataContractsResponse.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetDataContractsResponse result. + * @member {"dataContracts"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @instance + */ + Object.defineProperty(GetDataContractsResponse.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["dataContracts", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetDataContractsResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractsResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse} GetDataContractsResponse instance + */ + GetDataContractsResponse.create = function create(properties) { + return new GetDataContractsResponse(properties); + }; + + /** + * Encodes the specified GetDataContractsResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractsResponse} message GetDataContractsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataContracts != null && Object.hasOwnProperty.call(message, "dataContracts")) + $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.encode(message.dataContracts, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetDataContractsResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetDataContractsResponse} message GetDataContractsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataContractsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataContractsResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse} GetDataContractsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dataContracts = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDataContractsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse} GetDataContractsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataContractsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataContractsResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataContractsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.dataContracts != null && message.hasOwnProperty("dataContracts")) { + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.verify(message.dataContracts); + if (error) + return "dataContracts." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetDataContractsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse} GetDataContractsResponse + */ + GetDataContractsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractsResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractsResponse(); + if (object.dataContracts != null) { + if (typeof object.dataContracts !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsResponse.dataContracts: object expected"); + message.dataContracts = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.fromObject(object.dataContracts); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsResponse.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsResponse.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetDataContractsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse} message GetDataContractsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataContractsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.dataContracts != null && message.hasOwnProperty("dataContracts")) { + object.dataContracts = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.toObject(message.dataContracts, options); + if (options.oneofs) + object.result = "dataContracts"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetDataContractsResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @instance + * @returns {Object.} JSON object + */ + GetDataContractsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GetDataContractsResponse.DataContractValue = (function() { + + /** + * Properties of a DataContractValue. + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @interface IDataContractValue + * @property {Uint8Array|null} [value] DataContractValue value + */ + + /** + * Constructs a new DataContractValue. + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @classdesc Represents a DataContractValue. + * @implements IDataContractValue + * @constructor + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContractValue=} [properties] Properties to set + */ + function DataContractValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataContractValue value. + * @member {Uint8Array} value + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue + * @instance + */ + DataContractValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new DataContractValue instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContractValue=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue} DataContractValue instance + */ + DataContractValue.create = function create(properties) { + return new DataContractValue(properties); + }; + + /** + * Encodes the specified DataContractValue message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContractValue} message DataContractValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataContractValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified DataContractValue message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContractValue} message DataContractValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataContractValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataContractValue message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue} DataContractValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataContractValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataContractValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue} DataContractValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataContractValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataContractValue message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataContractValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates a DataContractValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue} DataContractValue + */ + DataContractValue.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue(); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from a DataContractValue message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue} message DataContractValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataContractValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this DataContractValue to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue + * @instance + * @returns {Object.} JSON object + */ + DataContractValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DataContractValue; + })(); + + GetDataContractsResponse.DataContractEntry = (function() { + + /** + * Properties of a DataContractEntry. + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @interface IDataContractEntry + * @property {Uint8Array|null} [key] DataContractEntry key + * @property {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContractValue|null} [value] DataContractEntry value + */ + + /** + * Constructs a new DataContractEntry. + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @classdesc Represents a DataContractEntry. + * @implements IDataContractEntry + * @constructor + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContractEntry=} [properties] Properties to set + */ + function DataContractEntry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataContractEntry key. + * @member {Uint8Array} key + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry + * @instance + */ + DataContractEntry.prototype.key = $util.newBuffer([]); + + /** + * DataContractEntry value. + * @member {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContractValue|null|undefined} value + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry + * @instance + */ + DataContractEntry.prototype.value = null; + + /** + * Creates a new DataContractEntry instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContractEntry=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} DataContractEntry instance + */ + DataContractEntry.create = function create(properties) { + return new DataContractEntry(properties); + }; + + /** + * Encodes the specified DataContractEntry message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContractEntry} message DataContractEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataContractEntry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.key); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue.encode(message.value, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataContractEntry message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContractEntry} message DataContractEntry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataContractEntry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataContractEntry message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} DataContractEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataContractEntry.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.value = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataContractEntry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} DataContractEntry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataContractEntry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataContractEntry message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataContractEntry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) + return "key: buffer expected"; + if (message.value != null && message.hasOwnProperty("value")) { + var error = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue.verify(message.value); + if (error) + return "value." + error; + } + return null; + }; + + /** + * Creates a DataContractEntry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} DataContractEntry + */ + DataContractEntry.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry(); + if (object.key != null) + if (typeof object.key === "string") + $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); + else if (object.key.length >= 0) + message.key = object.key; + if (object.value != null) { + if (typeof object.value !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.value: object expected"); + message.value = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue.fromObject(object.value); + } + return message; + }; + + /** + * Creates a plain object from a DataContractEntry message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} message DataContractEntry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataContractEntry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.key = ""; + else { + object.key = []; + if (options.bytes !== Array) + object.key = $util.newBuffer(object.key); + } + object.value = null; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; + if (message.value != null && message.hasOwnProperty("value")) + object.value = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue.toObject(message.value, options); + return object; + }; + + /** + * Converts this DataContractEntry to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry + * @instance + * @returns {Object.} JSON object + */ + DataContractEntry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DataContractEntry; + })(); + + GetDataContractsResponse.DataContracts = (function() { + + /** + * Properties of a DataContracts. + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @interface IDataContracts + * @property {Array.|null} [dataContractEntries] DataContracts dataContractEntries + */ + + /** + * Constructs a new DataContracts. + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse + * @classdesc Represents a DataContracts. + * @implements IDataContracts + * @constructor + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContracts=} [properties] Properties to set + */ + function DataContracts(properties) { + this.dataContractEntries = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataContracts dataContractEntries. + * @member {Array.} dataContractEntries + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts + * @instance + */ + DataContracts.prototype.dataContractEntries = $util.emptyArray; + + /** + * Creates a new DataContracts instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContracts=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} DataContracts instance + */ + DataContracts.create = function create(properties) { + return new DataContracts(properties); + }; + + /** + * Encodes the specified DataContracts message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContracts} message DataContracts message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataContracts.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataContractEntries != null && message.dataContractEntries.length) + for (var i = 0; i < message.dataContractEntries.length; ++i) + $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.encode(message.dataContractEntries[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataContracts message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.IDataContracts} message DataContracts message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataContracts.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataContracts message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} DataContracts + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataContracts.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.dataContractEntries && message.dataContractEntries.length)) + message.dataContractEntries = []; + message.dataContractEntries.push($root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataContracts message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} DataContracts + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataContracts.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataContracts message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataContracts.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataContractEntries != null && message.hasOwnProperty("dataContractEntries")) { + if (!Array.isArray(message.dataContractEntries)) + return "dataContractEntries: array expected"; + for (var i = 0; i < message.dataContractEntries.length; ++i) { + var error = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.verify(message.dataContractEntries[i]); + if (error) + return "dataContractEntries." + error; + } + } + return null; + }; + + /** + * Creates a DataContracts message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} DataContracts + */ + DataContracts.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts(); + if (object.dataContractEntries) { + if (!Array.isArray(object.dataContractEntries)) + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.dataContractEntries: array expected"); + message.dataContractEntries = []; + for (var i = 0; i < object.dataContractEntries.length; ++i) { + if (typeof object.dataContractEntries[i] !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.dataContractEntries: object expected"); + message.dataContractEntries[i] = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.fromObject(object.dataContractEntries[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a DataContracts message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts + * @static + * @param {org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} message DataContracts + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataContracts.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dataContractEntries = []; + if (message.dataContractEntries && message.dataContractEntries.length) { + object.dataContractEntries = []; + for (var j = 0; j < message.dataContractEntries.length; ++j) + object.dataContractEntries[j] = $root.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.toObject(message.dataContractEntries[j], options); + } + return object; + }; + + /** + * Converts this DataContracts to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts + * @instance + * @returns {Object.} JSON object + */ + DataContracts.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DataContracts; + })(); + + return GetDataContractsResponse; + })(); + + v0.GetDocumentsRequest = (function() { + + /** + * Properties of a GetDocumentsRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetDocumentsRequest + * @property {Uint8Array|null} [dataContractId] GetDocumentsRequest dataContractId + * @property {string|null} [documentType] GetDocumentsRequest documentType + * @property {Uint8Array|null} [where] GetDocumentsRequest where + * @property {Uint8Array|null} [orderBy] GetDocumentsRequest orderBy + * @property {number|null} [limit] GetDocumentsRequest limit + * @property {Uint8Array|null} [startAfter] GetDocumentsRequest startAfter + * @property {Uint8Array|null} [startAt] GetDocumentsRequest startAt + * @property {boolean|null} [prove] GetDocumentsRequest prove + */ + + /** + * Constructs a new GetDocumentsRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetDocumentsRequest. + * @implements IGetDocumentsRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetDocumentsRequest=} [properties] Properties to set + */ + function GetDocumentsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDocumentsRequest dataContractId. + * @member {Uint8Array} dataContractId + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @instance + */ + GetDocumentsRequest.prototype.dataContractId = $util.newBuffer([]); + + /** + * GetDocumentsRequest documentType. + * @member {string} documentType + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @instance + */ + GetDocumentsRequest.prototype.documentType = ""; + + /** + * GetDocumentsRequest where. + * @member {Uint8Array} where + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @instance + */ + GetDocumentsRequest.prototype.where = $util.newBuffer([]); + + /** + * GetDocumentsRequest orderBy. + * @member {Uint8Array} orderBy + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @instance + */ + GetDocumentsRequest.prototype.orderBy = $util.newBuffer([]); + + /** + * GetDocumentsRequest limit. + * @member {number} limit + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @instance + */ + GetDocumentsRequest.prototype.limit = 0; + + /** + * GetDocumentsRequest startAfter. + * @member {Uint8Array} startAfter + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @instance + */ + GetDocumentsRequest.prototype.startAfter = $util.newBuffer([]); + + /** + * GetDocumentsRequest startAt. + * @member {Uint8Array} startAt + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @instance + */ + GetDocumentsRequest.prototype.startAt = $util.newBuffer([]); + + /** + * GetDocumentsRequest prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @instance + */ + GetDocumentsRequest.prototype.prove = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetDocumentsRequest start. + * @member {"startAfter"|"startAt"|undefined} start + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @instance + */ + Object.defineProperty(GetDocumentsRequest.prototype, "start", { + get: $util.oneOfGetter($oneOfFields = ["startAfter", "startAt"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetDocumentsRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetDocumentsRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest} GetDocumentsRequest instance + */ + GetDocumentsRequest.create = function create(properties) { + return new GetDocumentsRequest(properties); + }; + + /** + * Encodes the specified GetDocumentsRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetDocumentsRequest} message GetDocumentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDocumentsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataContractId != null && Object.hasOwnProperty.call(message, "dataContractId")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.dataContractId); + if (message.documentType != null && Object.hasOwnProperty.call(message, "documentType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.documentType); + if (message.where != null && Object.hasOwnProperty.call(message, "where")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.where); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 4, wireType 2 =*/34).bytes(message.orderBy); + if (message.limit != null && Object.hasOwnProperty.call(message, "limit")) + writer.uint32(/* id 5, wireType 0 =*/40).uint32(message.limit); + if (message.startAfter != null && Object.hasOwnProperty.call(message, "startAfter")) + writer.uint32(/* id 6, wireType 2 =*/50).bytes(message.startAfter); + if (message.startAt != null && Object.hasOwnProperty.call(message, "startAt")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.startAt); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetDocumentsRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetDocumentsRequest} message GetDocumentsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDocumentsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDocumentsRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest} GetDocumentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDocumentsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.dataContractId = reader.bytes(); + break; + case 2: + message.documentType = reader.string(); + break; + case 3: + message.where = reader.bytes(); + break; + case 4: + message.orderBy = reader.bytes(); + break; + case 5: + message.limit = reader.uint32(); + break; + case 6: + message.startAfter = reader.bytes(); + break; + case 7: + message.startAt = reader.bytes(); + break; + case 8: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDocumentsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest} GetDocumentsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDocumentsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDocumentsRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDocumentsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.dataContractId != null && message.hasOwnProperty("dataContractId")) + if (!(message.dataContractId && typeof message.dataContractId.length === "number" || $util.isString(message.dataContractId))) + return "dataContractId: buffer expected"; + if (message.documentType != null && message.hasOwnProperty("documentType")) + if (!$util.isString(message.documentType)) + return "documentType: string expected"; + if (message.where != null && message.hasOwnProperty("where")) + if (!(message.where && typeof message.where.length === "number" || $util.isString(message.where))) + return "where: buffer expected"; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + if (!(message.orderBy && typeof message.orderBy.length === "number" || $util.isString(message.orderBy))) + return "orderBy: buffer expected"; + if (message.limit != null && message.hasOwnProperty("limit")) + if (!$util.isInteger(message.limit)) + return "limit: integer expected"; + if (message.startAfter != null && message.hasOwnProperty("startAfter")) { + properties.start = 1; + if (!(message.startAfter && typeof message.startAfter.length === "number" || $util.isString(message.startAfter))) + return "startAfter: buffer expected"; + } + if (message.startAt != null && message.hasOwnProperty("startAt")) { + if (properties.start === 1) + return "start: multiple values"; + properties.start = 1; + if (!(message.startAt && typeof message.startAt.length === "number" || $util.isString(message.startAt))) + return "startAt: buffer expected"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetDocumentsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDocumentsRequest} GetDocumentsRequest + */ + GetDocumentsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDocumentsRequest(); + if (object.dataContractId != null) + if (typeof object.dataContractId === "string") + $util.base64.decode(object.dataContractId, message.dataContractId = $util.newBuffer($util.base64.length(object.dataContractId)), 0); + else if (object.dataContractId.length >= 0) + message.dataContractId = object.dataContractId; + if (object.documentType != null) + message.documentType = String(object.documentType); + if (object.where != null) + if (typeof object.where === "string") + $util.base64.decode(object.where, message.where = $util.newBuffer($util.base64.length(object.where)), 0); + else if (object.where.length >= 0) + message.where = object.where; + if (object.orderBy != null) + if (typeof object.orderBy === "string") + $util.base64.decode(object.orderBy, message.orderBy = $util.newBuffer($util.base64.length(object.orderBy)), 0); + else if (object.orderBy.length >= 0) + message.orderBy = object.orderBy; + if (object.limit != null) + message.limit = object.limit >>> 0; + if (object.startAfter != null) + if (typeof object.startAfter === "string") + $util.base64.decode(object.startAfter, message.startAfter = $util.newBuffer($util.base64.length(object.startAfter)), 0); + else if (object.startAfter.length >= 0) + message.startAfter = object.startAfter; + if (object.startAt != null) + if (typeof object.startAt === "string") + $util.base64.decode(object.startAt, message.startAt = $util.newBuffer($util.base64.length(object.startAt)), 0); + else if (object.startAt.length >= 0) + message.startAt = object.startAt; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetDocumentsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsRequest} message GetDocumentsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDocumentsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.dataContractId = ""; + else { + object.dataContractId = []; + if (options.bytes !== Array) + object.dataContractId = $util.newBuffer(object.dataContractId); + } + object.documentType = ""; + if (options.bytes === String) + object.where = ""; + else { + object.where = []; + if (options.bytes !== Array) + object.where = $util.newBuffer(object.where); + } + if (options.bytes === String) + object.orderBy = ""; + else { + object.orderBy = []; + if (options.bytes !== Array) + object.orderBy = $util.newBuffer(object.orderBy); + } + object.limit = 0; + object.prove = false; + } + if (message.dataContractId != null && message.hasOwnProperty("dataContractId")) + object.dataContractId = options.bytes === String ? $util.base64.encode(message.dataContractId, 0, message.dataContractId.length) : options.bytes === Array ? Array.prototype.slice.call(message.dataContractId) : message.dataContractId; + if (message.documentType != null && message.hasOwnProperty("documentType")) + object.documentType = message.documentType; + if (message.where != null && message.hasOwnProperty("where")) + object.where = options.bytes === String ? $util.base64.encode(message.where, 0, message.where.length) : options.bytes === Array ? Array.prototype.slice.call(message.where) : message.where; + if (message.orderBy != null && message.hasOwnProperty("orderBy")) + object.orderBy = options.bytes === String ? $util.base64.encode(message.orderBy, 0, message.orderBy.length) : options.bytes === Array ? Array.prototype.slice.call(message.orderBy) : message.orderBy; + if (message.limit != null && message.hasOwnProperty("limit")) + object.limit = message.limit; + if (message.startAfter != null && message.hasOwnProperty("startAfter")) { + object.startAfter = options.bytes === String ? $util.base64.encode(message.startAfter, 0, message.startAfter.length) : options.bytes === Array ? Array.prototype.slice.call(message.startAfter) : message.startAfter; + if (options.oneofs) + object.start = "startAfter"; + } + if (message.startAt != null && message.hasOwnProperty("startAt")) { + object.startAt = options.bytes === String ? $util.base64.encode(message.startAt, 0, message.startAt.length) : options.bytes === Array ? Array.prototype.slice.call(message.startAt) : message.startAt; + if (options.oneofs) + object.start = "startAt"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetDocumentsRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDocumentsRequest + * @instance + * @returns {Object.} JSON object + */ + GetDocumentsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetDocumentsRequest; + })(); + + v0.GetDocumentsResponse = (function() { + + /** + * Properties of a GetDocumentsResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetDocumentsResponse + * @property {Array.|null} [documents] GetDocumentsResponse documents + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetDocumentsResponse proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetDocumentsResponse metadata + */ + + /** + * Constructs a new GetDocumentsResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetDocumentsResponse. + * @implements IGetDocumentsResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetDocumentsResponse=} [properties] Properties to set + */ + function GetDocumentsResponse(properties) { + this.documents = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDocumentsResponse documents. + * @member {Array.} documents + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @instance + */ + GetDocumentsResponse.prototype.documents = $util.emptyArray; + + /** + * GetDocumentsResponse proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @instance + */ + GetDocumentsResponse.prototype.proof = null; + + /** + * GetDocumentsResponse metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @instance + */ + GetDocumentsResponse.prototype.metadata = null; + + /** + * Creates a new GetDocumentsResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetDocumentsResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse} GetDocumentsResponse instance + */ + GetDocumentsResponse.create = function create(properties) { + return new GetDocumentsResponse(properties); + }; + + /** + * Encodes the specified GetDocumentsResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetDocumentsResponse} message GetDocumentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDocumentsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.documents != null && message.documents.length) + for (var i = 0; i < message.documents.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.documents[i]); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetDocumentsResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetDocumentsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetDocumentsResponse} message GetDocumentsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDocumentsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDocumentsResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse} GetDocumentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDocumentsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.documents && message.documents.length)) + message.documents = []; + message.documents.push(reader.bytes()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetDocumentsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse} GetDocumentsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDocumentsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDocumentsResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDocumentsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.documents != null && message.hasOwnProperty("documents")) { + if (!Array.isArray(message.documents)) + return "documents: array expected"; + for (var i = 0; i < message.documents.length; ++i) + if (!(message.documents[i] && typeof message.documents[i].length === "number" || $util.isString(message.documents[i]))) + return "documents: buffer[] expected"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetDocumentsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetDocumentsResponse} GetDocumentsResponse + */ + GetDocumentsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetDocumentsResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetDocumentsResponse(); + if (object.documents) { + if (!Array.isArray(object.documents)) + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.documents: array expected"); + message.documents = []; + for (var i = 0; i < object.documents.length; ++i) + if (typeof object.documents[i] === "string") + $util.base64.decode(object.documents[i], message.documents[i] = $util.newBuffer($util.base64.length(object.documents[i])), 0); + else if (object.documents[i].length >= 0) + message.documents[i] = object.documents[i]; + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetDocumentsResponse.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetDocumentsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @static + * @param {org.dash.platform.dapi.v0.GetDocumentsResponse} message GetDocumentsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDocumentsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.documents = []; + if (options.defaults) { + object.proof = null; + object.metadata = null; + } + if (message.documents && message.documents.length) { + object.documents = []; + for (var j = 0; j < message.documents.length; ++j) + object.documents[j] = options.bytes === String ? $util.base64.encode(message.documents[j], 0, message.documents[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.documents[j]) : message.documents[j]; + } + if (message.proof != null && message.hasOwnProperty("proof")) + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetDocumentsResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetDocumentsResponse + * @instance + * @returns {Object.} JSON object + */ + GetDocumentsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetDocumentsResponse; + })(); + + v0.GetIdentitiesByPublicKeyHashesRequest = (function() { + + /** + * Properties of a GetIdentitiesByPublicKeyHashesRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentitiesByPublicKeyHashesRequest + * @property {Array.|null} [publicKeyHashes] GetIdentitiesByPublicKeyHashesRequest publicKeyHashes + * @property {boolean|null} [prove] GetIdentitiesByPublicKeyHashesRequest prove + */ + + /** + * Constructs a new GetIdentitiesByPublicKeyHashesRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentitiesByPublicKeyHashesRequest. + * @implements IGetIdentitiesByPublicKeyHashesRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentitiesByPublicKeyHashesRequest=} [properties] Properties to set + */ + function GetIdentitiesByPublicKeyHashesRequest(properties) { + this.publicKeyHashes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentitiesByPublicKeyHashesRequest publicKeyHashes. + * @member {Array.} publicKeyHashes + * @memberof org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest + * @instance + */ + GetIdentitiesByPublicKeyHashesRequest.prototype.publicKeyHashes = $util.emptyArray; + + /** + * GetIdentitiesByPublicKeyHashesRequest prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest + * @instance + */ + GetIdentitiesByPublicKeyHashesRequest.prototype.prove = false; + + /** + * Creates a new GetIdentitiesByPublicKeyHashesRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesByPublicKeyHashesRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest} GetIdentitiesByPublicKeyHashesRequest instance + */ + GetIdentitiesByPublicKeyHashesRequest.create = function create(properties) { + return new GetIdentitiesByPublicKeyHashesRequest(properties); + }; + + /** + * Encodes the specified GetIdentitiesByPublicKeyHashesRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesByPublicKeyHashesRequest} message GetIdentitiesByPublicKeyHashesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesByPublicKeyHashesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.publicKeyHashes != null && message.publicKeyHashes.length) + for (var i = 0; i < message.publicKeyHashes.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.publicKeyHashes[i]); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesByPublicKeyHashesRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesByPublicKeyHashesRequest} message GetIdentitiesByPublicKeyHashesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesByPublicKeyHashesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesByPublicKeyHashesRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest} GetIdentitiesByPublicKeyHashesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesByPublicKeyHashesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.publicKeyHashes && message.publicKeyHashes.length)) + message.publicKeyHashes = []; + message.publicKeyHashes.push(reader.bytes()); + break; + case 2: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesByPublicKeyHashesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest} GetIdentitiesByPublicKeyHashesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesByPublicKeyHashesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesByPublicKeyHashesRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesByPublicKeyHashesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.publicKeyHashes != null && message.hasOwnProperty("publicKeyHashes")) { + if (!Array.isArray(message.publicKeyHashes)) + return "publicKeyHashes: array expected"; + for (var i = 0; i < message.publicKeyHashes.length; ++i) + if (!(message.publicKeyHashes[i] && typeof message.publicKeyHashes[i].length === "number" || $util.isString(message.publicKeyHashes[i]))) + return "publicKeyHashes: buffer[] expected"; + } + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetIdentitiesByPublicKeyHashesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest} GetIdentitiesByPublicKeyHashesRequest + */ + GetIdentitiesByPublicKeyHashesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest(); + if (object.publicKeyHashes) { + if (!Array.isArray(object.publicKeyHashes)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.publicKeyHashes: array expected"); + message.publicKeyHashes = []; + for (var i = 0; i < object.publicKeyHashes.length; ++i) + if (typeof object.publicKeyHashes[i] === "string") + $util.base64.decode(object.publicKeyHashes[i], message.publicKeyHashes[i] = $util.newBuffer($util.base64.length(object.publicKeyHashes[i])), 0); + else if (object.publicKeyHashes[i].length >= 0) + message.publicKeyHashes[i] = object.publicKeyHashes[i]; + } + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesByPublicKeyHashesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest} message GetIdentitiesByPublicKeyHashesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesByPublicKeyHashesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.publicKeyHashes = []; + if (options.defaults) + object.prove = false; + if (message.publicKeyHashes && message.publicKeyHashes.length) { + object.publicKeyHashes = []; + for (var j = 0; j < message.publicKeyHashes.length; ++j) + object.publicKeyHashes[j] = options.bytes === String ? $util.base64.encode(message.publicKeyHashes[j], 0, message.publicKeyHashes[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.publicKeyHashes[j]) : message.publicKeyHashes[j]; + } + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetIdentitiesByPublicKeyHashesRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesByPublicKeyHashesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentitiesByPublicKeyHashesRequest; + })(); + + v0.GetIdentitiesByPublicKeyHashesResponse = (function() { + + /** + * Properties of a GetIdentitiesByPublicKeyHashesResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentitiesByPublicKeyHashesResponse + * @property {Array.|null} [identities] GetIdentitiesByPublicKeyHashesResponse identities + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentitiesByPublicKeyHashesResponse proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentitiesByPublicKeyHashesResponse metadata + */ + + /** + * Constructs a new GetIdentitiesByPublicKeyHashesResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentitiesByPublicKeyHashesResponse. + * @implements IGetIdentitiesByPublicKeyHashesResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentitiesByPublicKeyHashesResponse=} [properties] Properties to set + */ + function GetIdentitiesByPublicKeyHashesResponse(properties) { + this.identities = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentitiesByPublicKeyHashesResponse identities. + * @member {Array.} identities + * @memberof org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse + * @instance + */ + GetIdentitiesByPublicKeyHashesResponse.prototype.identities = $util.emptyArray; + + /** + * GetIdentitiesByPublicKeyHashesResponse proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse + * @instance + */ + GetIdentitiesByPublicKeyHashesResponse.prototype.proof = null; + + /** + * GetIdentitiesByPublicKeyHashesResponse metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse + * @instance + */ + GetIdentitiesByPublicKeyHashesResponse.prototype.metadata = null; + + /** + * Creates a new GetIdentitiesByPublicKeyHashesResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesByPublicKeyHashesResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} GetIdentitiesByPublicKeyHashesResponse instance + */ + GetIdentitiesByPublicKeyHashesResponse.create = function create(properties) { + return new GetIdentitiesByPublicKeyHashesResponse(properties); + }; + + /** + * Encodes the specified GetIdentitiesByPublicKeyHashesResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesByPublicKeyHashesResponse} message GetIdentitiesByPublicKeyHashesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesByPublicKeyHashesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identities != null && message.identities.length) + for (var i = 0; i < message.identities.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identities[i]); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentitiesByPublicKeyHashesResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentitiesByPublicKeyHashesResponse} message GetIdentitiesByPublicKeyHashesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentitiesByPublicKeyHashesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentitiesByPublicKeyHashesResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} GetIdentitiesByPublicKeyHashesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesByPublicKeyHashesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.identities && message.identities.length)) + message.identities = []; + message.identities.push(reader.bytes()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentitiesByPublicKeyHashesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} GetIdentitiesByPublicKeyHashesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentitiesByPublicKeyHashesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentitiesByPublicKeyHashesResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentitiesByPublicKeyHashesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.identities != null && message.hasOwnProperty("identities")) { + if (!Array.isArray(message.identities)) + return "identities: array expected"; + for (var i = 0; i < message.identities.length; ++i) + if (!(message.identities[i] && typeof message.identities[i].length === "number" || $util.isString(message.identities[i]))) + return "identities: buffer[] expected"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetIdentitiesByPublicKeyHashesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} GetIdentitiesByPublicKeyHashesResponse + */ + GetIdentitiesByPublicKeyHashesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse(); + if (object.identities) { + if (!Array.isArray(object.identities)) + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.identities: array expected"); + message.identities = []; + for (var i = 0; i < object.identities.length; ++i) + if (typeof object.identities[i] === "string") + $util.base64.decode(object.identities[i], message.identities[i] = $util.newBuffer($util.base64.length(object.identities[i])), 0); + else if (object.identities[i].length >= 0) + message.identities[i] = object.identities[i]; + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentitiesByPublicKeyHashesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse + * @static + * @param {org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} message GetIdentitiesByPublicKeyHashesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentitiesByPublicKeyHashesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.identities = []; + if (options.defaults) { + object.proof = null; + object.metadata = null; + } + if (message.identities && message.identities.length) { + object.identities = []; + for (var j = 0; j < message.identities.length; ++j) + object.identities[j] = options.bytes === String ? $util.base64.encode(message.identities[j], 0, message.identities[j].length) : options.bytes === Array ? Array.prototype.slice.call(message.identities[j]) : message.identities[j]; + } + if (message.proof != null && message.hasOwnProperty("proof")) + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetIdentitiesByPublicKeyHashesResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse + * @instance + * @returns {Object.} JSON object + */ + GetIdentitiesByPublicKeyHashesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentitiesByPublicKeyHashesResponse; + })(); + + v0.GetIdentityByPublicKeyHashesRequest = (function() { + + /** + * Properties of a GetIdentityByPublicKeyHashesRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityByPublicKeyHashesRequest + * @property {Uint8Array|null} [publicKeyHash] GetIdentityByPublicKeyHashesRequest publicKeyHash + * @property {boolean|null} [prove] GetIdentityByPublicKeyHashesRequest prove + */ + + /** + * Constructs a new GetIdentityByPublicKeyHashesRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityByPublicKeyHashesRequest. + * @implements IGetIdentityByPublicKeyHashesRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashesRequest=} [properties] Properties to set + */ + function GetIdentityByPublicKeyHashesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityByPublicKeyHashesRequest publicKeyHash. + * @member {Uint8Array} publicKeyHash + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest + * @instance + */ + GetIdentityByPublicKeyHashesRequest.prototype.publicKeyHash = $util.newBuffer([]); + + /** + * GetIdentityByPublicKeyHashesRequest prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest + * @instance + */ + GetIdentityByPublicKeyHashesRequest.prototype.prove = false; + + /** + * Creates a new GetIdentityByPublicKeyHashesRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashesRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest} GetIdentityByPublicKeyHashesRequest instance + */ + GetIdentityByPublicKeyHashesRequest.create = function create(properties) { + return new GetIdentityByPublicKeyHashesRequest(properties); + }; + + /** + * Encodes the specified GetIdentityByPublicKeyHashesRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashesRequest} message GetIdentityByPublicKeyHashesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityByPublicKeyHashesRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.publicKeyHash != null && Object.hasOwnProperty.call(message, "publicKeyHash")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.publicKeyHash); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetIdentityByPublicKeyHashesRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashesRequest} message GetIdentityByPublicKeyHashesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityByPublicKeyHashesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityByPublicKeyHashesRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest} GetIdentityByPublicKeyHashesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityByPublicKeyHashesRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.publicKeyHash = reader.bytes(); + break; + case 2: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityByPublicKeyHashesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest} GetIdentityByPublicKeyHashesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityByPublicKeyHashesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityByPublicKeyHashesRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityByPublicKeyHashesRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.publicKeyHash != null && message.hasOwnProperty("publicKeyHash")) + if (!(message.publicKeyHash && typeof message.publicKeyHash.length === "number" || $util.isString(message.publicKeyHash))) + return "publicKeyHash: buffer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetIdentityByPublicKeyHashesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest} GetIdentityByPublicKeyHashesRequest + */ + GetIdentityByPublicKeyHashesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest(); + if (object.publicKeyHash != null) + if (typeof object.publicKeyHash === "string") + $util.base64.decode(object.publicKeyHash, message.publicKeyHash = $util.newBuffer($util.base64.length(object.publicKeyHash)), 0); + else if (object.publicKeyHash.length >= 0) + message.publicKeyHash = object.publicKeyHash; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetIdentityByPublicKeyHashesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest} message GetIdentityByPublicKeyHashesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityByPublicKeyHashesRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.publicKeyHash = ""; + else { + object.publicKeyHash = []; + if (options.bytes !== Array) + object.publicKeyHash = $util.newBuffer(object.publicKeyHash); + } + object.prove = false; + } + if (message.publicKeyHash != null && message.hasOwnProperty("publicKeyHash")) + object.publicKeyHash = options.bytes === String ? $util.base64.encode(message.publicKeyHash, 0, message.publicKeyHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.publicKeyHash) : message.publicKeyHash; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetIdentityByPublicKeyHashesRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest + * @instance + * @returns {Object.} JSON object + */ + GetIdentityByPublicKeyHashesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentityByPublicKeyHashesRequest; + })(); + + v0.GetIdentityByPublicKeyHashesResponse = (function() { + + /** + * Properties of a GetIdentityByPublicKeyHashesResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetIdentityByPublicKeyHashesResponse + * @property {Uint8Array|null} [identity] GetIdentityByPublicKeyHashesResponse identity + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] GetIdentityByPublicKeyHashesResponse proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] GetIdentityByPublicKeyHashesResponse metadata + */ + + /** + * Constructs a new GetIdentityByPublicKeyHashesResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetIdentityByPublicKeyHashesResponse. + * @implements IGetIdentityByPublicKeyHashesResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashesResponse=} [properties] Properties to set + */ + function GetIdentityByPublicKeyHashesResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetIdentityByPublicKeyHashesResponse identity. + * @member {Uint8Array} identity + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse + * @instance + */ + GetIdentityByPublicKeyHashesResponse.prototype.identity = $util.newBuffer([]); + + /** + * GetIdentityByPublicKeyHashesResponse proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse + * @instance + */ + GetIdentityByPublicKeyHashesResponse.prototype.proof = null; + + /** + * GetIdentityByPublicKeyHashesResponse metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse + * @instance + */ + GetIdentityByPublicKeyHashesResponse.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * GetIdentityByPublicKeyHashesResponse result. + * @member {"identity"|"proof"|undefined} result + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse + * @instance + */ + Object.defineProperty(GetIdentityByPublicKeyHashesResponse.prototype, "result", { + get: $util.oneOfGetter($oneOfFields = ["identity", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GetIdentityByPublicKeyHashesResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashesResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse} GetIdentityByPublicKeyHashesResponse instance + */ + GetIdentityByPublicKeyHashesResponse.create = function create(properties) { + return new GetIdentityByPublicKeyHashesResponse(properties); + }; + + /** + * Encodes the specified GetIdentityByPublicKeyHashesResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashesResponse} message GetIdentityByPublicKeyHashesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityByPublicKeyHashesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.identity != null && Object.hasOwnProperty.call(message, "identity")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.identity); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetIdentityByPublicKeyHashesResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetIdentityByPublicKeyHashesResponse} message GetIdentityByPublicKeyHashesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetIdentityByPublicKeyHashesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetIdentityByPublicKeyHashesResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse} GetIdentityByPublicKeyHashesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityByPublicKeyHashesResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.identity = reader.bytes(); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetIdentityByPublicKeyHashesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse} GetIdentityByPublicKeyHashesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetIdentityByPublicKeyHashesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetIdentityByPublicKeyHashesResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetIdentityByPublicKeyHashesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.identity != null && message.hasOwnProperty("identity")) { + properties.result = 1; + if (!(message.identity && typeof message.identity.length === "number" || $util.isString(message.identity))) + return "identity: buffer expected"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.result === 1) + return "result: multiple values"; + properties.result = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a GetIdentityByPublicKeyHashesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse} GetIdentityByPublicKeyHashesResponse + */ + GetIdentityByPublicKeyHashesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse(); + if (object.identity != null) + if (typeof object.identity === "string") + $util.base64.decode(object.identity, message.identity = $util.newBuffer($util.base64.length(object.identity)), 0); + else if (object.identity.length >= 0) + message.identity = object.identity; + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a GetIdentityByPublicKeyHashesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse + * @static + * @param {org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse} message GetIdentityByPublicKeyHashesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetIdentityByPublicKeyHashesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.identity != null && message.hasOwnProperty("identity")) { + object.identity = options.bytes === String ? $util.base64.encode(message.identity, 0, message.identity.length) : options.bytes === Array ? Array.prototype.slice.call(message.identity) : message.identity; + if (options.oneofs) + object.result = "identity"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.result = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this GetIdentityByPublicKeyHashesResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse + * @instance + * @returns {Object.} JSON object + */ + GetIdentityByPublicKeyHashesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetIdentityByPublicKeyHashesResponse; + })(); + + v0.WaitForStateTransitionResultRequest = (function() { + + /** + * Properties of a WaitForStateTransitionResultRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IWaitForStateTransitionResultRequest + * @property {Uint8Array|null} [stateTransitionHash] WaitForStateTransitionResultRequest stateTransitionHash + * @property {boolean|null} [prove] WaitForStateTransitionResultRequest prove + */ + + /** + * Constructs a new WaitForStateTransitionResultRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a WaitForStateTransitionResultRequest. + * @implements IWaitForStateTransitionResultRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultRequest=} [properties] Properties to set + */ + function WaitForStateTransitionResultRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitForStateTransitionResultRequest stateTransitionHash. + * @member {Uint8Array} stateTransitionHash + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @instance + */ + WaitForStateTransitionResultRequest.prototype.stateTransitionHash = $util.newBuffer([]); + + /** + * WaitForStateTransitionResultRequest prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @instance + */ + WaitForStateTransitionResultRequest.prototype.prove = false; + + /** + * Creates a new WaitForStateTransitionResultRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @static + * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest} WaitForStateTransitionResultRequest instance + */ + WaitForStateTransitionResultRequest.create = function create(properties) { + return new WaitForStateTransitionResultRequest(properties); + }; + + /** + * Encodes the specified WaitForStateTransitionResultRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @static + * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultRequest} message WaitForStateTransitionResultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitForStateTransitionResultRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.stateTransitionHash != null && Object.hasOwnProperty.call(message, "stateTransitionHash")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.stateTransitionHash); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified WaitForStateTransitionResultRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @static + * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultRequest} message WaitForStateTransitionResultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitForStateTransitionResultRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitForStateTransitionResultRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest} WaitForStateTransitionResultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitForStateTransitionResultRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.stateTransitionHash = reader.bytes(); + break; + case 2: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitForStateTransitionResultRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest} WaitForStateTransitionResultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitForStateTransitionResultRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitForStateTransitionResultRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitForStateTransitionResultRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.stateTransitionHash != null && message.hasOwnProperty("stateTransitionHash")) + if (!(message.stateTransitionHash && typeof message.stateTransitionHash.length === "number" || $util.isString(message.stateTransitionHash))) + return "stateTransitionHash: buffer expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a WaitForStateTransitionResultRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest} WaitForStateTransitionResultRequest + */ + WaitForStateTransitionResultRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest(); + if (object.stateTransitionHash != null) + if (typeof object.stateTransitionHash === "string") + $util.base64.decode(object.stateTransitionHash, message.stateTransitionHash = $util.newBuffer($util.base64.length(object.stateTransitionHash)), 0); + else if (object.stateTransitionHash.length >= 0) + message.stateTransitionHash = object.stateTransitionHash; + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a WaitForStateTransitionResultRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @static + * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest} message WaitForStateTransitionResultRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitForStateTransitionResultRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.stateTransitionHash = ""; + else { + object.stateTransitionHash = []; + if (options.bytes !== Array) + object.stateTransitionHash = $util.newBuffer(object.stateTransitionHash); + } + object.prove = false; + } + if (message.stateTransitionHash != null && message.hasOwnProperty("stateTransitionHash")) + object.stateTransitionHash = options.bytes === String ? $util.base64.encode(message.stateTransitionHash, 0, message.stateTransitionHash.length) : options.bytes === Array ? Array.prototype.slice.call(message.stateTransitionHash) : message.stateTransitionHash; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this WaitForStateTransitionResultRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest + * @instance + * @returns {Object.} JSON object + */ + WaitForStateTransitionResultRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WaitForStateTransitionResultRequest; + })(); + + v0.WaitForStateTransitionResultResponse = (function() { + + /** + * Properties of a WaitForStateTransitionResultResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IWaitForStateTransitionResultResponse + * @property {org.dash.platform.dapi.v0.IStateTransitionBroadcastError|null} [error] WaitForStateTransitionResultResponse error + * @property {org.dash.platform.dapi.v0.IProof|null} [proof] WaitForStateTransitionResultResponse proof + * @property {org.dash.platform.dapi.v0.IResponseMetadata|null} [metadata] WaitForStateTransitionResultResponse metadata + */ + + /** + * Constructs a new WaitForStateTransitionResultResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a WaitForStateTransitionResultResponse. + * @implements IWaitForStateTransitionResultResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultResponse=} [properties] Properties to set + */ + function WaitForStateTransitionResultResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WaitForStateTransitionResultResponse error. + * @member {org.dash.platform.dapi.v0.IStateTransitionBroadcastError|null|undefined} error + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @instance + */ + WaitForStateTransitionResultResponse.prototype.error = null; + + /** + * WaitForStateTransitionResultResponse proof. + * @member {org.dash.platform.dapi.v0.IProof|null|undefined} proof + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @instance + */ + WaitForStateTransitionResultResponse.prototype.proof = null; + + /** + * WaitForStateTransitionResultResponse metadata. + * @member {org.dash.platform.dapi.v0.IResponseMetadata|null|undefined} metadata + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @instance + */ + WaitForStateTransitionResultResponse.prototype.metadata = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * WaitForStateTransitionResultResponse responses. + * @member {"error"|"proof"|undefined} responses + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @instance + */ + Object.defineProperty(WaitForStateTransitionResultResponse.prototype, "responses", { + get: $util.oneOfGetter($oneOfFields = ["error", "proof"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new WaitForStateTransitionResultResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @static + * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse} WaitForStateTransitionResultResponse instance + */ + WaitForStateTransitionResultResponse.create = function create(properties) { + return new WaitForStateTransitionResultResponse(properties); + }; + + /** + * Encodes the specified WaitForStateTransitionResultResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @static + * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultResponse} message WaitForStateTransitionResultResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitForStateTransitionResultResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.error != null && Object.hasOwnProperty.call(message, "error")) + $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError.encode(message.error, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.proof != null && Object.hasOwnProperty.call(message, "proof")) + $root.org.dash.platform.dapi.v0.Proof.encode(message.proof, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.org.dash.platform.dapi.v0.ResponseMetadata.encode(message.metadata, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified WaitForStateTransitionResultResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @static + * @param {org.dash.platform.dapi.v0.IWaitForStateTransitionResultResponse} message WaitForStateTransitionResultResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WaitForStateTransitionResultResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WaitForStateTransitionResultResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse} WaitForStateTransitionResultResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitForStateTransitionResultResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.error = $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError.decode(reader, reader.uint32()); + break; + case 2: + message.proof = $root.org.dash.platform.dapi.v0.Proof.decode(reader, reader.uint32()); + break; + case 3: + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WaitForStateTransitionResultResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse} WaitForStateTransitionResultResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WaitForStateTransitionResultResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WaitForStateTransitionResultResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WaitForStateTransitionResultResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.error != null && message.hasOwnProperty("error")) { + properties.responses = 1; + { + var error = $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError.verify(message.error); + if (error) + return "error." + error; + } + } + if (message.proof != null && message.hasOwnProperty("proof")) { + if (properties.responses === 1) + return "responses: multiple values"; + properties.responses = 1; + { + var error = $root.org.dash.platform.dapi.v0.Proof.verify(message.proof); + if (error) + return "proof." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + var error = $root.org.dash.platform.dapi.v0.ResponseMetadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + return null; + }; + + /** + * Creates a WaitForStateTransitionResultResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse} WaitForStateTransitionResultResponse + */ + WaitForStateTransitionResultResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse(); + if (object.error != null) { + if (typeof object.error !== "object") + throw TypeError(".org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.error: object expected"); + message.error = $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError.fromObject(object.error); + } + if (object.proof != null) { + if (typeof object.proof !== "object") + throw TypeError(".org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.proof: object expected"); + message.proof = $root.org.dash.platform.dapi.v0.Proof.fromObject(object.proof); + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.metadata: object expected"); + message.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.fromObject(object.metadata); + } + return message; + }; + + /** + * Creates a plain object from a WaitForStateTransitionResultResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @static + * @param {org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse} message WaitForStateTransitionResultResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WaitForStateTransitionResultResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.metadata = null; + if (message.error != null && message.hasOwnProperty("error")) { + object.error = $root.org.dash.platform.dapi.v0.StateTransitionBroadcastError.toObject(message.error, options); + if (options.oneofs) + object.responses = "error"; + } + if (message.proof != null && message.hasOwnProperty("proof")) { + object.proof = $root.org.dash.platform.dapi.v0.Proof.toObject(message.proof, options); + if (options.oneofs) + object.responses = "proof"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) + object.metadata = $root.org.dash.platform.dapi.v0.ResponseMetadata.toObject(message.metadata, options); + return object; + }; + + /** + * Converts this WaitForStateTransitionResultResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse + * @instance + * @returns {Object.} JSON object + */ + WaitForStateTransitionResultResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return WaitForStateTransitionResultResponse; + })(); + + v0.ConsensusParamsBlock = (function() { + + /** + * Properties of a ConsensusParamsBlock. + * @memberof org.dash.platform.dapi.v0 + * @interface IConsensusParamsBlock + * @property {string|null} [maxBytes] ConsensusParamsBlock maxBytes + * @property {string|null} [maxGas] ConsensusParamsBlock maxGas + * @property {string|null} [timeIotaMs] ConsensusParamsBlock timeIotaMs + */ + + /** + * Constructs a new ConsensusParamsBlock. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a ConsensusParamsBlock. + * @implements IConsensusParamsBlock + * @constructor + * @param {org.dash.platform.dapi.v0.IConsensusParamsBlock=} [properties] Properties to set + */ + function ConsensusParamsBlock(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConsensusParamsBlock maxBytes. + * @member {string} maxBytes + * @memberof org.dash.platform.dapi.v0.ConsensusParamsBlock + * @instance + */ + ConsensusParamsBlock.prototype.maxBytes = ""; + + /** + * ConsensusParamsBlock maxGas. + * @member {string} maxGas + * @memberof org.dash.platform.dapi.v0.ConsensusParamsBlock + * @instance + */ + ConsensusParamsBlock.prototype.maxGas = ""; + + /** + * ConsensusParamsBlock timeIotaMs. + * @member {string} timeIotaMs + * @memberof org.dash.platform.dapi.v0.ConsensusParamsBlock + * @instance + */ + ConsensusParamsBlock.prototype.timeIotaMs = ""; + + /** + * Creates a new ConsensusParamsBlock instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.ConsensusParamsBlock + * @static + * @param {org.dash.platform.dapi.v0.IConsensusParamsBlock=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.ConsensusParamsBlock} ConsensusParamsBlock instance + */ + ConsensusParamsBlock.create = function create(properties) { + return new ConsensusParamsBlock(properties); + }; + + /** + * Encodes the specified ConsensusParamsBlock message. Does not implicitly {@link org.dash.platform.dapi.v0.ConsensusParamsBlock.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.ConsensusParamsBlock + * @static + * @param {org.dash.platform.dapi.v0.IConsensusParamsBlock} message ConsensusParamsBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConsensusParamsBlock.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.maxBytes != null && Object.hasOwnProperty.call(message, "maxBytes")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.maxBytes); + if (message.maxGas != null && Object.hasOwnProperty.call(message, "maxGas")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.maxGas); + if (message.timeIotaMs != null && Object.hasOwnProperty.call(message, "timeIotaMs")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.timeIotaMs); + return writer; + }; + + /** + * Encodes the specified ConsensusParamsBlock message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.ConsensusParamsBlock.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.ConsensusParamsBlock + * @static + * @param {org.dash.platform.dapi.v0.IConsensusParamsBlock} message ConsensusParamsBlock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConsensusParamsBlock.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConsensusParamsBlock message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.ConsensusParamsBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.ConsensusParamsBlock} ConsensusParamsBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConsensusParamsBlock.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.ConsensusParamsBlock(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxBytes = reader.string(); + break; + case 2: + message.maxGas = reader.string(); + break; + case 3: + message.timeIotaMs = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConsensusParamsBlock message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.ConsensusParamsBlock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.ConsensusParamsBlock} ConsensusParamsBlock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConsensusParamsBlock.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConsensusParamsBlock message. + * @function verify + * @memberof org.dash.platform.dapi.v0.ConsensusParamsBlock + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConsensusParamsBlock.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) + if (!$util.isString(message.maxBytes)) + return "maxBytes: string expected"; + if (message.maxGas != null && message.hasOwnProperty("maxGas")) + if (!$util.isString(message.maxGas)) + return "maxGas: string expected"; + if (message.timeIotaMs != null && message.hasOwnProperty("timeIotaMs")) + if (!$util.isString(message.timeIotaMs)) + return "timeIotaMs: string expected"; + return null; + }; + + /** + * Creates a ConsensusParamsBlock message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.ConsensusParamsBlock + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.ConsensusParamsBlock} ConsensusParamsBlock + */ + ConsensusParamsBlock.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.ConsensusParamsBlock) + return object; + var message = new $root.org.dash.platform.dapi.v0.ConsensusParamsBlock(); + if (object.maxBytes != null) + message.maxBytes = String(object.maxBytes); + if (object.maxGas != null) + message.maxGas = String(object.maxGas); + if (object.timeIotaMs != null) + message.timeIotaMs = String(object.timeIotaMs); + return message; + }; + + /** + * Creates a plain object from a ConsensusParamsBlock message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.ConsensusParamsBlock + * @static + * @param {org.dash.platform.dapi.v0.ConsensusParamsBlock} message ConsensusParamsBlock + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConsensusParamsBlock.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.maxBytes = ""; + object.maxGas = ""; + object.timeIotaMs = ""; + } + if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) + object.maxBytes = message.maxBytes; + if (message.maxGas != null && message.hasOwnProperty("maxGas")) + object.maxGas = message.maxGas; + if (message.timeIotaMs != null && message.hasOwnProperty("timeIotaMs")) + object.timeIotaMs = message.timeIotaMs; + return object; + }; + + /** + * Converts this ConsensusParamsBlock to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.ConsensusParamsBlock + * @instance + * @returns {Object.} JSON object + */ + ConsensusParamsBlock.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ConsensusParamsBlock; + })(); + + v0.ConsensusParamsEvidence = (function() { + + /** + * Properties of a ConsensusParamsEvidence. + * @memberof org.dash.platform.dapi.v0 + * @interface IConsensusParamsEvidence + * @property {string|null} [maxAgeNumBlocks] ConsensusParamsEvidence maxAgeNumBlocks + * @property {string|null} [maxAgeDuration] ConsensusParamsEvidence maxAgeDuration + * @property {string|null} [maxBytes] ConsensusParamsEvidence maxBytes + */ + + /** + * Constructs a new ConsensusParamsEvidence. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a ConsensusParamsEvidence. + * @implements IConsensusParamsEvidence + * @constructor + * @param {org.dash.platform.dapi.v0.IConsensusParamsEvidence=} [properties] Properties to set + */ + function ConsensusParamsEvidence(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ConsensusParamsEvidence maxAgeNumBlocks. + * @member {string} maxAgeNumBlocks + * @memberof org.dash.platform.dapi.v0.ConsensusParamsEvidence + * @instance + */ + ConsensusParamsEvidence.prototype.maxAgeNumBlocks = ""; + + /** + * ConsensusParamsEvidence maxAgeDuration. + * @member {string} maxAgeDuration + * @memberof org.dash.platform.dapi.v0.ConsensusParamsEvidence + * @instance + */ + ConsensusParamsEvidence.prototype.maxAgeDuration = ""; + + /** + * ConsensusParamsEvidence maxBytes. + * @member {string} maxBytes + * @memberof org.dash.platform.dapi.v0.ConsensusParamsEvidence + * @instance + */ + ConsensusParamsEvidence.prototype.maxBytes = ""; + + /** + * Creates a new ConsensusParamsEvidence instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.ConsensusParamsEvidence + * @static + * @param {org.dash.platform.dapi.v0.IConsensusParamsEvidence=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.ConsensusParamsEvidence} ConsensusParamsEvidence instance + */ + ConsensusParamsEvidence.create = function create(properties) { + return new ConsensusParamsEvidence(properties); + }; + + /** + * Encodes the specified ConsensusParamsEvidence message. Does not implicitly {@link org.dash.platform.dapi.v0.ConsensusParamsEvidence.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.ConsensusParamsEvidence + * @static + * @param {org.dash.platform.dapi.v0.IConsensusParamsEvidence} message ConsensusParamsEvidence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConsensusParamsEvidence.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.maxAgeNumBlocks != null && Object.hasOwnProperty.call(message, "maxAgeNumBlocks")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.maxAgeNumBlocks); + if (message.maxAgeDuration != null && Object.hasOwnProperty.call(message, "maxAgeDuration")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.maxAgeDuration); + if (message.maxBytes != null && Object.hasOwnProperty.call(message, "maxBytes")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.maxBytes); + return writer; + }; + + /** + * Encodes the specified ConsensusParamsEvidence message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.ConsensusParamsEvidence.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.ConsensusParamsEvidence + * @static + * @param {org.dash.platform.dapi.v0.IConsensusParamsEvidence} message ConsensusParamsEvidence message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ConsensusParamsEvidence.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ConsensusParamsEvidence message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.ConsensusParamsEvidence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.ConsensusParamsEvidence} ConsensusParamsEvidence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConsensusParamsEvidence.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.ConsensusParamsEvidence(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.maxAgeNumBlocks = reader.string(); + break; + case 2: + message.maxAgeDuration = reader.string(); + break; + case 3: + message.maxBytes = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ConsensusParamsEvidence message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.ConsensusParamsEvidence + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.ConsensusParamsEvidence} ConsensusParamsEvidence + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ConsensusParamsEvidence.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ConsensusParamsEvidence message. + * @function verify + * @memberof org.dash.platform.dapi.v0.ConsensusParamsEvidence + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ConsensusParamsEvidence.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.maxAgeNumBlocks != null && message.hasOwnProperty("maxAgeNumBlocks")) + if (!$util.isString(message.maxAgeNumBlocks)) + return "maxAgeNumBlocks: string expected"; + if (message.maxAgeDuration != null && message.hasOwnProperty("maxAgeDuration")) + if (!$util.isString(message.maxAgeDuration)) + return "maxAgeDuration: string expected"; + if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) + if (!$util.isString(message.maxBytes)) + return "maxBytes: string expected"; + return null; + }; + + /** + * Creates a ConsensusParamsEvidence message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.ConsensusParamsEvidence + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.ConsensusParamsEvidence} ConsensusParamsEvidence + */ + ConsensusParamsEvidence.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.ConsensusParamsEvidence) + return object; + var message = new $root.org.dash.platform.dapi.v0.ConsensusParamsEvidence(); + if (object.maxAgeNumBlocks != null) + message.maxAgeNumBlocks = String(object.maxAgeNumBlocks); + if (object.maxAgeDuration != null) + message.maxAgeDuration = String(object.maxAgeDuration); + if (object.maxBytes != null) + message.maxBytes = String(object.maxBytes); + return message; + }; + + /** + * Creates a plain object from a ConsensusParamsEvidence message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.ConsensusParamsEvidence + * @static + * @param {org.dash.platform.dapi.v0.ConsensusParamsEvidence} message ConsensusParamsEvidence + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ConsensusParamsEvidence.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.maxAgeNumBlocks = ""; + object.maxAgeDuration = ""; + object.maxBytes = ""; + } + if (message.maxAgeNumBlocks != null && message.hasOwnProperty("maxAgeNumBlocks")) + object.maxAgeNumBlocks = message.maxAgeNumBlocks; + if (message.maxAgeDuration != null && message.hasOwnProperty("maxAgeDuration")) + object.maxAgeDuration = message.maxAgeDuration; + if (message.maxBytes != null && message.hasOwnProperty("maxBytes")) + object.maxBytes = message.maxBytes; + return object; + }; + + /** + * Converts this ConsensusParamsEvidence to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.ConsensusParamsEvidence + * @instance + * @returns {Object.} JSON object + */ + ConsensusParamsEvidence.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ConsensusParamsEvidence; + })(); + + v0.GetConsensusParamsRequest = (function() { + + /** + * Properties of a GetConsensusParamsRequest. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetConsensusParamsRequest + * @property {number|Long|null} [height] GetConsensusParamsRequest height + * @property {boolean|null} [prove] GetConsensusParamsRequest prove + */ + + /** + * Constructs a new GetConsensusParamsRequest. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetConsensusParamsRequest. + * @implements IGetConsensusParamsRequest + * @constructor + * @param {org.dash.platform.dapi.v0.IGetConsensusParamsRequest=} [properties] Properties to set + */ + function GetConsensusParamsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetConsensusParamsRequest height. + * @member {number|Long} height + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @instance + */ + GetConsensusParamsRequest.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * GetConsensusParamsRequest prove. + * @member {boolean} prove + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @instance + */ + GetConsensusParamsRequest.prototype.prove = false; + + /** + * Creates a new GetConsensusParamsRequest instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetConsensusParamsRequest=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest} GetConsensusParamsRequest instance + */ + GetConsensusParamsRequest.create = function create(properties) { + return new GetConsensusParamsRequest(properties); + }; + + /** + * Encodes the specified GetConsensusParamsRequest message. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsRequest.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetConsensusParamsRequest} message GetConsensusParamsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConsensusParamsRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.height); + if (message.prove != null && Object.hasOwnProperty.call(message, "prove")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.prove); + return writer; + }; + + /** + * Encodes the specified GetConsensusParamsRequest message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @static + * @param {org.dash.platform.dapi.v0.IGetConsensusParamsRequest} message GetConsensusParamsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConsensusParamsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetConsensusParamsRequest message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest} GetConsensusParamsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConsensusParamsRequest.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int64(); + break; + case 2: + message.prove = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetConsensusParamsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest} GetConsensusParamsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConsensusParamsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetConsensusParamsRequest message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetConsensusParamsRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + if (message.prove != null && message.hasOwnProperty("prove")) + if (typeof message.prove !== "boolean") + return "prove: boolean expected"; + return null; + }; + + /** + * Creates a GetConsensusParamsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsRequest} GetConsensusParamsRequest + */ + GetConsensusParamsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsRequest(); + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = false; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); + if (object.prove != null) + message.prove = Boolean(object.prove); + return message; + }; + + /** + * Creates a plain object from a GetConsensusParamsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsRequest} message GetConsensusParamsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetConsensusParamsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + object.prove = false; + } + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + 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() : message.height; + if (message.prove != null && message.hasOwnProperty("prove")) + object.prove = message.prove; + return object; + }; + + /** + * Converts this GetConsensusParamsRequest to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsRequest + * @instance + * @returns {Object.} JSON object + */ + GetConsensusParamsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetConsensusParamsRequest; + })(); + + v0.GetConsensusParamsResponse = (function() { + + /** + * Properties of a GetConsensusParamsResponse. + * @memberof org.dash.platform.dapi.v0 + * @interface IGetConsensusParamsResponse + * @property {org.dash.platform.dapi.v0.IConsensusParamsBlock|null} [block] GetConsensusParamsResponse block + * @property {org.dash.platform.dapi.v0.IConsensusParamsEvidence|null} [evidence] GetConsensusParamsResponse evidence + */ + + /** + * Constructs a new GetConsensusParamsResponse. + * @memberof org.dash.platform.dapi.v0 + * @classdesc Represents a GetConsensusParamsResponse. + * @implements IGetConsensusParamsResponse + * @constructor + * @param {org.dash.platform.dapi.v0.IGetConsensusParamsResponse=} [properties] Properties to set + */ + function GetConsensusParamsResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetConsensusParamsResponse block. + * @member {org.dash.platform.dapi.v0.IConsensusParamsBlock|null|undefined} block + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @instance + */ + GetConsensusParamsResponse.prototype.block = null; + + /** + * GetConsensusParamsResponse evidence. + * @member {org.dash.platform.dapi.v0.IConsensusParamsEvidence|null|undefined} evidence + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @instance + */ + GetConsensusParamsResponse.prototype.evidence = null; + + /** + * Creates a new GetConsensusParamsResponse instance using the specified properties. + * @function create + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetConsensusParamsResponse=} [properties] Properties to set + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse} GetConsensusParamsResponse instance + */ + GetConsensusParamsResponse.create = function create(properties) { + return new GetConsensusParamsResponse(properties); + }; + + /** + * Encodes the specified GetConsensusParamsResponse message. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsResponse.verify|verify} messages. + * @function encode + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetConsensusParamsResponse} message GetConsensusParamsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConsensusParamsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.block != null && Object.hasOwnProperty.call(message, "block")) + $root.org.dash.platform.dapi.v0.ConsensusParamsBlock.encode(message.block, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.evidence != null && Object.hasOwnProperty.call(message, "evidence")) + $root.org.dash.platform.dapi.v0.ConsensusParamsEvidence.encode(message.evidence, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GetConsensusParamsResponse message, length delimited. Does not implicitly {@link org.dash.platform.dapi.v0.GetConsensusParamsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @static + * @param {org.dash.platform.dapi.v0.IGetConsensusParamsResponse} message GetConsensusParamsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetConsensusParamsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetConsensusParamsResponse message from the specified reader or buffer. + * @function decode + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse} GetConsensusParamsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConsensusParamsResponse.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.block = $root.org.dash.platform.dapi.v0.ConsensusParamsBlock.decode(reader, reader.uint32()); + break; + case 2: + message.evidence = $root.org.dash.platform.dapi.v0.ConsensusParamsEvidence.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetConsensusParamsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse} GetConsensusParamsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetConsensusParamsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetConsensusParamsResponse message. + * @function verify + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetConsensusParamsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.block != null && message.hasOwnProperty("block")) { + var error = $root.org.dash.platform.dapi.v0.ConsensusParamsBlock.verify(message.block); + if (error) + return "block." + error; + } + if (message.evidence != null && message.hasOwnProperty("evidence")) { + var error = $root.org.dash.platform.dapi.v0.ConsensusParamsEvidence.verify(message.evidence); + if (error) + return "evidence." + error; + } + return null; + }; + + /** + * Creates a GetConsensusParamsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @static + * @param {Object.} object Plain object + * @returns {org.dash.platform.dapi.v0.GetConsensusParamsResponse} GetConsensusParamsResponse + */ + GetConsensusParamsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse) + return object; + var message = new $root.org.dash.platform.dapi.v0.GetConsensusParamsResponse(); + if (object.block != null) { + if (typeof object.block !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetConsensusParamsResponse.block: object expected"); + message.block = $root.org.dash.platform.dapi.v0.ConsensusParamsBlock.fromObject(object.block); + } + if (object.evidence != null) { + if (typeof object.evidence !== "object") + throw TypeError(".org.dash.platform.dapi.v0.GetConsensusParamsResponse.evidence: object expected"); + message.evidence = $root.org.dash.platform.dapi.v0.ConsensusParamsEvidence.fromObject(object.evidence); + } + return message; + }; + + /** + * Creates a plain object from a GetConsensusParamsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @static + * @param {org.dash.platform.dapi.v0.GetConsensusParamsResponse} message GetConsensusParamsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetConsensusParamsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.block = null; + object.evidence = null; + } + if (message.block != null && message.hasOwnProperty("block")) + object.block = $root.org.dash.platform.dapi.v0.ConsensusParamsBlock.toObject(message.block, options); + if (message.evidence != null && message.hasOwnProperty("evidence")) + object.evidence = $root.org.dash.platform.dapi.v0.ConsensusParamsEvidence.toObject(message.evidence, options); + return object; + }; + + /** + * Converts this GetConsensusParamsResponse to JSON. + * @function toJSON + * @memberof org.dash.platform.dapi.v0.GetConsensusParamsResponse + * @instance + * @returns {Object.} JSON object + */ + GetConsensusParamsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return GetConsensusParamsResponse; + })(); + + return v0; + })(); + + return dapi; + })(); + + return platform; + })(); + + return dash; + })(); + + return org; +})(); + +$root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.DoubleValue = (function() { + + /** + * Properties of a DoubleValue. + * @memberof google.protobuf + * @interface IDoubleValue + * @property {number|null} [value] DoubleValue value + */ + + /** + * Constructs a new DoubleValue. + * @memberof google.protobuf + * @classdesc Represents a DoubleValue. + * @implements IDoubleValue + * @constructor + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + */ + function DoubleValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DoubleValue value. + * @member {number} value + * @memberof google.protobuf.DoubleValue + * @instance + */ + DoubleValue.prototype.value = 0; + + /** + * Creates a new DoubleValue instance using the specified properties. + * @function create + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue=} [properties] Properties to set + * @returns {google.protobuf.DoubleValue} DoubleValue instance + */ + DoubleValue.create = function create(properties) { + return new DoubleValue(properties); + }; + + /** + * Encodes the specified DoubleValue message. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 1 =*/9).double(message.value); + return writer; + }; + + /** + * Encodes the specified DoubleValue message, length delimited. Does not implicitly {@link google.protobuf.DoubleValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.IDoubleValue} message DoubleValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DoubleValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.DoubleValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.double(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DoubleValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DoubleValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DoubleValue} DoubleValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DoubleValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DoubleValue message. + * @function verify + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DoubleValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a DoubleValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DoubleValue} DoubleValue + */ + DoubleValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DoubleValue) + return object; + var message = new $root.google.protobuf.DoubleValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a DoubleValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DoubleValue + * @static + * @param {google.protobuf.DoubleValue} message DoubleValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DoubleValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this DoubleValue to JSON. + * @function toJSON + * @memberof google.protobuf.DoubleValue + * @instance + * @returns {Object.} JSON object + */ + DoubleValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return DoubleValue; + })(); + + protobuf.FloatValue = (function() { + + /** + * Properties of a FloatValue. + * @memberof google.protobuf + * @interface IFloatValue + * @property {number|null} [value] FloatValue value + */ + + /** + * Constructs a new FloatValue. + * @memberof google.protobuf + * @classdesc Represents a FloatValue. + * @implements IFloatValue + * @constructor + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + */ + function FloatValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FloatValue value. + * @member {number} value + * @memberof google.protobuf.FloatValue + * @instance + */ + FloatValue.prototype.value = 0; + + /** + * Creates a new FloatValue instance using the specified properties. + * @function create + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue=} [properties] Properties to set + * @returns {google.protobuf.FloatValue} FloatValue instance + */ + FloatValue.create = function create(properties) { + return new FloatValue(properties); + }; + + /** + * Encodes the specified FloatValue message. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 5 =*/13).float(message.value); + return writer; + }; + + /** + * Encodes the specified FloatValue message, length delimited. Does not implicitly {@link google.protobuf.FloatValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.IFloatValue} message FloatValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FloatValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.FloatValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.float(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FloatValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FloatValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FloatValue} FloatValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FloatValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FloatValue message. + * @function verify + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FloatValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "number") + return "value: number expected"; + return null; + }; + + /** + * Creates a FloatValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FloatValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FloatValue} FloatValue + */ + FloatValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FloatValue) + return object; + var message = new $root.google.protobuf.FloatValue(); + if (object.value != null) + message.value = Number(object.value); + return message; + }; + + /** + * Creates a plain object from a FloatValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FloatValue + * @static + * @param {google.protobuf.FloatValue} message FloatValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FloatValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.json && !isFinite(message.value) ? String(message.value) : message.value; + return object; + }; + + /** + * Converts this FloatValue to JSON. + * @function toJSON + * @memberof google.protobuf.FloatValue + * @instance + * @returns {Object.} JSON object + */ + FloatValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FloatValue; + })(); + + protobuf.Int64Value = (function() { + + /** + * Properties of an Int64Value. + * @memberof google.protobuf + * @interface IInt64Value + * @property {number|Long|null} [value] Int64Value value + */ + + /** + * Constructs a new Int64Value. + * @memberof google.protobuf + * @classdesc Represents an Int64Value. + * @implements IInt64Value + * @constructor + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + */ + function Int64Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int64Value value. + * @member {number|Long} value + * @memberof google.protobuf.Int64Value + * @instance + */ + Int64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Int64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value=} [properties] Properties to set + * @returns {google.protobuf.Int64Value} Int64Value instance + */ + Int64Value.create = function create(properties) { + return new Int64Value(properties); + }; + + /** + * Encodes the specified Int64Value message. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.value); + return writer; + }; + + /** + * Encodes the specified Int64Value message, length delimited. Does not implicitly {@link google.protobuf.Int64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.IInt64Value} message Int64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int64Value} Int64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int64Value message. + * @function verify + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates an Int64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int64Value} Int64Value + */ + Int64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int64Value) + return object; + var message = new $root.google.protobuf.Int64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = false; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from an Int64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int64Value + * @static + * @param {google.protobuf.Int64Value} message Int64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int64Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber() : message.value; + return object; + }; + + /** + * Converts this Int64Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int64Value + * @instance + * @returns {Object.} JSON object + */ + Int64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Int64Value; + })(); + + protobuf.UInt64Value = (function() { + + /** + * Properties of a UInt64Value. + * @memberof google.protobuf + * @interface IUInt64Value + * @property {number|Long|null} [value] UInt64Value value + */ + + /** + * Constructs a new UInt64Value. + * @memberof google.protobuf + * @classdesc Represents a UInt64Value. + * @implements IUInt64Value + * @constructor + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + */ + function UInt64Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UInt64Value value. + * @member {number|Long} value + * @memberof google.protobuf.UInt64Value + * @instance + */ + UInt64Value.prototype.value = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new UInt64Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value=} [properties] Properties to set + * @returns {google.protobuf.UInt64Value} UInt64Value instance + */ + UInt64Value.create = function create(properties) { + return new UInt64Value(properties); + }; + + /** + * Encodes the specified UInt64Value message. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.value); + return writer; + }; + + /** + * Encodes the specified UInt64Value message, length delimited. Does not implicitly {@link google.protobuf.UInt64Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.IUInt64Value} message UInt64Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt64Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt64Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt64Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt64Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt64Value} UInt64Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt64Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt64Value message. + * @function verify + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt64Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value) && !(message.value && $util.isInteger(message.value.low) && $util.isInteger(message.value.high))) + return "value: integer|Long expected"; + return null; + }; + + /** + * Creates a UInt64Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt64Value} UInt64Value + */ + UInt64Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt64Value) + return object; + var message = new $root.google.protobuf.UInt64Value(); + if (object.value != null) + if ($util.Long) + (message.value = $util.Long.fromValue(object.value)).unsigned = true; + else if (typeof object.value === "string") + message.value = parseInt(object.value, 10); + else if (typeof object.value === "number") + message.value = object.value; + else if (typeof object.value === "object") + message.value = new $util.LongBits(object.value.low >>> 0, object.value.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a UInt64Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt64Value + * @static + * @param {google.protobuf.UInt64Value} message UInt64Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt64Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.value = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.value = options.longs === String ? "0" : 0; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value === "number") + object.value = options.longs === String ? String(message.value) : message.value; + else + object.value = options.longs === String ? $util.Long.prototype.toString.call(message.value) : options.longs === Number ? new $util.LongBits(message.value.low >>> 0, message.value.high >>> 0).toNumber(true) : message.value; + return object; + }; + + /** + * Converts this UInt64Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt64Value + * @instance + * @returns {Object.} JSON object + */ + UInt64Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UInt64Value; + })(); + + protobuf.Int32Value = (function() { + + /** + * Properties of an Int32Value. + * @memberof google.protobuf + * @interface IInt32Value + * @property {number|null} [value] Int32Value value + */ + + /** + * Constructs a new Int32Value. + * @memberof google.protobuf + * @classdesc Represents an Int32Value. + * @implements IInt32Value + * @constructor + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + */ + function Int32Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Int32Value value. + * @member {number} value + * @memberof google.protobuf.Int32Value + * @instance + */ + Int32Value.prototype.value = 0; + + /** + * Creates a new Int32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value=} [properties] Properties to set + * @returns {google.protobuf.Int32Value} Int32Value instance + */ + Int32Value.create = function create(properties) { + return new Int32Value(properties); + }; + + /** + * Encodes the specified Int32Value message. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.value); + return writer; + }; + + /** + * Encodes the specified Int32Value message, length delimited. Does not implicitly {@link google.protobuf.Int32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.IInt32Value} message Int32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Int32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Int32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Int32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Int32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Int32Value} Int32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Int32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Int32Value message. + * @function verify + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Int32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates an Int32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Int32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Int32Value} Int32Value + */ + Int32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Int32Value) + return object; + var message = new $root.google.protobuf.Int32Value(); + if (object.value != null) + message.value = object.value | 0; + return message; + }; + + /** + * Creates a plain object from an Int32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Int32Value + * @static + * @param {google.protobuf.Int32Value} message Int32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Int32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this Int32Value to JSON. + * @function toJSON + * @memberof google.protobuf.Int32Value + * @instance + * @returns {Object.} JSON object + */ + Int32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Int32Value; + })(); + + protobuf.UInt32Value = (function() { + + /** + * Properties of a UInt32Value. + * @memberof google.protobuf + * @interface IUInt32Value + * @property {number|null} [value] UInt32Value value + */ + + /** + * Constructs a new UInt32Value. + * @memberof google.protobuf + * @classdesc Represents a UInt32Value. + * @implements IUInt32Value + * @constructor + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + */ + function UInt32Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UInt32Value value. + * @member {number} value + * @memberof google.protobuf.UInt32Value + * @instance + */ + UInt32Value.prototype.value = 0; + + /** + * Creates a new UInt32Value instance using the specified properties. + * @function create + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value=} [properties] Properties to set + * @returns {google.protobuf.UInt32Value} UInt32Value instance + */ + UInt32Value.create = function create(properties) { + return new UInt32Value(properties); + }; + + /** + * Encodes the specified UInt32Value message. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).uint32(message.value); + return writer; + }; + + /** + * Encodes the specified UInt32Value message, length delimited. Does not implicitly {@link google.protobuf.UInt32Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.IUInt32Value} message UInt32Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UInt32Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.UInt32Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a UInt32Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UInt32Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UInt32Value} UInt32Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UInt32Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a UInt32Value message. + * @function verify + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UInt32Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isInteger(message.value)) + return "value: integer expected"; + return null; + }; + + /** + * Creates a UInt32Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UInt32Value} UInt32Value + */ + UInt32Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UInt32Value) + return object; + var message = new $root.google.protobuf.UInt32Value(); + if (object.value != null) + message.value = object.value >>> 0; + return message; + }; + + /** + * Creates a plain object from a UInt32Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UInt32Value + * @static + * @param {google.protobuf.UInt32Value} message UInt32Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UInt32Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = 0; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this UInt32Value to JSON. + * @function toJSON + * @memberof google.protobuf.UInt32Value + * @instance + * @returns {Object.} JSON object + */ + UInt32Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return UInt32Value; + })(); + + protobuf.BoolValue = (function() { + + /** + * Properties of a BoolValue. + * @memberof google.protobuf + * @interface IBoolValue + * @property {boolean|null} [value] BoolValue value + */ + + /** + * Constructs a new BoolValue. + * @memberof google.protobuf + * @classdesc Represents a BoolValue. + * @implements IBoolValue + * @constructor + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + */ + function BoolValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BoolValue value. + * @member {boolean} value + * @memberof google.protobuf.BoolValue + * @instance + */ + BoolValue.prototype.value = false; + + /** + * Creates a new BoolValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue=} [properties] Properties to set + * @returns {google.protobuf.BoolValue} BoolValue instance + */ + BoolValue.create = function create(properties) { + return new BoolValue(properties); + }; + + /** + * Encodes the specified BoolValue message. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.value); + return writer; + }; + + /** + * Encodes the specified BoolValue message, length delimited. Does not implicitly {@link google.protobuf.BoolValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.IBoolValue} message BoolValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BoolValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BoolValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BoolValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BoolValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BoolValue} BoolValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BoolValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BoolValue message. + * @function verify + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BoolValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (typeof message.value !== "boolean") + return "value: boolean expected"; + return null; + }; + + /** + * Creates a BoolValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BoolValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BoolValue} BoolValue + */ + BoolValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BoolValue) + return object; + var message = new $root.google.protobuf.BoolValue(); + if (object.value != null) + message.value = Boolean(object.value); + return message; + }; + + /** + * Creates a plain object from a BoolValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BoolValue + * @static + * @param {google.protobuf.BoolValue} message BoolValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BoolValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = false; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this BoolValue to JSON. + * @function toJSON + * @memberof google.protobuf.BoolValue + * @instance + * @returns {Object.} JSON object + */ + BoolValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BoolValue; + })(); + + protobuf.StringValue = (function() { + + /** + * Properties of a StringValue. + * @memberof google.protobuf + * @interface IStringValue + * @property {string|null} [value] StringValue value + */ + + /** + * Constructs a new StringValue. + * @memberof google.protobuf + * @classdesc Represents a StringValue. + * @implements IStringValue + * @constructor + * @param {google.protobuf.IStringValue=} [properties] Properties to set + */ + function StringValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StringValue value. + * @member {string} value + * @memberof google.protobuf.StringValue + * @instance + */ + StringValue.prototype.value = ""; + + /** + * Creates a new StringValue instance using the specified properties. + * @function create + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue=} [properties] Properties to set + * @returns {google.protobuf.StringValue} StringValue instance + */ + StringValue.create = function create(properties) { + return new StringValue(properties); + }; + + /** + * Encodes the specified StringValue message. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); + return writer; + }; + + /** + * Encodes the specified StringValue message, length delimited. Does not implicitly {@link google.protobuf.StringValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.IStringValue} message StringValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StringValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StringValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.StringValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StringValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.StringValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.StringValue} StringValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StringValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StringValue message. + * @function verify + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StringValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!$util.isString(message.value)) + return "value: string expected"; + return null; + }; + + /** + * Creates a StringValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.StringValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.StringValue} StringValue + */ + StringValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.StringValue) + return object; + var message = new $root.google.protobuf.StringValue(); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from a StringValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.StringValue + * @static + * @param {google.protobuf.StringValue} message StringValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StringValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.value = ""; + if (message.value != null && message.hasOwnProperty("value")) + object.value = message.value; + return object; + }; + + /** + * Converts this StringValue to JSON. + * @function toJSON + * @memberof google.protobuf.StringValue + * @instance + * @returns {Object.} JSON object + */ + StringValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return StringValue; + })(); + + protobuf.BytesValue = (function() { + + /** + * Properties of a BytesValue. + * @memberof google.protobuf + * @interface IBytesValue + * @property {Uint8Array|null} [value] BytesValue value + */ + + /** + * Constructs a new BytesValue. + * @memberof google.protobuf + * @classdesc Represents a BytesValue. + * @implements IBytesValue + * @constructor + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + */ + function BytesValue(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BytesValue value. + * @member {Uint8Array} value + * @memberof google.protobuf.BytesValue + * @instance + */ + BytesValue.prototype.value = $util.newBuffer([]); + + /** + * Creates a new BytesValue instance using the specified properties. + * @function create + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue=} [properties] Properties to set + * @returns {google.protobuf.BytesValue} BytesValue instance + */ + BytesValue.create = function create(properties) { + return new BytesValue(properties); + }; + + /** + * Encodes the specified BytesValue message. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.value); + return writer; + }; + + /** + * Encodes the specified BytesValue message, length delimited. Does not implicitly {@link google.protobuf.BytesValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.IBytesValue} message BytesValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BytesValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.BytesValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.value = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BytesValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.BytesValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.BytesValue} BytesValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BytesValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BytesValue message. + * @function verify + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BytesValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.value != null && message.hasOwnProperty("value")) + if (!(message.value && typeof message.value.length === "number" || $util.isString(message.value))) + return "value: buffer expected"; + return null; + }; + + /** + * Creates a BytesValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.BytesValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.BytesValue} BytesValue + */ + BytesValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.BytesValue) + return object; + var message = new $root.google.protobuf.BytesValue(); + if (object.value != null) + if (typeof object.value === "string") + $util.base64.decode(object.value, message.value = $util.newBuffer($util.base64.length(object.value)), 0); + else if (object.value.length >= 0) + message.value = object.value; + return message; + }; + + /** + * Creates a plain object from a BytesValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.BytesValue + * @static + * @param {google.protobuf.BytesValue} message BytesValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BytesValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + if (options.bytes === String) + object.value = ""; + else { + object.value = []; + if (options.bytes !== Array) + object.value = $util.newBuffer(object.value); + } + if (message.value != null && message.hasOwnProperty("value")) + object.value = options.bytes === String ? $util.base64.encode(message.value, 0, message.value.length) : options.bytes === Array ? Array.prototype.slice.call(message.value) : message.value; + return object; + }; + + /** + * Converts this BytesValue to JSON. + * @function toJSON + * @memberof google.protobuf.BytesValue + * @instance + * @returns {Object.} JSON object + */ + BytesValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return BytesValue; + })(); + + protobuf.Struct = (function() { + + /** + * Properties of a Struct. + * @memberof google.protobuf + * @interface IStruct + * @property {Object.|null} [fields] Struct fields + */ + + /** + * Constructs a new Struct. + * @memberof google.protobuf + * @classdesc Represents a Struct. + * @implements IStruct + * @constructor + * @param {google.protobuf.IStruct=} [properties] Properties to set + */ + function Struct(properties) { + this.fields = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Struct fields. + * @member {Object.} fields + * @memberof google.protobuf.Struct + * @instance + */ + Struct.prototype.fields = $util.emptyObject; + + /** + * Creates a new Struct instance using the specified properties. + * @function create + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct=} [properties] Properties to set + * @returns {google.protobuf.Struct} Struct instance + */ + Struct.create = function create(properties) { + return new Struct(properties); + }; + + /** + * Encodes the specified Struct message. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.fields != null && Object.hasOwnProperty.call(message, "fields")) + for (var keys = Object.keys(message.fields), i = 0; i < keys.length; ++i) { + writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]); + $root.google.protobuf.Value.encode(message.fields[keys[i]], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim().ldelim(); + } + return writer; + }; + + /** + * Encodes the specified Struct message, length delimited. Does not implicitly {@link google.protobuf.Struct.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.IStruct} message Struct message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Struct.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Struct message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Struct(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (message.fields === $util.emptyObject) + message.fields = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = null; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = $root.google.protobuf.Value.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.fields[key] = value; + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Struct message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Struct + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Struct} Struct + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Struct.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Struct message. + * @function verify + * @memberof google.protobuf.Struct + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Struct.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.fields != null && message.hasOwnProperty("fields")) { + if (!$util.isObject(message.fields)) + return "fields: object expected"; + var key = Object.keys(message.fields); + for (var i = 0; i < key.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.fields[key[i]]); + if (error) + return "fields." + error; + } + } + return null; + }; + + /** + * Creates a Struct message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Struct + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Struct} Struct + */ + Struct.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Struct) + return object; + var message = new $root.google.protobuf.Struct(); + if (object.fields) { + if (typeof object.fields !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields = {}; + for (var keys = Object.keys(object.fields), i = 0; i < keys.length; ++i) { + if (typeof object.fields[keys[i]] !== "object") + throw TypeError(".google.protobuf.Struct.fields: object expected"); + message.fields[keys[i]] = $root.google.protobuf.Value.fromObject(object.fields[keys[i]]); + } + } + return message; + }; + + /** + * Creates a plain object from a Struct message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Struct + * @static + * @param {google.protobuf.Struct} message Struct + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Struct.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.fields = {}; + var keys2; + if (message.fields && (keys2 = Object.keys(message.fields)).length) { + object.fields = {}; + for (var j = 0; j < keys2.length; ++j) + object.fields[keys2[j]] = $root.google.protobuf.Value.toObject(message.fields[keys2[j]], options); + } + return object; + }; + + /** + * Converts this Struct to JSON. + * @function toJSON + * @memberof google.protobuf.Struct + * @instance + * @returns {Object.} JSON object + */ + Struct.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Struct; + })(); + + protobuf.Value = (function() { + + /** + * Properties of a Value. + * @memberof google.protobuf + * @interface IValue + * @property {google.protobuf.NullValue|null} [nullValue] Value nullValue + * @property {number|null} [numberValue] Value numberValue + * @property {string|null} [stringValue] Value stringValue + * @property {boolean|null} [boolValue] Value boolValue + * @property {google.protobuf.IStruct|null} [structValue] Value structValue + * @property {google.protobuf.IListValue|null} [listValue] Value listValue + */ + + /** + * Constructs a new Value. + * @memberof google.protobuf + * @classdesc Represents a Value. + * @implements IValue + * @constructor + * @param {google.protobuf.IValue=} [properties] Properties to set + */ + function Value(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Value nullValue. + * @member {google.protobuf.NullValue} nullValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.nullValue = 0; + + /** + * Value numberValue. + * @member {number} numberValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.numberValue = 0; + + /** + * Value stringValue. + * @member {string} stringValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.stringValue = ""; + + /** + * Value boolValue. + * @member {boolean} boolValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.boolValue = false; + + /** + * Value structValue. + * @member {google.protobuf.IStruct|null|undefined} structValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.structValue = null; + + /** + * Value listValue. + * @member {google.protobuf.IListValue|null|undefined} listValue + * @memberof google.protobuf.Value + * @instance + */ + Value.prototype.listValue = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * Value kind. + * @member {"nullValue"|"numberValue"|"stringValue"|"boolValue"|"structValue"|"listValue"|undefined} kind + * @memberof google.protobuf.Value + * @instance + */ + Object.defineProperty(Value.prototype, "kind", { + get: $util.oneOfGetter($oneOfFields = ["nullValue", "numberValue", "stringValue", "boolValue", "structValue", "listValue"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Value instance using the specified properties. + * @function create + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue=} [properties] Properties to set + * @returns {google.protobuf.Value} Value instance + */ + Value.create = function create(properties) { + return new Value(properties); + }; + + /** + * Encodes the specified Value message. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encode + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.nullValue != null && Object.hasOwnProperty.call(message, "nullValue")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.nullValue); + if (message.numberValue != null && Object.hasOwnProperty.call(message, "numberValue")) + writer.uint32(/* id 2, wireType 1 =*/17).double(message.numberValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.stringValue); + if (message.boolValue != null && Object.hasOwnProperty.call(message, "boolValue")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.boolValue); + if (message.structValue != null && Object.hasOwnProperty.call(message, "structValue")) + $root.google.protobuf.Struct.encode(message.structValue, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.listValue != null && Object.hasOwnProperty.call(message, "listValue")) + $root.google.protobuf.ListValue.encode(message.listValue, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Value message, length delimited. Does not implicitly {@link google.protobuf.Value.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.IValue} message Value message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Value.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Value message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.Value(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.nullValue = reader.int32(); + break; + case 2: + message.numberValue = reader.double(); + break; + case 3: + message.stringValue = reader.string(); + break; + case 4: + message.boolValue = reader.bool(); + break; + case 5: + message.structValue = $root.google.protobuf.Struct.decode(reader, reader.uint32()); + break; + case 6: + message.listValue = $root.google.protobuf.ListValue.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Value message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.Value + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.Value} Value + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Value.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Value message. + * @function verify + * @memberof google.protobuf.Value + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Value.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + properties.kind = 1; + switch (message.nullValue) { + default: + return "nullValue: enum value expected"; + case 0: + break; + } + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.numberValue !== "number") + return "numberValue: number expected"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (!$util.isString(message.stringValue)) + return "stringValue: string expected"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + if (typeof message.boolValue !== "boolean") + return "boolValue: boolean expected"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.Struct.verify(message.structValue); + if (error) + return "structValue." + error; + } + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + if (properties.kind === 1) + return "kind: multiple values"; + properties.kind = 1; + { + var error = $root.google.protobuf.ListValue.verify(message.listValue); + if (error) + return "listValue." + error; + } + } + return null; + }; + + /** + * Creates a Value message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.Value + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.Value} Value + */ + Value.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.Value) + return object; + var message = new $root.google.protobuf.Value(); + switch (object.nullValue) { + case "NULL_VALUE": + case 0: + message.nullValue = 0; + break; + } + if (object.numberValue != null) + message.numberValue = Number(object.numberValue); + if (object.stringValue != null) + message.stringValue = String(object.stringValue); + if (object.boolValue != null) + message.boolValue = Boolean(object.boolValue); + if (object.structValue != null) { + if (typeof object.structValue !== "object") + throw TypeError(".google.protobuf.Value.structValue: object expected"); + message.structValue = $root.google.protobuf.Struct.fromObject(object.structValue); + } + if (object.listValue != null) { + if (typeof object.listValue !== "object") + throw TypeError(".google.protobuf.Value.listValue: object expected"); + message.listValue = $root.google.protobuf.ListValue.fromObject(object.listValue); + } + return message; + }; + + /** + * Creates a plain object from a Value message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.Value + * @static + * @param {google.protobuf.Value} message Value + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Value.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.nullValue != null && message.hasOwnProperty("nullValue")) { + object.nullValue = options.enums === String ? $root.google.protobuf.NullValue[message.nullValue] : message.nullValue; + if (options.oneofs) + object.kind = "nullValue"; + } + if (message.numberValue != null && message.hasOwnProperty("numberValue")) { + object.numberValue = options.json && !isFinite(message.numberValue) ? String(message.numberValue) : message.numberValue; + if (options.oneofs) + object.kind = "numberValue"; + } + if (message.stringValue != null && message.hasOwnProperty("stringValue")) { + object.stringValue = message.stringValue; + if (options.oneofs) + object.kind = "stringValue"; + } + if (message.boolValue != null && message.hasOwnProperty("boolValue")) { + object.boolValue = message.boolValue; + if (options.oneofs) + object.kind = "boolValue"; + } + if (message.structValue != null && message.hasOwnProperty("structValue")) { + object.structValue = $root.google.protobuf.Struct.toObject(message.structValue, options); + if (options.oneofs) + object.kind = "structValue"; + } + if (message.listValue != null && message.hasOwnProperty("listValue")) { + object.listValue = $root.google.protobuf.ListValue.toObject(message.listValue, options); + if (options.oneofs) + object.kind = "listValue"; + } + return object; + }; + + /** + * Converts this Value to JSON. + * @function toJSON + * @memberof google.protobuf.Value + * @instance + * @returns {Object.} JSON object + */ + Value.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Value; + })(); + + /** + * NullValue enum. + * @name google.protobuf.NullValue + * @enum {number} + * @property {number} NULL_VALUE=0 NULL_VALUE value + */ + protobuf.NullValue = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NULL_VALUE"] = 0; + return values; + })(); + + protobuf.ListValue = (function() { + + /** + * Properties of a ListValue. + * @memberof google.protobuf + * @interface IListValue + * @property {Array.|null} [values] ListValue values + */ + + /** + * Constructs a new ListValue. + * @memberof google.protobuf + * @classdesc Represents a ListValue. + * @implements IListValue + * @constructor + * @param {google.protobuf.IListValue=} [properties] Properties to set + */ + function ListValue(properties) { + this.values = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListValue values. + * @member {Array.} values + * @memberof google.protobuf.ListValue + * @instance + */ + ListValue.prototype.values = $util.emptyArray; + + /** + * Creates a new ListValue instance using the specified properties. + * @function create + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue=} [properties] Properties to set + * @returns {google.protobuf.ListValue} ListValue instance + */ + ListValue.create = function create(properties) { + return new ListValue(properties); + }; + + /** + * Encodes the specified ListValue message. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.values != null && message.values.length) + for (var i = 0; i < message.values.length; ++i) + $root.google.protobuf.Value.encode(message.values[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ListValue message, length delimited. Does not implicitly {@link google.protobuf.ListValue.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.IListValue} message ListValue message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListValue.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListValue message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.protobuf.ListValue(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.values && message.values.length)) + message.values = []; + message.values.push($root.google.protobuf.Value.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListValue message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ListValue + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ListValue} ListValue + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListValue.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListValue message. + * @function verify + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListValue.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.values != null && message.hasOwnProperty("values")) { + if (!Array.isArray(message.values)) + return "values: array expected"; + for (var i = 0; i < message.values.length; ++i) { + var error = $root.google.protobuf.Value.verify(message.values[i]); + if (error) + return "values." + error; + } + } + return null; + }; + + /** + * Creates a ListValue message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ListValue + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ListValue} ListValue + */ + ListValue.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ListValue) + return object; + var message = new $root.google.protobuf.ListValue(); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.protobuf.ListValue.values: array expected"); + message.values = []; + for (var i = 0; i < object.values.length; ++i) { + if (typeof object.values[i] !== "object") + throw TypeError(".google.protobuf.ListValue.values: object expected"); + message.values[i] = $root.google.protobuf.Value.fromObject(object.values[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ListValue message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ListValue + * @static + * @param {google.protobuf.ListValue} message ListValue + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListValue.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.values && message.values.length) { + object.values = []; + for (var j = 0; j < message.values.length; ++j) + object.values[j] = $root.google.protobuf.Value.toObject(message.values[j], options); + } + return object; + }; + + /** + * Converts this ListValue to JSON. + * @function toJSON + * @memberof google.protobuf.ListValue + * @instance + * @returns {Object.} JSON object + */ + ListValue.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ListValue; + })(); protobuf.Timestamp = (function() { diff --git a/packages/dapi-grpc/clients/platform/v0/nodejs/platform_protoc.js b/packages/dapi-grpc/clients/platform/v0/nodejs/platform_protoc.js index 72718d320c..3684443165 100644 --- a/packages/dapi-grpc/clients/platform/v0/nodejs/platform_protoc.js +++ b/packages/dapi-grpc/clients/platform/v0/nodejs/platform_protoc.js @@ -15,8 +15,13 @@ var jspb = require('google-protobuf'); var goog = jspb; const proto = {}; +var google_protobuf_wrappers_pb = require('google-protobuf/google/protobuf/wrappers_pb.js'); +goog.object.extend(proto, google_protobuf_wrappers_pb); +var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_pb.js'); +goog.object.extend(proto, google_protobuf_struct_pb); var google_protobuf_timestamp_pb = require('google-protobuf/google/protobuf/timestamp_pb.js'); goog.object.extend(proto, google_protobuf_timestamp_pb); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.AllKeys', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.ConsensusParamsBlock', null, { proto }); @@ -25,15 +30,44 @@ goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetConsensusParamsRequest', n goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetConsensusParamsResponse', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractRequest', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractResponse', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractsRequest', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractsResponse', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractsResponse.ResultCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsRequest', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsRequest.StartCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsResponse', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap.KeyKindRequestType', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.ResultCase', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.ResultCase', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.ResultCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityRequest', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityResponse', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.KeyRequestType', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.KeyRequestType.RequestCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.Proof', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.ResponseMetadata', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.SearchKey', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.SecurityLevelMap', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.SecurityLevelMap.KeyKindRequestType', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.SpecificKeys', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse', null, { proto }); @@ -195,16 +229,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetDataContractRequest = function(opt_data) { +proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetDataContractRequest, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetDataContractRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetDataContractRequest'; + proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse'; } /** * Generated by JsPbCodeGenerator. @@ -216,16 +250,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetDataContractResponse = function(opt_data) { +proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetDataContractResponse, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetDataContractResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetDataContractResponse'; + proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse'; } /** * Generated by JsPbCodeGenerator. @@ -237,16 +271,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.oneofGroups_); +proto.org.dash.platform.dapi.v0.KeyRequestType = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.KeyRequestType.oneofGroups_); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsRequest, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.KeyRequestType, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetDocumentsRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsRequest'; + proto.org.dash.platform.dapi.v0.KeyRequestType.displayName = 'proto.org.dash.platform.dapi.v0.KeyRequestType'; } /** * Generated by JsPbCodeGenerator. @@ -258,16 +292,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.repeatedFields_, null); +proto.org.dash.platform.dapi.v0.AllKeys = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsResponse, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.AllKeys, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetDocumentsResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsResponse'; + proto.org.dash.platform.dapi.v0.AllKeys.displayName = 'proto.org.dash.platform.dapi.v0.AllKeys'; } /** * Generated by JsPbCodeGenerator. @@ -279,16 +313,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.repeatedFields_, null); +proto.org.dash.platform.dapi.v0.SpecificKeys = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.SpecificKeys.repeatedFields_, null); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.SpecificKeys, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest'; + proto.org.dash.platform.dapi.v0.SpecificKeys.displayName = 'proto.org.dash.platform.dapi.v0.SpecificKeys'; } /** * Generated by JsPbCodeGenerator. @@ -300,16 +334,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.repeatedFields_, null); +proto.org.dash.platform.dapi.v0.SearchKey = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.SearchKey, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse'; + proto.org.dash.platform.dapi.v0.SearchKey.displayName = 'proto.org.dash.platform.dapi.v0.SearchKey'; } /** * Generated by JsPbCodeGenerator. @@ -321,16 +355,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest = function(opt_data) { +proto.org.dash.platform.dapi.v0.SecurityLevelMap = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.SecurityLevelMap, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.displayName = 'proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest'; + proto.org.dash.platform.dapi.v0.SecurityLevelMap.displayName = 'proto.org.dash.platform.dapi.v0.SecurityLevelMap'; } /** * Generated by JsPbCodeGenerator. @@ -342,16 +376,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.oneofGroups_); +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.displayName = 'proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse'; + proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest'; } /** * Generated by JsPbCodeGenerator. @@ -363,16 +397,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.ConsensusParamsBlock = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.oneofGroups_); }; -goog.inherits(proto.org.dash.platform.dapi.v0.ConsensusParamsBlock, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.ConsensusParamsBlock.displayName = 'proto.org.dash.platform.dapi.v0.ConsensusParamsBlock'; + proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse'; } /** * Generated by JsPbCodeGenerator. @@ -384,16 +418,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.ConsensusParamsEvidence = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.repeatedFields_, null); }; -goog.inherits(proto.org.dash.platform.dapi.v0.ConsensusParamsEvidence, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.ConsensusParamsEvidence.displayName = 'proto.org.dash.platform.dapi.v0.ConsensusParamsEvidence'; + proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.displayName = 'proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys'; } /** * Generated by JsPbCodeGenerator. @@ -405,16 +439,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetConsensusParamsRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.repeatedFields_, null); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetConsensusParamsRequest, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetConsensusParamsRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetConsensusParamsRequest'; + proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest'; } /** * Generated by JsPbCodeGenerator. @@ -426,306 +460,5569 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetConsensusParamsResponse = function(opt_data) { +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetConsensusParamsResponse, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetConsensusParamsResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetConsensusParamsResponse'; + proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap.displayName = 'proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap'; } - - - -if (jspb.Message.GENERATE_TO_OBJECT) { /** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor */ -proto.org.dash.platform.dapi.v0.Proof.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.Proof.toObject(opt_includeInstance, this); +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.oneofGroups_); }; - - +goog.inherits(proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse'; +} /** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.Proof} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor */ -proto.org.dash.platform.dapi.v0.Proof.toObject = function(includeInstance, msg) { - var f, obj = { - merkleProof: msg.getMerkleProof_asB64(), - quorumHash: msg.getQuorumHash_asB64(), - signature: msg.getSignature_asB64(), - round: jspb.Message.getFieldWithDefault(msg, 4, 0) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; +goog.inherits(proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey.displayName = 'proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey'; } - - /** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.Proof} + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor */ -proto.org.dash.platform.dapi.v0.Proof.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.Proof; - return proto.org.dash.platform.dapi.v0.Proof.deserializeBinaryFromReader(msg, reader); +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; - - +goog.inherits(proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.displayName = 'proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry'; +} /** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.Proof} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.Proof} + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor */ -proto.org.dash.platform.dapi.v0.Proof.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setMerkleProof(value); - break; - case 2: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setQuorumHash(value); - break; - case 3: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setSignature(value); - break; - case 4: - var value = /** @type {number} */ (reader.readUint32()); - msg.setRound(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.repeatedFields_, null); }; - - +goog.inherits(proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.displayName = 'proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries'; +} /** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor */ -proto.org.dash.platform.dapi.v0.Proof.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.Proof.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); +proto.org.dash.platform.dapi.v0.GetDataContractRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; - - +goog.inherits(proto.org.dash.platform.dapi.v0.GetDataContractRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetDataContractRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetDataContractRequest'; +} /** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.Proof} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor */ -proto.org.dash.platform.dapi.v0.Proof.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getMerkleProof_asU8(); - if (f.length > 0) { - writer.writeBytes( - 1, - f - ); - } - f = message.getQuorumHash_asU8(); - if (f.length > 0) { - writer.writeBytes( - 2, - f - ); - } - f = message.getSignature_asU8(); - if (f.length > 0) { - writer.writeBytes( - 3, - f - ); - } - f = message.getRound(); - if (f !== 0) { - writer.writeUint32( - 4, - f - ); - } +proto.org.dash.platform.dapi.v0.GetDataContractResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; +goog.inherits(proto.org.dash.platform.dapi.v0.GetDataContractResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetDataContractResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetDataContractResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetDataContractsRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetDataContractsRequest.repeatedFields_, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetDataContractsRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetDataContractsRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetDataContractsRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetDataContractsResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetDataContractsResponse.oneofGroups_); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetDataContractsResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetDataContractsResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetDataContractsResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue.displayName = 'proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.displayName = 'proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.repeatedFields_, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.displayName = 'proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.oneofGroups_); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetDocumentsRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.repeatedFields_, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.repeatedFields_, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.repeatedFields_, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.oneofGroups_); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.displayName = 'proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.oneofGroups_); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.displayName = 'proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.ConsensusParamsBlock = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.ConsensusParamsBlock, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.ConsensusParamsBlock.displayName = 'proto.org.dash.platform.dapi.v0.ConsensusParamsBlock'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.ConsensusParamsEvidence = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.ConsensusParamsEvidence, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.ConsensusParamsEvidence.displayName = 'proto.org.dash.platform.dapi.v0.ConsensusParamsEvidence'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetConsensusParamsRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetConsensusParamsRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetConsensusParamsRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetConsensusParamsRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetConsensusParamsResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetConsensusParamsResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetConsensusParamsResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetConsensusParamsResponse'; +} + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.Proof.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.Proof.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.Proof} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.Proof.toObject = function(includeInstance, msg) { + var f, obj = { + grovedbProof: msg.getGrovedbProof_asB64(), + quorumHash: msg.getQuorumHash_asB64(), + signature: msg.getSignature_asB64(), + round: jspb.Message.getFieldWithDefault(msg, 4, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.Proof} + */ +proto.org.dash.platform.dapi.v0.Proof.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.Proof; + return proto.org.dash.platform.dapi.v0.Proof.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.Proof} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.Proof} + */ +proto.org.dash.platform.dapi.v0.Proof.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setGrovedbProof(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setQuorumHash(value); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setSignature(value); + break; + case 4: + var value = /** @type {number} */ (reader.readUint32()); + msg.setRound(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.Proof.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.Proof.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.Proof} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.Proof.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getGrovedbProof_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getQuorumHash_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } + f = message.getSignature_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } + f = message.getRound(); + if (f !== 0) { + writer.writeUint32( + 4, + f + ); + } +}; + + +/** + * optional bytes grovedb_proof = 1; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.Proof.prototype.getGrovedbProof = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes grovedb_proof = 1; + * This is a type-conversion wrapper around `getGrovedbProof()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.Proof.prototype.getGrovedbProof_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getGrovedbProof())); +}; + + +/** + * optional bytes grovedb_proof = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getGrovedbProof()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.Proof.prototype.getGrovedbProof_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getGrovedbProof())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.Proof} returns this + */ +proto.org.dash.platform.dapi.v0.Proof.prototype.setGrovedbProof = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional bytes quorum_hash = 2; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.Proof.prototype.getQuorumHash = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes quorum_hash = 2; + * This is a type-conversion wrapper around `getQuorumHash()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.Proof.prototype.getQuorumHash_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getQuorumHash())); +}; + + +/** + * optional bytes quorum_hash = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getQuorumHash()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.Proof.prototype.getQuorumHash_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getQuorumHash())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.Proof} returns this + */ +proto.org.dash.platform.dapi.v0.Proof.prototype.setQuorumHash = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); +}; + + +/** + * optional bytes signature = 3; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.Proof.prototype.getSignature = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * optional bytes signature = 3; + * This is a type-conversion wrapper around `getSignature()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.Proof.prototype.getSignature_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getSignature())); +}; + + +/** + * optional bytes signature = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getSignature()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.Proof.prototype.getSignature_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getSignature())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.Proof} returns this + */ +proto.org.dash.platform.dapi.v0.Proof.prototype.setSignature = function(value) { + return jspb.Message.setProto3BytesField(this, 3, value); +}; + + +/** + * optional uint32 round = 4; + * @return {number} + */ +proto.org.dash.platform.dapi.v0.Proof.prototype.getRound = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.org.dash.platform.dapi.v0.Proof} returns this + */ +proto.org.dash.platform.dapi.v0.Proof.prototype.setRound = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.ResponseMetadata.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.ResponseMetadata} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.ResponseMetadata.toObject = function(includeInstance, msg) { + var f, obj = { + height: jspb.Message.getFieldWithDefault(msg, 1, 0), + coreChainLockedHeight: jspb.Message.getFieldWithDefault(msg, 2, 0), + timeMs: jspb.Message.getFieldWithDefault(msg, 3, 0), + protocolVersion: jspb.Message.getFieldWithDefault(msg, 4, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.ResponseMetadata} + */ +proto.org.dash.platform.dapi.v0.ResponseMetadata.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.ResponseMetadata; + return proto.org.dash.platform.dapi.v0.ResponseMetadata.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.ResponseMetadata} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.ResponseMetadata} + */ +proto.org.dash.platform.dapi.v0.ResponseMetadata.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readUint64()); + msg.setHeight(value); + break; + case 2: + var value = /** @type {number} */ (reader.readUint32()); + msg.setCoreChainLockedHeight(value); + break; + case 3: + var value = /** @type {number} */ (reader.readUint64()); + msg.setTimeMs(value); + break; + case 4: + var value = /** @type {number} */ (reader.readUint32()); + msg.setProtocolVersion(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.ResponseMetadata.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.ResponseMetadata} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.ResponseMetadata.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getHeight(); + if (f !== 0) { + writer.writeUint64( + 1, + f + ); + } + f = message.getCoreChainLockedHeight(); + if (f !== 0) { + writer.writeUint32( + 2, + f + ); + } + f = message.getTimeMs(); + if (f !== 0) { + writer.writeUint64( + 3, + f + ); + } + f = message.getProtocolVersion(); + if (f !== 0) { + writer.writeUint32( + 4, + f + ); + } +}; + + +/** + * optional uint64 height = 1; + * @return {number} + */ +proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.getHeight = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.org.dash.platform.dapi.v0.ResponseMetadata} returns this + */ +proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.setHeight = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional uint32 core_chain_locked_height = 2; + * @return {number} + */ +proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.getCoreChainLockedHeight = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.org.dash.platform.dapi.v0.ResponseMetadata} returns this + */ +proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.setCoreChainLockedHeight = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); +}; + + +/** + * optional uint64 time_ms = 3; + * @return {number} + */ +proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.getTimeMs = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.org.dash.platform.dapi.v0.ResponseMetadata} returns this + */ +proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.setTimeMs = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); +}; + + +/** + * optional uint32 protocol_version = 4; + * @return {number} + */ +proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.getProtocolVersion = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.org.dash.platform.dapi.v0.ResponseMetadata} returns this + */ +proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.setProtocolVersion = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.toObject = function(includeInstance, msg) { + var f, obj = { + code: jspb.Message.getFieldWithDefault(msg, 1, 0), + message: jspb.Message.getFieldWithDefault(msg, 2, ""), + data: msg.getData_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError} + */ +proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError; + return proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError} + */ +proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readUint32()); + msg.setCode(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setMessage(value); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setData(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getCode(); + if (f !== 0) { + writer.writeUint32( + 1, + f + ); + } + f = message.getMessage(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getData_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } +}; + + +/** + * optional uint32 code = 1; + * @return {number} + */ +proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.prototype.getCode = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError} returns this + */ +proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.prototype.setCode = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional string message = 2; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.prototype.getMessage = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError} returns this + */ +proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.prototype.setMessage = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional bytes data = 3; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.prototype.getData = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * optional bytes data = 3; + * This is a type-conversion wrapper around `getData()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.prototype.getData_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getData())); +}; + + +/** + * optional bytes data = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getData()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.prototype.getData_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getData())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError} returns this + */ +proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.prototype.setData = function(value) { + return jspb.Message.setProto3BytesField(this, 3, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.toObject = function(includeInstance, msg) { + var f, obj = { + stateTransition: msg.getStateTransition_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} + */ +proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest; + return proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} + */ +proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setStateTransition(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getStateTransition_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } +}; + + +/** + * optional bytes state_transition = 1; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.prototype.getStateTransition = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes state_transition = 1; + * This is a type-conversion wrapper around `getStateTransition()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.prototype.getStateTransition_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getStateTransition())); +}; + + +/** + * optional bytes state_transition = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getStateTransition()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.prototype.getStateTransition_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getStateTransition())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} returns this + */ +proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.prototype.setStateTransition = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} + */ +proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse; + return proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} + */ +proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetIdentityRequest.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetIdentityRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentityRequest.toObject = function(includeInstance, msg) { + var f, obj = { + id: msg.getId_asB64(), + prove: jspb.Message.getBooleanFieldWithDefault(msg, 2, false) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityRequest} + */ +proto.org.dash.platform.dapi.v0.GetIdentityRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetIdentityRequest; + return proto.org.dash.platform.dapi.v0.GetIdentityRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityRequest} + */ +proto.org.dash.platform.dapi.v0.GetIdentityRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setId(value); + break; + case 2: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setProve(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetIdentityRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetIdentityRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentityRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getProve(); + if (f) { + writer.writeBool( + 2, + f + ); + } +}; + + +/** + * optional bytes id = 1; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetIdentityRequest.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes id = 1; + * This is a type-conversion wrapper around `getId()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetIdentityRequest.prototype.getId_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getId())); +}; + + +/** + * optional bytes id = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getId()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetIdentityRequest.prototype.getId_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getId())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityRequest} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentityRequest.prototype.setId = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional bool prove = 2; + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentityRequest.prototype.getProve = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityRequest} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentityRequest.prototype.setProve = function(value) { + return jspb.Message.setProto3BooleanField(this, 2, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetIdentityResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentityResponse.toObject = function(includeInstance, msg) { + var f, obj = { + identity: msg.getIdentity_asB64(), + proof: (f = msg.getProof()) && proto.org.dash.platform.dapi.v0.Proof.toObject(includeInstance, f), + metadata: (f = msg.getMetadata()) && proto.org.dash.platform.dapi.v0.ResponseMetadata.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityResponse} + */ +proto.org.dash.platform.dapi.v0.GetIdentityResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetIdentityResponse; + return proto.org.dash.platform.dapi.v0.GetIdentityResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityResponse} + */ +proto.org.dash.platform.dapi.v0.GetIdentityResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setIdentity(value); + break; + case 2: + var value = new proto.org.dash.platform.dapi.v0.Proof; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.Proof.deserializeBinaryFromReader); + msg.setProof(value); + break; + case 3: + var value = new proto.org.dash.platform.dapi.v0.ResponseMetadata; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.ResponseMetadata.deserializeBinaryFromReader); + msg.setMetadata(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetIdentityResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentityResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getIdentity_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getProof(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.org.dash.platform.dapi.v0.Proof.serializeBinaryToWriter + ); + } + f = message.getMetadata(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.org.dash.platform.dapi.v0.ResponseMetadata.serializeBinaryToWriter + ); + } +}; + + +/** + * optional bytes identity = 1; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.getIdentity = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes identity = 1; + * This is a type-conversion wrapper around `getIdentity()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.getIdentity_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getIdentity())); +}; + + +/** + * optional bytes identity = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getIdentity()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.getIdentity_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getIdentity())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityResponse} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.setIdentity = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional Proof proof = 2; + * @return {?proto.org.dash.platform.dapi.v0.Proof} + */ +proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.getProof = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.Proof} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.Proof, 2)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.Proof|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.setProof = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityResponse} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.clearProof = function() { + return this.setProof(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.hasProof = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional ResponseMetadata metadata = 3; + * @return {?proto.org.dash.platform.dapi.v0.ResponseMetadata} + */ +proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.getMetadata = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.ResponseMetadata, 3)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.ResponseMetadata|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.setMetadata = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityResponse} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.clearMetadata = function() { + return this.setMetadata(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.hasMetadata = function() { + return jspb.Message.getField(this, 3) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.toObject = function(includeInstance, msg) { + var f, obj = { + balance: (f = msg.getBalance()) && google_protobuf_wrappers_pb.UInt64Value.toObject(includeInstance, f), + proof: (f = msg.getProof()) && proto.org.dash.platform.dapi.v0.Proof.toObject(includeInstance, f), + metadata: (f = msg.getMetadata()) && proto.org.dash.platform.dapi.v0.ResponseMetadata.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse} + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse; + return proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse} + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new google_protobuf_wrappers_pb.UInt64Value; + reader.readMessage(value,google_protobuf_wrappers_pb.UInt64Value.deserializeBinaryFromReader); + msg.setBalance(value); + break; + case 2: + var value = new proto.org.dash.platform.dapi.v0.Proof; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.Proof.deserializeBinaryFromReader); + msg.setProof(value); + break; + case 3: + var value = new proto.org.dash.platform.dapi.v0.ResponseMetadata; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.ResponseMetadata.deserializeBinaryFromReader); + msg.setMetadata(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getBalance(); + if (f != null) { + writer.writeMessage( + 1, + f, + google_protobuf_wrappers_pb.UInt64Value.serializeBinaryToWriter + ); + } + f = message.getProof(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.org.dash.platform.dapi.v0.Proof.serializeBinaryToWriter + ); + } + f = message.getMetadata(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.org.dash.platform.dapi.v0.ResponseMetadata.serializeBinaryToWriter + ); + } +}; + + +/** + * optional google.protobuf.UInt64Value balance = 1; + * @return {?proto.google.protobuf.UInt64Value} + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.prototype.getBalance = function() { + return /** @type{?proto.google.protobuf.UInt64Value} */ ( + jspb.Message.getWrapperField(this, google_protobuf_wrappers_pb.UInt64Value, 1)); +}; + + +/** + * @param {?proto.google.protobuf.UInt64Value|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.prototype.setBalance = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.prototype.clearBalance = function() { + return this.setBalance(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.prototype.hasBalance = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional Proof proof = 2; + * @return {?proto.org.dash.platform.dapi.v0.Proof} + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.prototype.getProof = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.Proof} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.Proof, 2)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.Proof|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.prototype.setProof = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.prototype.clearProof = function() { + return this.setProof(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.prototype.hasProof = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional ResponseMetadata metadata = 3; + * @return {?proto.org.dash.platform.dapi.v0.ResponseMetadata} + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.prototype.getMetadata = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.ResponseMetadata, 3)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.ResponseMetadata|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.prototype.setMetadata = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.prototype.clearMetadata = function() { + return this.setMetadata(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.prototype.hasMetadata = function() { + return jspb.Message.getField(this, 3) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.toObject = function(includeInstance, msg) { + var f, obj = { + balance: (f = msg.getBalance()) && google_protobuf_wrappers_pb.UInt64Value.toObject(includeInstance, f), + revision: (f = msg.getRevision()) && google_protobuf_wrappers_pb.UInt64Value.toObject(includeInstance, f), + proof: (f = msg.getProof()) && proto.org.dash.platform.dapi.v0.Proof.toObject(includeInstance, f), + metadata: (f = msg.getMetadata()) && proto.org.dash.platform.dapi.v0.ResponseMetadata.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse; + return proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new google_protobuf_wrappers_pb.UInt64Value; + reader.readMessage(value,google_protobuf_wrappers_pb.UInt64Value.deserializeBinaryFromReader); + msg.setBalance(value); + break; + case 2: + var value = new google_protobuf_wrappers_pb.UInt64Value; + reader.readMessage(value,google_protobuf_wrappers_pb.UInt64Value.deserializeBinaryFromReader); + msg.setRevision(value); + break; + case 3: + var value = new proto.org.dash.platform.dapi.v0.Proof; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.Proof.deserializeBinaryFromReader); + msg.setProof(value); + break; + case 4: + var value = new proto.org.dash.platform.dapi.v0.ResponseMetadata; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.ResponseMetadata.deserializeBinaryFromReader); + msg.setMetadata(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getBalance(); + if (f != null) { + writer.writeMessage( + 1, + f, + google_protobuf_wrappers_pb.UInt64Value.serializeBinaryToWriter + ); + } + f = message.getRevision(); + if (f != null) { + writer.writeMessage( + 2, + f, + google_protobuf_wrappers_pb.UInt64Value.serializeBinaryToWriter + ); + } + f = message.getProof(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.org.dash.platform.dapi.v0.Proof.serializeBinaryToWriter + ); + } + f = message.getMetadata(); + if (f != null) { + writer.writeMessage( + 4, + f, + proto.org.dash.platform.dapi.v0.ResponseMetadata.serializeBinaryToWriter + ); + } +}; + + +/** + * optional google.protobuf.UInt64Value balance = 1; + * @return {?proto.google.protobuf.UInt64Value} + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.prototype.getBalance = function() { + return /** @type{?proto.google.protobuf.UInt64Value} */ ( + jspb.Message.getWrapperField(this, google_protobuf_wrappers_pb.UInt64Value, 1)); +}; + + +/** + * @param {?proto.google.protobuf.UInt64Value|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.prototype.setBalance = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.prototype.clearBalance = function() { + return this.setBalance(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.prototype.hasBalance = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional google.protobuf.UInt64Value revision = 2; + * @return {?proto.google.protobuf.UInt64Value} + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.prototype.getRevision = function() { + return /** @type{?proto.google.protobuf.UInt64Value} */ ( + jspb.Message.getWrapperField(this, google_protobuf_wrappers_pb.UInt64Value, 2)); +}; + + +/** + * @param {?proto.google.protobuf.UInt64Value|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.prototype.setRevision = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.prototype.clearRevision = function() { + return this.setRevision(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.prototype.hasRevision = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional Proof proof = 3; + * @return {?proto.org.dash.platform.dapi.v0.Proof} + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.prototype.getProof = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.Proof} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.Proof, 3)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.Proof|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.prototype.setProof = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.prototype.clearProof = function() { + return this.setProof(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.prototype.hasProof = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional ResponseMetadata metadata = 4; + * @return {?proto.org.dash.platform.dapi.v0.ResponseMetadata} + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.prototype.getMetadata = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.ResponseMetadata, 4)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.ResponseMetadata|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.prototype.setMetadata = function(value) { + return jspb.Message.setWrapperField(this, 4, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.prototype.clearMetadata = function() { + return this.setMetadata(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.prototype.hasMetadata = function() { + return jspb.Message.getField(this, 4) != null; +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.org.dash.platform.dapi.v0.KeyRequestType.oneofGroups_ = [[1,2,3]]; + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.KeyRequestType.RequestCase = { + REQUEST_NOT_SET: 0, + ALL_KEYS: 1, + SPECIFIC_KEYS: 2, + SEARCH_KEY: 3 +}; + +/** + * @return {proto.org.dash.platform.dapi.v0.KeyRequestType.RequestCase} + */ +proto.org.dash.platform.dapi.v0.KeyRequestType.prototype.getRequestCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.KeyRequestType.RequestCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.KeyRequestType.oneofGroups_[0])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.KeyRequestType.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.KeyRequestType.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.KeyRequestType} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.KeyRequestType.toObject = function(includeInstance, msg) { + var f, obj = { + allKeys: (f = msg.getAllKeys()) && proto.org.dash.platform.dapi.v0.AllKeys.toObject(includeInstance, f), + specificKeys: (f = msg.getSpecificKeys()) && proto.org.dash.platform.dapi.v0.SpecificKeys.toObject(includeInstance, f), + searchKey: (f = msg.getSearchKey()) && proto.org.dash.platform.dapi.v0.SearchKey.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.KeyRequestType} + */ +proto.org.dash.platform.dapi.v0.KeyRequestType.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.KeyRequestType; + return proto.org.dash.platform.dapi.v0.KeyRequestType.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.KeyRequestType} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.KeyRequestType} + */ +proto.org.dash.platform.dapi.v0.KeyRequestType.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.org.dash.platform.dapi.v0.AllKeys; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.AllKeys.deserializeBinaryFromReader); + msg.setAllKeys(value); + break; + case 2: + var value = new proto.org.dash.platform.dapi.v0.SpecificKeys; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.SpecificKeys.deserializeBinaryFromReader); + msg.setSpecificKeys(value); + break; + case 3: + var value = new proto.org.dash.platform.dapi.v0.SearchKey; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.SearchKey.deserializeBinaryFromReader); + msg.setSearchKey(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.KeyRequestType.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.KeyRequestType.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.KeyRequestType} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.KeyRequestType.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getAllKeys(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.AllKeys.serializeBinaryToWriter + ); + } + f = message.getSpecificKeys(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.org.dash.platform.dapi.v0.SpecificKeys.serializeBinaryToWriter + ); + } + f = message.getSearchKey(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.org.dash.platform.dapi.v0.SearchKey.serializeBinaryToWriter + ); + } +}; + + +/** + * optional AllKeys all_keys = 1; + * @return {?proto.org.dash.platform.dapi.v0.AllKeys} + */ +proto.org.dash.platform.dapi.v0.KeyRequestType.prototype.getAllKeys = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.AllKeys} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.AllKeys, 1)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.AllKeys|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.KeyRequestType} returns this +*/ +proto.org.dash.platform.dapi.v0.KeyRequestType.prototype.setAllKeys = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.KeyRequestType.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.KeyRequestType} returns this + */ +proto.org.dash.platform.dapi.v0.KeyRequestType.prototype.clearAllKeys = function() { + return this.setAllKeys(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.KeyRequestType.prototype.hasAllKeys = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional SpecificKeys specific_keys = 2; + * @return {?proto.org.dash.platform.dapi.v0.SpecificKeys} + */ +proto.org.dash.platform.dapi.v0.KeyRequestType.prototype.getSpecificKeys = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.SpecificKeys} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.SpecificKeys, 2)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.SpecificKeys|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.KeyRequestType} returns this +*/ +proto.org.dash.platform.dapi.v0.KeyRequestType.prototype.setSpecificKeys = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.org.dash.platform.dapi.v0.KeyRequestType.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.KeyRequestType} returns this + */ +proto.org.dash.platform.dapi.v0.KeyRequestType.prototype.clearSpecificKeys = function() { + return this.setSpecificKeys(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.KeyRequestType.prototype.hasSpecificKeys = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional SearchKey search_key = 3; + * @return {?proto.org.dash.platform.dapi.v0.SearchKey} + */ +proto.org.dash.platform.dapi.v0.KeyRequestType.prototype.getSearchKey = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.SearchKey} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.SearchKey, 3)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.SearchKey|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.KeyRequestType} returns this +*/ +proto.org.dash.platform.dapi.v0.KeyRequestType.prototype.setSearchKey = function(value) { + return jspb.Message.setOneofWrapperField(this, 3, proto.org.dash.platform.dapi.v0.KeyRequestType.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.KeyRequestType} returns this + */ +proto.org.dash.platform.dapi.v0.KeyRequestType.prototype.clearSearchKey = function() { + return this.setSearchKey(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.KeyRequestType.prototype.hasSearchKey = function() { + return jspb.Message.getField(this, 3) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.AllKeys.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.AllKeys.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.AllKeys} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.AllKeys.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.AllKeys} + */ +proto.org.dash.platform.dapi.v0.AllKeys.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.AllKeys; + return proto.org.dash.platform.dapi.v0.AllKeys.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.AllKeys} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.AllKeys} + */ +proto.org.dash.platform.dapi.v0.AllKeys.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.AllKeys.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.AllKeys.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.AllKeys} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.AllKeys.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.org.dash.platform.dapi.v0.SpecificKeys.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.SpecificKeys.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.SpecificKeys.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.SpecificKeys} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SpecificKeys.toObject = function(includeInstance, msg) { + var f, obj = { + keyIdsList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.SpecificKeys} + */ +proto.org.dash.platform.dapi.v0.SpecificKeys.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.SpecificKeys; + return proto.org.dash.platform.dapi.v0.SpecificKeys.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.SpecificKeys} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.SpecificKeys} + */ +proto.org.dash.platform.dapi.v0.SpecificKeys.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedUint32() : [reader.readUint32()]); + for (var i = 0; i < values.length; i++) { + msg.addKeyIds(values[i]); + } + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.SpecificKeys.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.SpecificKeys.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.SpecificKeys} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SpecificKeys.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getKeyIdsList(); + if (f.length > 0) { + writer.writePackedUint32( + 1, + f + ); + } +}; + + +/** + * repeated uint32 key_ids = 1; + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.SpecificKeys.prototype.getKeyIdsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.org.dash.platform.dapi.v0.SpecificKeys} returns this + */ +proto.org.dash.platform.dapi.v0.SpecificKeys.prototype.setKeyIdsList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.SpecificKeys} returns this + */ +proto.org.dash.platform.dapi.v0.SpecificKeys.prototype.addKeyIds = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.SpecificKeys} returns this + */ +proto.org.dash.platform.dapi.v0.SpecificKeys.prototype.clearKeyIdsList = function() { + return this.setKeyIdsList([]); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.SearchKey.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.SearchKey.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.SearchKey} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SearchKey.toObject = function(includeInstance, msg) { + var f, obj = { + purposeMapMap: (f = msg.getPurposeMapMap()) ? f.toObject(includeInstance, proto.org.dash.platform.dapi.v0.SecurityLevelMap.toObject) : [] + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.SearchKey} + */ +proto.org.dash.platform.dapi.v0.SearchKey.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.SearchKey; + return proto.org.dash.platform.dapi.v0.SearchKey.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.SearchKey} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.SearchKey} + */ +proto.org.dash.platform.dapi.v0.SearchKey.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = msg.getPurposeMapMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readUint32, jspb.BinaryReader.prototype.readMessage, proto.org.dash.platform.dapi.v0.SecurityLevelMap.deserializeBinaryFromReader, 0, new proto.org.dash.platform.dapi.v0.SecurityLevelMap()); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.SearchKey.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.SearchKey.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.SearchKey} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SearchKey.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getPurposeMapMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(1, writer, jspb.BinaryWriter.prototype.writeUint32, jspb.BinaryWriter.prototype.writeMessage, proto.org.dash.platform.dapi.v0.SecurityLevelMap.serializeBinaryToWriter); + } +}; + + +/** + * map purpose_map = 1; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.org.dash.platform.dapi.v0.SearchKey.prototype.getPurposeMapMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 1, opt_noLazyCreate, + proto.org.dash.platform.dapi.v0.SecurityLevelMap)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.org.dash.platform.dapi.v0.SearchKey} returns this + */ +proto.org.dash.platform.dapi.v0.SearchKey.prototype.clearPurposeMapMap = function() { + this.getPurposeMapMap().clear(); + return this;}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.SecurityLevelMap.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.SecurityLevelMap.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.SecurityLevelMap} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SecurityLevelMap.toObject = function(includeInstance, msg) { + var f, obj = { + securityLevelMapMap: (f = msg.getSecurityLevelMapMap()) ? f.toObject(includeInstance, undefined) : [] + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.SecurityLevelMap} + */ +proto.org.dash.platform.dapi.v0.SecurityLevelMap.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.SecurityLevelMap; + return proto.org.dash.platform.dapi.v0.SecurityLevelMap.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.SecurityLevelMap} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.SecurityLevelMap} + */ +proto.org.dash.platform.dapi.v0.SecurityLevelMap.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = msg.getSecurityLevelMapMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readUint32, jspb.BinaryReader.prototype.readEnum, null, 0, 0); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.SecurityLevelMap.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.SecurityLevelMap.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.SecurityLevelMap} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SecurityLevelMap.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSecurityLevelMapMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(1, writer, jspb.BinaryWriter.prototype.writeUint32, jspb.BinaryWriter.prototype.writeEnum); + } +}; + + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.SecurityLevelMap.KeyKindRequestType = { + CURRENT_KEY_OF_KIND_REQUEST: 0, + ALL_KEYS_OF_KIND_REQUEST: 1 +}; + +/** + * map security_level_map = 1; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.org.dash.platform.dapi.v0.SecurityLevelMap.prototype.getSecurityLevelMapMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 1, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.org.dash.platform.dapi.v0.SecurityLevelMap} returns this + */ +proto.org.dash.platform.dapi.v0.SecurityLevelMap.prototype.clearSecurityLevelMapMap = function() { + this.getSecurityLevelMapMap().clear(); + return this;}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.toObject = function(includeInstance, msg) { + var f, obj = { + identityId: msg.getIdentityId_asB64(), + requestType: (f = msg.getRequestType()) && proto.org.dash.platform.dapi.v0.KeyRequestType.toObject(includeInstance, f), + limit: (f = msg.getLimit()) && google_protobuf_wrappers_pb.UInt32Value.toObject(includeInstance, f), + offset: (f = msg.getOffset()) && google_protobuf_wrappers_pb.UInt32Value.toObject(includeInstance, f), + prove: jspb.Message.getBooleanFieldWithDefault(msg, 5, false) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest; + return proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setIdentityId(value); + break; + case 2: + var value = new proto.org.dash.platform.dapi.v0.KeyRequestType; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.KeyRequestType.deserializeBinaryFromReader); + msg.setRequestType(value); + break; + case 3: + var value = new google_protobuf_wrappers_pb.UInt32Value; + reader.readMessage(value,google_protobuf_wrappers_pb.UInt32Value.deserializeBinaryFromReader); + msg.setLimit(value); + break; + case 4: + var value = new google_protobuf_wrappers_pb.UInt32Value; + reader.readMessage(value,google_protobuf_wrappers_pb.UInt32Value.deserializeBinaryFromReader); + msg.setOffset(value); + break; + case 5: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setProve(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getIdentityId_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getRequestType(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.org.dash.platform.dapi.v0.KeyRequestType.serializeBinaryToWriter + ); + } + f = message.getLimit(); + if (f != null) { + writer.writeMessage( + 3, + f, + google_protobuf_wrappers_pb.UInt32Value.serializeBinaryToWriter + ); + } + f = message.getOffset(); + if (f != null) { + writer.writeMessage( + 4, + f, + google_protobuf_wrappers_pb.UInt32Value.serializeBinaryToWriter + ); + } + f = message.getProve(); + if (f) { + writer.writeBool( + 5, + f + ); + } +}; + + +/** + * optional bytes identity_id = 1; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.prototype.getIdentityId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes identity_id = 1; + * This is a type-conversion wrapper around `getIdentityId()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.prototype.getIdentityId_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getIdentityId())); +}; + + +/** + * optional bytes identity_id = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getIdentityId()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.prototype.getIdentityId_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getIdentityId())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.prototype.setIdentityId = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional KeyRequestType request_type = 2; + * @return {?proto.org.dash.platform.dapi.v0.KeyRequestType} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.prototype.getRequestType = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.KeyRequestType} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.KeyRequestType, 2)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.KeyRequestType|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest} returns this +*/ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.prototype.setRequestType = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.prototype.clearRequestType = function() { + return this.setRequestType(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.prototype.hasRequestType = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional google.protobuf.UInt32Value limit = 3; + * @return {?proto.google.protobuf.UInt32Value} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.prototype.getLimit = function() { + return /** @type{?proto.google.protobuf.UInt32Value} */ ( + jspb.Message.getWrapperField(this, google_protobuf_wrappers_pb.UInt32Value, 3)); +}; + + +/** + * @param {?proto.google.protobuf.UInt32Value|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest} returns this +*/ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.prototype.setLimit = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.prototype.clearLimit = function() { + return this.setLimit(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.prototype.hasLimit = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional google.protobuf.UInt32Value offset = 4; + * @return {?proto.google.protobuf.UInt32Value} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.prototype.getOffset = function() { + return /** @type{?proto.google.protobuf.UInt32Value} */ ( + jspb.Message.getWrapperField(this, google_protobuf_wrappers_pb.UInt32Value, 4)); +}; + + +/** + * @param {?proto.google.protobuf.UInt32Value|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest} returns this +*/ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.prototype.setOffset = function(value) { + return jspb.Message.setWrapperField(this, 4, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.prototype.clearOffset = function() { + return this.setOffset(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.prototype.hasOffset = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * optional bool prove = 5; + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.prototype.getProve = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 5, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.prototype.setProve = function(value) { + return jspb.Message.setProto3BooleanField(this, 5, value); +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.oneofGroups_ = [[1,2]]; + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.ResultCase = { + RESULT_NOT_SET: 0, + KEYS: 1, + PROOF: 2 +}; + +/** + * @return {proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.ResultCase} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.prototype.getResultCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.ResultCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.oneofGroups_[0])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.toObject = function(includeInstance, msg) { + var f, obj = { + keys: (f = msg.getKeys()) && proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.toObject(includeInstance, f), + proof: (f = msg.getProof()) && proto.org.dash.platform.dapi.v0.Proof.toObject(includeInstance, f), + metadata: (f = msg.getMetadata()) && proto.org.dash.platform.dapi.v0.ResponseMetadata.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse; + return proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.deserializeBinaryFromReader); + msg.setKeys(value); + break; + case 2: + var value = new proto.org.dash.platform.dapi.v0.Proof; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.Proof.deserializeBinaryFromReader); + msg.setProof(value); + break; + case 3: + var value = new proto.org.dash.platform.dapi.v0.ResponseMetadata; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.ResponseMetadata.deserializeBinaryFromReader); + msg.setMetadata(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getKeys(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.serializeBinaryToWriter + ); + } + f = message.getProof(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.org.dash.platform.dapi.v0.Proof.serializeBinaryToWriter + ); + } + f = message.getMetadata(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.org.dash.platform.dapi.v0.ResponseMetadata.serializeBinaryToWriter + ); + } +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.toObject = function(includeInstance, msg) { + var f, obj = { + keysBytesList: msg.getKeysBytesList_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys; + return proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.addKeysBytes(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getKeysBytesList_asU8(); + if (f.length > 0) { + writer.writeRepeatedBytes( + 1, + f + ); + } +}; + + +/** + * repeated bytes keys_bytes = 1; + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.prototype.getKeysBytesList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * repeated bytes keys_bytes = 1; + * This is a type-conversion wrapper around `getKeysBytesList()` + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.prototype.getKeysBytesList_asB64 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsB64( + this.getKeysBytesList())); +}; + + +/** + * repeated bytes keys_bytes = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getKeysBytesList()` + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.prototype.getKeysBytesList_asU8 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsU8( + this.getKeysBytesList())); +}; + + +/** + * @param {!(Array|Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.prototype.setKeysBytesList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.prototype.addKeysBytes = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.prototype.clearKeysBytesList = function() { + return this.setKeysBytesList([]); +}; + + +/** + * optional Keys keys = 1; + * @return {?proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.prototype.getKeys = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys, 1)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.prototype.setKeys = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.prototype.clearKeys = function() { + return this.setKeys(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.prototype.hasKeys = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional Proof proof = 2; + * @return {?proto.org.dash.platform.dapi.v0.Proof} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.prototype.getProof = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.Proof} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.Proof, 2)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.Proof|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.prototype.setProof = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.prototype.clearProof = function() { + return this.setProof(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.prototype.hasProof = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional ResponseMetadata metadata = 3; + * @return {?proto.org.dash.platform.dapi.v0.ResponseMetadata} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.prototype.getMetadata = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.ResponseMetadata, 3)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.ResponseMetadata|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.prototype.setMetadata = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.prototype.clearMetadata = function() { + return this.setMetadata(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.prototype.hasMetadata = function() { + return jspb.Message.getField(this, 3) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.toObject = function(includeInstance, msg) { + var f, obj = { + identityIdsList: msg.getIdentityIdsList_asB64(), + requestType: (f = msg.getRequestType()) && proto.org.dash.platform.dapi.v0.KeyRequestType.toObject(includeInstance, f), + limit: (f = msg.getLimit()) && google_protobuf_wrappers_pb.UInt32Value.toObject(includeInstance, f), + offset: (f = msg.getOffset()) && google_protobuf_wrappers_pb.UInt32Value.toObject(includeInstance, f), + prove: jspb.Message.getBooleanFieldWithDefault(msg, 5, false) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest; + return proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.addIdentityIds(value); + break; + case 2: + var value = new proto.org.dash.platform.dapi.v0.KeyRequestType; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.KeyRequestType.deserializeBinaryFromReader); + msg.setRequestType(value); + break; + case 3: + var value = new google_protobuf_wrappers_pb.UInt32Value; + reader.readMessage(value,google_protobuf_wrappers_pb.UInt32Value.deserializeBinaryFromReader); + msg.setLimit(value); + break; + case 4: + var value = new google_protobuf_wrappers_pb.UInt32Value; + reader.readMessage(value,google_protobuf_wrappers_pb.UInt32Value.deserializeBinaryFromReader); + msg.setOffset(value); + break; + case 5: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setProve(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getIdentityIdsList_asU8(); + if (f.length > 0) { + writer.writeRepeatedBytes( + 1, + f + ); + } + f = message.getRequestType(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.org.dash.platform.dapi.v0.KeyRequestType.serializeBinaryToWriter + ); + } + f = message.getLimit(); + if (f != null) { + writer.writeMessage( + 3, + f, + google_protobuf_wrappers_pb.UInt32Value.serializeBinaryToWriter + ); + } + f = message.getOffset(); + if (f != null) { + writer.writeMessage( + 4, + f, + google_protobuf_wrappers_pb.UInt32Value.serializeBinaryToWriter + ); + } + f = message.getProve(); + if (f) { + writer.writeBool( + 5, + f + ); + } +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap.toObject = function(includeInstance, msg) { + var f, obj = { + securityLevelMapMap: (f = msg.getSecurityLevelMapMap()) ? f.toObject(includeInstance, undefined) : [] + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap; + return proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = msg.getSecurityLevelMapMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readUint32, jspb.BinaryReader.prototype.readEnum, null, 0, 0); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSecurityLevelMapMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(1, writer, jspb.BinaryWriter.prototype.writeUint32, jspb.BinaryWriter.prototype.writeEnum); + } +}; + + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap.KeyKindRequestType = { + CURRENT_KEY_OF_KIND_REQUEST: 0 +}; + +/** + * map security_level_map = 1; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap.prototype.getSecurityLevelMapMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 1, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap.prototype.clearSecurityLevelMapMap = function() { + this.getSecurityLevelMapMap().clear(); + return this;}; + + +/** + * repeated bytes identity_ids = 1; + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.prototype.getIdentityIdsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * repeated bytes identity_ids = 1; + * This is a type-conversion wrapper around `getIdentityIdsList()` + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.prototype.getIdentityIdsList_asB64 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsB64( + this.getIdentityIdsList())); +}; + + +/** + * repeated bytes identity_ids = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getIdentityIdsList()` + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.prototype.getIdentityIdsList_asU8 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsU8( + this.getIdentityIdsList())); +}; + + +/** + * @param {!(Array|Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.prototype.setIdentityIdsList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.prototype.addIdentityIds = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.prototype.clearIdentityIdsList = function() { + return this.setIdentityIdsList([]); +}; + + +/** + * optional KeyRequestType request_type = 2; + * @return {?proto.org.dash.platform.dapi.v0.KeyRequestType} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.prototype.getRequestType = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.KeyRequestType} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.KeyRequestType, 2)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.KeyRequestType|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest} returns this +*/ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.prototype.setRequestType = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.prototype.clearRequestType = function() { + return this.setRequestType(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.prototype.hasRequestType = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional google.protobuf.UInt32Value limit = 3; + * @return {?proto.google.protobuf.UInt32Value} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.prototype.getLimit = function() { + return /** @type{?proto.google.protobuf.UInt32Value} */ ( + jspb.Message.getWrapperField(this, google_protobuf_wrappers_pb.UInt32Value, 3)); +}; + + +/** + * @param {?proto.google.protobuf.UInt32Value|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest} returns this +*/ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.prototype.setLimit = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.prototype.clearLimit = function() { + return this.setLimit(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.prototype.hasLimit = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional google.protobuf.UInt32Value offset = 4; + * @return {?proto.google.protobuf.UInt32Value} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.prototype.getOffset = function() { + return /** @type{?proto.google.protobuf.UInt32Value} */ ( + jspb.Message.getWrapperField(this, google_protobuf_wrappers_pb.UInt32Value, 4)); +}; + + +/** + * @param {?proto.google.protobuf.UInt32Value|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest} returns this +*/ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.prototype.setOffset = function(value) { + return jspb.Message.setWrapperField(this, 4, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.prototype.clearOffset = function() { + return this.setOffset(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.prototype.hasOffset = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * optional bool prove = 5; + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.prototype.getProve = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 5, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.prototype.setProve = function(value) { + return jspb.Message.setProto3BooleanField(this, 5, value); +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.oneofGroups_ = [[1,2]]; + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.ResultCase = { + RESULT_NOT_SET: 0, + PUBLIC_KEYS: 1, + PROOF: 2 +}; + +/** + * @return {proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.ResultCase} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.prototype.getResultCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.ResultCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.oneofGroups_[0])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.toObject = function(includeInstance, msg) { + var f, obj = { + publicKeys: (f = msg.getPublicKeys()) && proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.toObject(includeInstance, f), + proof: (f = msg.getProof()) && proto.org.dash.platform.dapi.v0.Proof.toObject(includeInstance, f), + metadata: (f = msg.getMetadata()) && proto.org.dash.platform.dapi.v0.ResponseMetadata.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse; + return proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.deserializeBinaryFromReader); + msg.setPublicKeys(value); + break; + case 2: + var value = new proto.org.dash.platform.dapi.v0.Proof; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.Proof.deserializeBinaryFromReader); + msg.setProof(value); + break; + case 3: + var value = new proto.org.dash.platform.dapi.v0.ResponseMetadata; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.ResponseMetadata.deserializeBinaryFromReader); + msg.setMetadata(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getPublicKeys(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.serializeBinaryToWriter + ); + } + f = message.getProof(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.org.dash.platform.dapi.v0.Proof.serializeBinaryToWriter + ); + } + f = message.getMetadata(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.org.dash.platform.dapi.v0.ResponseMetadata.serializeBinaryToWriter + ); + } +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey.toObject = function(includeInstance, msg) { + var f, obj = { + value: msg.getValue_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey; + return proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setValue(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getValue_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } +}; + + +/** + * optional bytes value = 1; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey.prototype.getValue = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes value = 1; + * This is a type-conversion wrapper around `getValue()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey.prototype.getValue_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getValue())); +}; + + +/** + * optional bytes value = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getValue()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey.prototype.getValue_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getValue())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey.prototype.setValue = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.toObject = function(includeInstance, msg) { + var f, obj = { + key: msg.getKey_asB64(), + value: (f = msg.getValue()) && proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry; + return proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setKey(value); + break; + case 2: + var value = new proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey.deserializeBinaryFromReader); + msg.setValue(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getKey_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getValue(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey.serializeBinaryToWriter + ); + } +}; + + +/** + * optional bytes key = 1; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.prototype.getKey = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes key = 1; + * This is a type-conversion wrapper around `getKey()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.prototype.getKey_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getKey())); +}; + + +/** + * optional bytes key = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getKey()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.prototype.getKey_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getKey())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.prototype.setKey = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional PublicKey value = 2; + * @return {?proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.prototype.getValue = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey, 2)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry} returns this +*/ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.prototype.setValue = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.prototype.clearValue = function() { + return this.setValue(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.prototype.hasValue = function() { + return jspb.Message.getField(this, 2) != null; +}; + /** - * optional bytes merkle_proof = 1; - * @return {string} + * List of repeated fields within this message type. + * @private {!Array} + * @const */ -proto.org.dash.platform.dapi.v0.Proof.prototype.getMerkleProof = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.toObject(opt_includeInstance, this); }; /** - * optional bytes merkle_proof = 1; - * This is a type-conversion wrapper around `getMerkleProof()` - * @return {string} + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.Proof.prototype.getMerkleProof_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getMerkleProof())); +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.toObject = function(includeInstance, msg) { + var f, obj = { + publicKeyEntriesList: jspb.Message.toObjectList(msg.getPublicKeyEntriesList(), + proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; }; +} /** - * optional bytes merkle_proof = 1; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getMerkleProof()` + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries; + return proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.deserializeBinaryFromReader); + msg.addPublicKeyEntries(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.Proof.prototype.getMerkleProof_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getMerkleProof())); +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); }; /** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.Proof} returns this + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.Proof.prototype.setMerkleProof = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getPublicKeyEntriesList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.serializeBinaryToWriter + ); + } }; /** - * optional bytes quorum_hash = 2; - * @return {string} + * repeated PublicKeyEntry public_key_entries = 1; + * @return {!Array} */ -proto.org.dash.platform.dapi.v0.Proof.prototype.getQuorumHash = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.prototype.getPublicKeyEntriesList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry, 1)); }; /** - * optional bytes quorum_hash = 2; - * This is a type-conversion wrapper around `getQuorumHash()` - * @return {string} + * @param {!Array} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries} returns this +*/ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.prototype.setPublicKeyEntriesList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry=} opt_value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.prototype.addPublicKeyEntries = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.prototype.clearPublicKeyEntriesList = function() { + return this.setPublicKeyEntriesList([]); +}; + + +/** + * optional PublicKeyEntries public_keys = 1; + * @return {?proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.prototype.getPublicKeys = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries, 1)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.prototype.setPublicKeys = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.prototype.clearPublicKeys = function() { + return this.setPublicKeys(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.prototype.hasPublicKeys = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional Proof proof = 2; + * @return {?proto.org.dash.platform.dapi.v0.Proof} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.prototype.getProof = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.Proof} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.Proof, 2)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.Proof|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.prototype.setProof = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.prototype.clearProof = function() { + return this.setProof(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.prototype.hasProof = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional ResponseMetadata metadata = 3; + * @return {?proto.org.dash.platform.dapi.v0.ResponseMetadata} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.prototype.getMetadata = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.ResponseMetadata, 3)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.ResponseMetadata|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.prototype.setMetadata = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.prototype.clearMetadata = function() { + return this.setMetadata(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.prototype.hasMetadata = function() { + return jspb.Message.getField(this, 3) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetDataContractRequest.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetDataContractRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetDataContractRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetDataContractRequest.toObject = function(includeInstance, msg) { + var f, obj = { + id: msg.getId_asB64(), + prove: jspb.Message.getBooleanFieldWithDefault(msg, 2, false) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractRequest} + */ +proto.org.dash.platform.dapi.v0.GetDataContractRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetDataContractRequest; + return proto.org.dash.platform.dapi.v0.GetDataContractRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetDataContractRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractRequest} */ -proto.org.dash.platform.dapi.v0.Proof.prototype.getQuorumHash_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getQuorumHash())); +proto.org.dash.platform.dapi.v0.GetDataContractRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setId(value); + break; + case 2: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setProve(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; }; /** - * optional bytes quorum_hash = 2; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getQuorumHash()` + * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.Proof.prototype.getQuorumHash_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getQuorumHash())); +proto.org.dash.platform.dapi.v0.GetDataContractRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetDataContractRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); }; /** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.Proof} returns this + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetDataContractRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.Proof.prototype.setQuorumHash = function(value) { - return jspb.Message.setProto3BytesField(this, 2, value); +proto.org.dash.platform.dapi.v0.GetDataContractRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getProve(); + if (f) { + writer.writeBool( + 2, + f + ); + } }; /** - * optional bytes signature = 3; + * optional bytes id = 1; * @return {string} */ -proto.org.dash.platform.dapi.v0.Proof.prototype.getSignature = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +proto.org.dash.platform.dapi.v0.GetDataContractRequest.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** - * optional bytes signature = 3; - * This is a type-conversion wrapper around `getSignature()` + * optional bytes id = 1; + * This is a type-conversion wrapper around `getId()` * @return {string} */ -proto.org.dash.platform.dapi.v0.Proof.prototype.getSignature_asB64 = function() { +proto.org.dash.platform.dapi.v0.GetDataContractRequest.prototype.getId_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getSignature())); + this.getId())); }; /** - * optional bytes signature = 3; + * optional bytes id = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getSignature()` + * This is a type-conversion wrapper around `getId()` * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.Proof.prototype.getSignature_asU8 = function() { +proto.org.dash.platform.dapi.v0.GetDataContractRequest.prototype.getId_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getSignature())); + this.getId())); }; /** * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.Proof} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractRequest} returns this */ -proto.org.dash.platform.dapi.v0.Proof.prototype.setSignature = function(value) { - return jspb.Message.setProto3BytesField(this, 3, value); +proto.org.dash.platform.dapi.v0.GetDataContractRequest.prototype.setId = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); }; /** - * optional uint32 round = 4; - * @return {number} + * optional bool prove = 2; + * @return {boolean} */ -proto.org.dash.platform.dapi.v0.Proof.prototype.getRound = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +proto.org.dash.platform.dapi.v0.GetDataContractRequest.prototype.getProve = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); }; /** - * @param {number} value - * @return {!proto.org.dash.platform.dapi.v0.Proof} returns this + * @param {boolean} value + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractRequest} returns this */ -proto.org.dash.platform.dapi.v0.Proof.prototype.setRound = function(value) { - return jspb.Message.setProto3IntField(this, 4, value); +proto.org.dash.platform.dapi.v0.GetDataContractRequest.prototype.setProve = function(value) { + return jspb.Message.setProto3BooleanField(this, 2, value); }; @@ -745,8 +6042,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.ResponseMetadata.toObject(opt_includeInstance, this); +proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetDataContractResponse.toObject(opt_includeInstance, this); }; @@ -755,16 +6052,15 @@ proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.toObject = function(o * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.ResponseMetadata} msg The msg instance to transform. + * @param {!proto.org.dash.platform.dapi.v0.GetDataContractResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.ResponseMetadata.toObject = function(includeInstance, msg) { +proto.org.dash.platform.dapi.v0.GetDataContractResponse.toObject = function(includeInstance, msg) { var f, obj = { - height: jspb.Message.getFieldWithDefault(msg, 1, 0), - coreChainLockedHeight: jspb.Message.getFieldWithDefault(msg, 2, 0), - timeMs: jspb.Message.getFieldWithDefault(msg, 3, 0), - protocolVersion: jspb.Message.getFieldWithDefault(msg, 4, 0) + dataContract: msg.getDataContract_asB64(), + proof: (f = msg.getProof()) && proto.org.dash.platform.dapi.v0.Proof.toObject(includeInstance, f), + metadata: (f = msg.getMetadata()) && proto.org.dash.platform.dapi.v0.ResponseMetadata.toObject(includeInstance, f) }; if (includeInstance) { @@ -778,23 +6074,23 @@ proto.org.dash.platform.dapi.v0.ResponseMetadata.toObject = function(includeInst /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.ResponseMetadata} + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractResponse} */ -proto.org.dash.platform.dapi.v0.ResponseMetadata.deserializeBinary = function(bytes) { +proto.org.dash.platform.dapi.v0.GetDataContractResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.ResponseMetadata; - return proto.org.dash.platform.dapi.v0.ResponseMetadata.deserializeBinaryFromReader(msg, reader); + var msg = new proto.org.dash.platform.dapi.v0.GetDataContractResponse; + return proto.org.dash.platform.dapi.v0.GetDataContractResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.ResponseMetadata} msg The message object to deserialize into. + * @param {!proto.org.dash.platform.dapi.v0.GetDataContractResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.ResponseMetadata} + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractResponse} */ -proto.org.dash.platform.dapi.v0.ResponseMetadata.deserializeBinaryFromReader = function(msg, reader) { +proto.org.dash.platform.dapi.v0.GetDataContractResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -802,20 +6098,18 @@ proto.org.dash.platform.dapi.v0.ResponseMetadata.deserializeBinaryFromReader = f var field = reader.getFieldNumber(); switch (field) { case 1: - var value = /** @type {number} */ (reader.readInt64()); - msg.setHeight(value); + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setDataContract(value); break; case 2: - var value = /** @type {number} */ (reader.readUint32()); - msg.setCoreChainLockedHeight(value); + var value = new proto.org.dash.platform.dapi.v0.Proof; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.Proof.deserializeBinaryFromReader); + msg.setProof(value); break; case 3: - var value = /** @type {number} */ (reader.readUint64()); - msg.setTimeMs(value); - break; - case 4: - var value = /** @type {number} */ (reader.readUint32()); - msg.setProtocolVersion(value); + var value = new proto.org.dash.platform.dapi.v0.ResponseMetadata; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.ResponseMetadata.deserializeBinaryFromReader); + msg.setMetadata(value); break; default: reader.skipField(); @@ -830,9 +6124,9 @@ proto.org.dash.platform.dapi.v0.ResponseMetadata.deserializeBinaryFromReader = f * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.serializeBinary = function() { +proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.ResponseMetadata.serializeBinaryToWriter(this, writer); + proto.org.dash.platform.dapi.v0.GetDataContractResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -840,116 +6134,162 @@ proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.serializeBinary = fun /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.ResponseMetadata} message + * @param {!proto.org.dash.platform.dapi.v0.GetDataContractResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.ResponseMetadata.serializeBinaryToWriter = function(message, writer) { +proto.org.dash.platform.dapi.v0.GetDataContractResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getHeight(); - if (f !== 0) { - writer.writeInt64( + f = message.getDataContract_asU8(); + if (f.length > 0) { + writer.writeBytes( 1, f ); } - f = message.getCoreChainLockedHeight(); - if (f !== 0) { - writer.writeUint32( + f = message.getProof(); + if (f != null) { + writer.writeMessage( 2, - f + f, + proto.org.dash.platform.dapi.v0.Proof.serializeBinaryToWriter ); } - f = message.getTimeMs(); - if (f !== 0) { - writer.writeUint64( + f = message.getMetadata(); + if (f != null) { + writer.writeMessage( 3, - f - ); - } - f = message.getProtocolVersion(); - if (f !== 0) { - writer.writeUint32( - 4, - f + f, + proto.org.dash.platform.dapi.v0.ResponseMetadata.serializeBinaryToWriter ); } }; /** - * optional int64 height = 1; - * @return {number} + * optional bytes data_contract = 1; + * @return {string} */ -proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.getHeight = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.getDataContract = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** - * @param {number} value - * @return {!proto.org.dash.platform.dapi.v0.ResponseMetadata} returns this + * optional bytes data_contract = 1; + * This is a type-conversion wrapper around `getDataContract()` + * @return {string} */ -proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.setHeight = function(value) { - return jspb.Message.setProto3IntField(this, 1, value); +proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.getDataContract_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getDataContract())); +}; + + +/** + * optional bytes data_contract = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getDataContract()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.getDataContract_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getDataContract())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractResponse} returns this + */ +proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.setDataContract = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional Proof proof = 2; + * @return {?proto.org.dash.platform.dapi.v0.Proof} + */ +proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.getProof = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.Proof} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.Proof, 2)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.Proof|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.setProof = function(value) { + return jspb.Message.setWrapperField(this, 2, value); }; /** - * optional uint32 core_chain_locked_height = 2; - * @return {number} + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractResponse} returns this */ -proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.getCoreChainLockedHeight = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.clearProof = function() { + return this.setProof(undefined); }; /** - * @param {number} value - * @return {!proto.org.dash.platform.dapi.v0.ResponseMetadata} returns this + * Returns whether this field is set. + * @return {boolean} */ -proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.setCoreChainLockedHeight = function(value) { - return jspb.Message.setProto3IntField(this, 2, value); +proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.hasProof = function() { + return jspb.Message.getField(this, 2) != null; }; /** - * optional uint64 time_ms = 3; - * @return {number} + * optional ResponseMetadata metadata = 3; + * @return {?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ -proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.getTimeMs = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.getMetadata = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.ResponseMetadata, 3)); }; /** - * @param {number} value - * @return {!proto.org.dash.platform.dapi.v0.ResponseMetadata} returns this - */ -proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.setTimeMs = function(value) { - return jspb.Message.setProto3IntField(this, 3, value); + * @param {?proto.org.dash.platform.dapi.v0.ResponseMetadata|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.setMetadata = function(value) { + return jspb.Message.setWrapperField(this, 3, value); }; /** - * optional uint32 protocol_version = 4; - * @return {number} + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractResponse} returns this */ -proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.getProtocolVersion = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.clearMetadata = function() { + return this.setMetadata(undefined); }; /** - * @param {number} value - * @return {!proto.org.dash.platform.dapi.v0.ResponseMetadata} returns this + * Returns whether this field is set. + * @return {boolean} */ -proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.setProtocolVersion = function(value) { - return jspb.Message.setProto3IntField(this, 4, value); +proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.hasMetadata = function() { + return jspb.Message.getField(this, 3) != null; }; +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.org.dash.platform.dapi.v0.GetDataContractsRequest.repeatedFields_ = [1]; + if (jspb.Message.GENERATE_TO_OBJECT) { @@ -965,8 +6305,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.toObject(opt_includeInstance, this); +proto.org.dash.platform.dapi.v0.GetDataContractsRequest.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetDataContractsRequest.toObject(opt_includeInstance, this); }; @@ -975,15 +6315,14 @@ proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.prototype.toObject * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError} msg The msg instance to transform. + * @param {!proto.org.dash.platform.dapi.v0.GetDataContractsRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.toObject = function(includeInstance, msg) { +proto.org.dash.platform.dapi.v0.GetDataContractsRequest.toObject = function(includeInstance, msg) { var f, obj = { - code: jspb.Message.getFieldWithDefault(msg, 1, 0), - message: jspb.Message.getFieldWithDefault(msg, 2, ""), - data: msg.getData_asB64() + idsList: msg.getIdsList_asB64(), + prove: jspb.Message.getBooleanFieldWithDefault(msg, 2, false) }; if (includeInstance) { @@ -997,23 +6336,23 @@ proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.toObject = functio /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError} + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsRequest} */ -proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.deserializeBinary = function(bytes) { +proto.org.dash.platform.dapi.v0.GetDataContractsRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError; - return proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.deserializeBinaryFromReader(msg, reader); + var msg = new proto.org.dash.platform.dapi.v0.GetDataContractsRequest; + return proto.org.dash.platform.dapi.v0.GetDataContractsRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError} msg The message object to deserialize into. + * @param {!proto.org.dash.platform.dapi.v0.GetDataContractsRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError} + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsRequest} */ -proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.deserializeBinaryFromReader = function(msg, reader) { +proto.org.dash.platform.dapi.v0.GetDataContractsRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -1021,16 +6360,12 @@ proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.deserializeBinaryF var field = reader.getFieldNumber(); switch (field) { case 1: - var value = /** @type {number} */ (reader.readUint32()); - msg.setCode(value); + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.addIds(value); break; case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setMessage(value); - break; - case 3: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setData(value); + var value = /** @type {boolean} */ (reader.readBool()); + msg.setProve(value); break; default: reader.skipField(); @@ -1045,9 +6380,9 @@ proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.deserializeBinaryF * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.prototype.serializeBinary = function() { +proto.org.dash.platform.dapi.v0.GetDataContractsRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.serializeBinaryToWriter(this, writer); + proto.org.dash.platform.dapi.v0.GetDataContractsRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -1055,115 +6390,135 @@ proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.prototype.serializ /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError} message + * @param {!proto.org.dash.platform.dapi.v0.GetDataContractsRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.serializeBinaryToWriter = function(message, writer) { +proto.org.dash.platform.dapi.v0.GetDataContractsRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getCode(); - if (f !== 0) { - writer.writeUint32( + f = message.getIdsList_asU8(); + if (f.length > 0) { + writer.writeRepeatedBytes( 1, f ); } - f = message.getMessage(); - if (f.length > 0) { - writer.writeString( + f = message.getProve(); + if (f) { + writer.writeBool( 2, f ); } - f = message.getData_asU8(); - if (f.length > 0) { - writer.writeBytes( - 3, - f - ); - } }; /** - * optional uint32 code = 1; - * @return {number} + * repeated bytes ids = 1; + * @return {!Array} */ -proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.prototype.getCode = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +proto.org.dash.platform.dapi.v0.GetDataContractsRequest.prototype.getIdsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); }; /** - * @param {number} value - * @return {!proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError} returns this + * repeated bytes ids = 1; + * This is a type-conversion wrapper around `getIdsList()` + * @return {!Array} */ -proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.prototype.setCode = function(value) { - return jspb.Message.setProto3IntField(this, 1, value); +proto.org.dash.platform.dapi.v0.GetDataContractsRequest.prototype.getIdsList_asB64 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsB64( + this.getIdsList())); }; /** - * optional string message = 2; - * @return {string} + * repeated bytes ids = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getIdsList()` + * @return {!Array} */ -proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.prototype.getMessage = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +proto.org.dash.platform.dapi.v0.GetDataContractsRequest.prototype.getIdsList_asU8 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsU8( + this.getIdsList())); }; /** - * @param {string} value - * @return {!proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError} returns this + * @param {!(Array|Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsRequest} returns this */ -proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.prototype.setMessage = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); +proto.org.dash.platform.dapi.v0.GetDataContractsRequest.prototype.setIdsList = function(value) { + return jspb.Message.setField(this, 1, value || []); }; /** - * optional bytes data = 3; - * @return {string} + * @param {!(string|Uint8Array)} value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsRequest} returns this */ -proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.prototype.getData = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +proto.org.dash.platform.dapi.v0.GetDataContractsRequest.prototype.addIds = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); }; /** - * optional bytes data = 3; - * This is a type-conversion wrapper around `getData()` - * @return {string} + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsRequest} returns this */ -proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.prototype.getData_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getData())); +proto.org.dash.platform.dapi.v0.GetDataContractsRequest.prototype.clearIdsList = function() { + return this.setIdsList([]); }; /** - * optional bytes data = 3; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getData()` - * @return {!Uint8Array} + * optional bool prove = 2; + * @return {boolean} */ -proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.prototype.getData_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getData())); +proto.org.dash.platform.dapi.v0.GetDataContractsRequest.prototype.getProve = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); }; /** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError} returns this + * @param {boolean} value + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsRequest} returns this */ -proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.prototype.setData = function(value) { - return jspb.Message.setProto3BytesField(this, 3, value); +proto.org.dash.platform.dapi.v0.GetDataContractsRequest.prototype.setProve = function(value) { + return jspb.Message.setProto3BooleanField(this, 2, value); }; +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.oneofGroups_ = [[1,2]]; + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.ResultCase = { + RESULT_NOT_SET: 0, + DATA_CONTRACTS: 1, + PROOF: 2 +}; + +/** + * @return {proto.org.dash.platform.dapi.v0.GetDataContractsResponse.ResultCase} + */ +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.prototype.getResultCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetDataContractsResponse.ResultCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetDataContractsResponse.oneofGroups_[0])); +}; + if (jspb.Message.GENERATE_TO_OBJECT) { @@ -1179,8 +6534,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.toObject(opt_includeInstance, this); +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetDataContractsResponse.toObject(opt_includeInstance, this); }; @@ -1189,13 +6544,15 @@ proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.prototype.toObje * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} msg The msg instance to transform. + * @param {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.toObject = function(includeInstance, msg) { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.toObject = function(includeInstance, msg) { var f, obj = { - stateTransition: msg.getStateTransition_asB64() + dataContracts: (f = msg.getDataContracts()) && proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.toObject(includeInstance, f), + proof: (f = msg.getProof()) && proto.org.dash.platform.dapi.v0.Proof.toObject(includeInstance, f), + metadata: (f = msg.getMetadata()) && proto.org.dash.platform.dapi.v0.ResponseMetadata.toObject(includeInstance, f) }; if (includeInstance) { @@ -1209,111 +6566,97 @@ proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.toObject = funct /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse} */ -proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.deserializeBinary = function(bytes) { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest; - return proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.org.dash.platform.dapi.v0.GetDataContractsResponse; + return proto.org.dash.platform.dapi.v0.GetDataContractsResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} msg The message object to deserialize into. + * @param {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse} */ -proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setStateTransition(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getStateTransition_asU8(); - if (f.length > 0) { - writer.writeBytes( - 1, - f - ); - } -}; - - -/** - * optional bytes state_transition = 1; - * @return {string} - */ -proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.prototype.getStateTransition = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * optional bytes state_transition = 1; - * This is a type-conversion wrapper around `getStateTransition()` - * @return {string} - */ -proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.prototype.getStateTransition_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getStateTransition())); + switch (field) { + case 1: + var value = new proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.deserializeBinaryFromReader); + msg.setDataContracts(value); + break; + case 2: + var value = new proto.org.dash.platform.dapi.v0.Proof; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.Proof.deserializeBinaryFromReader); + msg.setProof(value); + break; + case 3: + var value = new proto.org.dash.platform.dapi.v0.ResponseMetadata; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.ResponseMetadata.deserializeBinaryFromReader); + msg.setMetadata(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; }; /** - * optional bytes state_transition = 1; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getStateTransition()` + * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.prototype.getStateTransition_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getStateTransition())); +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetDataContractsResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); }; /** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} returns this + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.prototype.setStateTransition = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getDataContracts(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.serializeBinaryToWriter + ); + } + f = message.getProof(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.org.dash.platform.dapi.v0.Proof.serializeBinaryToWriter + ); + } + f = message.getMetadata(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.org.dash.platform.dapi.v0.ResponseMetadata.serializeBinaryToWriter + ); + } }; @@ -1333,8 +6676,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.toObject(opt_includeInstance, this); +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue.toObject(opt_includeInstance, this); }; @@ -1343,13 +6686,13 @@ proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.prototype.toObj * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} msg The msg instance to transform. + * @param {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.toObject = function(includeInstance, msg) { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue.toObject = function(includeInstance, msg) { var f, obj = { - + value: msg.getValue_asB64() }; if (includeInstance) { @@ -1363,29 +6706,33 @@ proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.toObject = func /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue} */ -proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.deserializeBinary = function(bytes) { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse; - return proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.deserializeBinaryFromReader(msg, reader); + var msg = new proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue; + return proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} msg The message object to deserialize into. + * @param {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue} */ -proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.deserializeBinaryFromReader = function(msg, reader) { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setValue(value); + break; default: reader.skipField(); break; @@ -1399,9 +6746,9 @@ proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.deserializeBina * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.prototype.serializeBinary = function() { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.serializeBinaryToWriter(this, writer); + proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -1409,12 +6756,61 @@ proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.prototype.seria /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} message + * @param {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.serializeBinaryToWriter = function(message, writer) { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue.serializeBinaryToWriter = function(message, writer) { var f = undefined; + f = message.getValue_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } +}; + + +/** + * optional bytes value = 1; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue.prototype.getValue = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes value = 1; + * This is a type-conversion wrapper around `getValue()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue.prototype.getValue_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getValue())); +}; + + +/** + * optional bytes value = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getValue()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue.prototype.getValue_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getValue())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue} returns this + */ +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue.prototype.setValue = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); }; @@ -1434,8 +6830,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.org.dash.platform.dapi.v0.GetIdentityRequest.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetIdentityRequest.toObject(opt_includeInstance, this); +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.toObject(opt_includeInstance, this); }; @@ -1444,14 +6840,14 @@ proto.org.dash.platform.dapi.v0.GetIdentityRequest.prototype.toObject = function * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetIdentityRequest} msg The msg instance to transform. + * @param {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetIdentityRequest.toObject = function(includeInstance, msg) { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.toObject = function(includeInstance, msg) { var f, obj = { - id: msg.getId_asB64(), - prove: jspb.Message.getBooleanFieldWithDefault(msg, 2, false) + key: msg.getKey_asB64(), + value: (f = msg.getValue()) && proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue.toObject(includeInstance, f) }; if (includeInstance) { @@ -1465,23 +6861,23 @@ proto.org.dash.platform.dapi.v0.GetIdentityRequest.toObject = function(includeIn /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetIdentityRequest} + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} */ -proto.org.dash.platform.dapi.v0.GetIdentityRequest.deserializeBinary = function(bytes) { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetIdentityRequest; - return proto.org.dash.platform.dapi.v0.GetIdentityRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry; + return proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetIdentityRequest} msg The message object to deserialize into. + * @param {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetIdentityRequest} + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} */ -proto.org.dash.platform.dapi.v0.GetIdentityRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -1490,11 +6886,12 @@ proto.org.dash.platform.dapi.v0.GetIdentityRequest.deserializeBinaryFromReader = switch (field) { case 1: var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setId(value); + msg.setKey(value); break; case 2: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setProve(value); + var value = new proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue.deserializeBinaryFromReader); + msg.setValue(value); break; default: reader.skipField(); @@ -1509,9 +6906,9 @@ proto.org.dash.platform.dapi.v0.GetIdentityRequest.deserializeBinaryFromReader = * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetIdentityRequest.prototype.serializeBinary = function() { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetIdentityRequest.serializeBinaryToWriter(this, writer); + proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -1519,90 +6916,117 @@ proto.org.dash.platform.dapi.v0.GetIdentityRequest.prototype.serializeBinary = f /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetIdentityRequest} message + * @param {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetIdentityRequest.serializeBinaryToWriter = function(message, writer) { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getId_asU8(); + f = message.getKey_asU8(); if (f.length > 0) { writer.writeBytes( 1, f ); } - f = message.getProve(); - if (f) { - writer.writeBool( + f = message.getValue(); + if (f != null) { + writer.writeMessage( 2, - f + f, + proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue.serializeBinaryToWriter ); } }; /** - * optional bytes id = 1; + * optional bytes key = 1; * @return {string} */ -proto.org.dash.platform.dapi.v0.GetIdentityRequest.prototype.getId = function() { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.prototype.getKey = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** - * optional bytes id = 1; - * This is a type-conversion wrapper around `getId()` + * optional bytes key = 1; + * This is a type-conversion wrapper around `getKey()` * @return {string} */ -proto.org.dash.platform.dapi.v0.GetIdentityRequest.prototype.getId_asB64 = function() { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.prototype.getKey_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getId())); + this.getKey())); }; /** - * optional bytes id = 1; + * optional bytes key = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getId()` + * This is a type-conversion wrapper around `getKey()` * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetIdentityRequest.prototype.getId_asU8 = function() { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.prototype.getKey_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getId())); + this.getKey())); }; /** * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetIdentityRequest} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} returns this */ -proto.org.dash.platform.dapi.v0.GetIdentityRequest.prototype.setId = function(value) { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.prototype.setKey = function(value) { return jspb.Message.setProto3BytesField(this, 1, value); }; /** - * optional bool prove = 2; - * @return {boolean} + * optional DataContractValue value = 2; + * @return {?proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue} */ -proto.org.dash.platform.dapi.v0.GetIdentityRequest.prototype.getProve = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.prototype.getValue = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue, 2)); }; /** - * @param {boolean} value - * @return {!proto.org.dash.platform.dapi.v0.GetIdentityRequest} returns this + * @param {?proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} returns this +*/ +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.prototype.setValue = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} returns this */ -proto.org.dash.platform.dapi.v0.GetIdentityRequest.prototype.setProve = function(value) { - return jspb.Message.setProto3BooleanField(this, 2, value); +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.prototype.clearValue = function() { + return this.setValue(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.prototype.hasValue = function() { + return jspb.Message.getField(this, 2) != null; }; +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.repeatedFields_ = [1]; + if (jspb.Message.GENERATE_TO_OBJECT) { @@ -1618,8 +7042,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetIdentityResponse.toObject(opt_includeInstance, this); +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.toObject(opt_includeInstance, this); }; @@ -1628,15 +7052,14 @@ proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.toObject = functio * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetIdentityResponse} msg The msg instance to transform. + * @param {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetIdentityResponse.toObject = function(includeInstance, msg) { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.toObject = function(includeInstance, msg) { var f, obj = { - identity: msg.getIdentity_asB64(), - proof: (f = msg.getProof()) && proto.org.dash.platform.dapi.v0.Proof.toObject(includeInstance, f), - metadata: (f = msg.getMetadata()) && proto.org.dash.platform.dapi.v0.ResponseMetadata.toObject(includeInstance, f) + dataContractEntriesList: jspb.Message.toObjectList(msg.getDataContractEntriesList(), + proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.toObject, includeInstance) }; if (includeInstance) { @@ -1650,23 +7073,23 @@ proto.org.dash.platform.dapi.v0.GetIdentityResponse.toObject = function(includeI /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetIdentityResponse} + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} */ -proto.org.dash.platform.dapi.v0.GetIdentityResponse.deserializeBinary = function(bytes) { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetIdentityResponse; - return proto.org.dash.platform.dapi.v0.GetIdentityResponse.deserializeBinaryFromReader(msg, reader); + var msg = new proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts; + return proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetIdentityResponse} msg The message object to deserialize into. + * @param {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetIdentityResponse} + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} */ -proto.org.dash.platform.dapi.v0.GetIdentityResponse.deserializeBinaryFromReader = function(msg, reader) { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -1674,18 +7097,9 @@ proto.org.dash.platform.dapi.v0.GetIdentityResponse.deserializeBinaryFromReader var field = reader.getFieldNumber(); switch (field) { case 1: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setIdentity(value); - break; - case 2: - var value = new proto.org.dash.platform.dapi.v0.Proof; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.Proof.deserializeBinaryFromReader); - msg.setProof(value); - break; - case 3: - var value = new proto.org.dash.platform.dapi.v0.ResponseMetadata; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.ResponseMetadata.deserializeBinaryFromReader); - msg.setMetadata(value); + var value = new proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.deserializeBinaryFromReader); + msg.addDataContractEntries(value); break; default: reader.skipField(); @@ -1700,9 +7114,9 @@ proto.org.dash.platform.dapi.v0.GetIdentityResponse.deserializeBinaryFromReader * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.serializeBinary = function() { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetIdentityResponse.serializeBinaryToWriter(this, writer); + proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -1710,77 +7124,95 @@ proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.serializeBinary = /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetIdentityResponse} message + * @param {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetIdentityResponse.serializeBinaryToWriter = function(message, writer) { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getIdentity_asU8(); + f = message.getDataContractEntriesList(); if (f.length > 0) { - writer.writeBytes( + writer.writeRepeatedMessage( 1, - f - ); - } - f = message.getProof(); - if (f != null) { - writer.writeMessage( - 2, - f, - proto.org.dash.platform.dapi.v0.Proof.serializeBinaryToWriter - ); - } - f = message.getMetadata(); - if (f != null) { - writer.writeMessage( - 3, f, - proto.org.dash.platform.dapi.v0.ResponseMetadata.serializeBinaryToWriter + proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.serializeBinaryToWriter ); } }; /** - * optional bytes identity = 1; - * @return {string} + * repeated DataContractEntry data_contract_entries = 1; + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.prototype.getDataContractEntriesList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} returns this +*/ +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.prototype.setDataContractEntriesList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry=} opt_value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} + */ +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.prototype.addDataContractEntries = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} returns this + */ +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.prototype.clearDataContractEntriesList = function() { + return this.setDataContractEntriesList([]); +}; + + +/** + * optional DataContracts data_contracts = 1; + * @return {?proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} */ -proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.getIdentity = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.prototype.getDataContracts = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts, 1)); }; /** - * optional bytes identity = 1; - * This is a type-conversion wrapper around `getIdentity()` - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.getIdentity_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getIdentity())); + * @param {?proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.prototype.setDataContracts = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetDataContractsResponse.oneofGroups_[0], value); }; /** - * optional bytes identity = 1; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getIdentity()` - * @return {!Uint8Array} + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.getIdentity_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getIdentity())); +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.prototype.clearDataContracts = function() { + return this.setDataContracts(undefined); }; /** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetIdentityResponse} returns this + * Returns whether this field is set. + * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.setIdentity = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.prototype.hasDataContracts = function() { + return jspb.Message.getField(this, 1) != null; }; @@ -1788,7 +7220,7 @@ proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.setIdentity = func * optional Proof proof = 2; * @return {?proto.org.dash.platform.dapi.v0.Proof} */ -proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.getProof = function() { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.prototype.getProof = function() { return /** @type{?proto.org.dash.platform.dapi.v0.Proof} */ ( jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.Proof, 2)); }; @@ -1796,18 +7228,18 @@ proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.getProof = functio /** * @param {?proto.org.dash.platform.dapi.v0.Proof|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetIdentityResponse} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.setProof = function(value) { - return jspb.Message.setWrapperField(this, 2, value); +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.prototype.setProof = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.org.dash.platform.dapi.v0.GetDataContractsResponse.oneofGroups_[0], value); }; /** * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetIdentityResponse} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.clearProof = function() { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.prototype.clearProof = function() { return this.setProof(undefined); }; @@ -1816,7 +7248,7 @@ proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.clearProof = funct * Returns whether this field is set. * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.hasProof = function() { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.prototype.hasProof = function() { return jspb.Message.getField(this, 2) != null; }; @@ -1825,7 +7257,7 @@ proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.hasProof = functio * optional ResponseMetadata metadata = 3; * @return {?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ -proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.getMetadata = function() { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.prototype.getMetadata = function() { return /** @type{?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ ( jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.ResponseMetadata, 3)); }; @@ -1833,18 +7265,18 @@ proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.getMetadata = func /** * @param {?proto.org.dash.platform.dapi.v0.ResponseMetadata|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetIdentityResponse} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.setMetadata = function(value) { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.prototype.setMetadata = function(value) { return jspb.Message.setWrapperField(this, 3, value); }; /** * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetIdentityResponse} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.clearMetadata = function() { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.prototype.clearMetadata = function() { return this.setMetadata(undefined); }; @@ -1853,12 +7285,38 @@ proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.clearMetadata = fu * Returns whether this field is set. * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.hasMetadata = function() { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.prototype.hasMetadata = function() { return jspb.Message.getField(this, 3) != null; }; +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.oneofGroups_ = [[6,7]]; + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.StartCase = { + START_NOT_SET: 0, + START_AFTER: 6, + START_AT: 7 +}; + +/** + * @return {proto.org.dash.platform.dapi.v0.GetDocumentsRequest.StartCase} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getStartCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetDocumentsRequest.StartCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.oneofGroups_[0])); +}; + if (jspb.Message.GENERATE_TO_OBJECT) { @@ -1874,8 +7332,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.org.dash.platform.dapi.v0.GetDataContractRequest.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetDataContractRequest.toObject(opt_includeInstance, this); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetDocumentsRequest.toObject(opt_includeInstance, this); }; @@ -1884,14 +7342,20 @@ proto.org.dash.platform.dapi.v0.GetDataContractRequest.prototype.toObject = func * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetDataContractRequest} msg The msg instance to transform. + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDataContractRequest.toObject = function(includeInstance, msg) { +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.toObject = function(includeInstance, msg) { var f, obj = { - id: msg.getId_asB64(), - prove: jspb.Message.getBooleanFieldWithDefault(msg, 2, false) + dataContractId: msg.getDataContractId_asB64(), + documentType: jspb.Message.getFieldWithDefault(msg, 2, ""), + where: msg.getWhere_asB64(), + orderBy: msg.getOrderBy_asB64(), + limit: jspb.Message.getFieldWithDefault(msg, 5, 0), + startAfter: msg.getStartAfter_asB64(), + startAt: msg.getStartAt_asB64(), + prove: jspb.Message.getBooleanFieldWithDefault(msg, 8, false) }; if (includeInstance) { @@ -1905,23 +7369,23 @@ proto.org.dash.platform.dapi.v0.GetDataContractRequest.toObject = function(inclu /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetDataContractRequest} + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} */ -proto.org.dash.platform.dapi.v0.GetDataContractRequest.deserializeBinary = function(bytes) { +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetDataContractRequest; - return proto.org.dash.platform.dapi.v0.GetDataContractRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsRequest; + return proto.org.dash.platform.dapi.v0.GetDocumentsRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetDataContractRequest} msg The message object to deserialize into. + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetDataContractRequest} + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} */ -proto.org.dash.platform.dapi.v0.GetDataContractRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -1930,9 +7394,33 @@ proto.org.dash.platform.dapi.v0.GetDataContractRequest.deserializeBinaryFromRead switch (field) { case 1: var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setId(value); + msg.setDataContractId(value); break; case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setDocumentType(value); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setWhere(value); + break; + case 4: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setOrderBy(value); + break; + case 5: + var value = /** @type {number} */ (reader.readUint32()); + msg.setLimit(value); + break; + case 6: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setStartAfter(value); + break; + case 7: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setStartAt(value); + break; + case 8: var value = /** @type {boolean} */ (reader.readBool()); msg.setProve(value); break; @@ -1949,9 +7437,9 @@ proto.org.dash.platform.dapi.v0.GetDataContractRequest.deserializeBinaryFromRead * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetDataContractRequest.prototype.serializeBinary = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetDataContractRequest.serializeBinaryToWriter(this, writer); + proto.org.dash.platform.dapi.v0.GetDocumentsRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -1959,23 +7447,65 @@ proto.org.dash.platform.dapi.v0.GetDataContractRequest.prototype.serializeBinary /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetDataContractRequest} message + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDataContractRequest.serializeBinaryToWriter = function(message, writer) { +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getId_asU8(); + f = message.getDataContractId_asU8(); if (f.length > 0) { writer.writeBytes( 1, f ); } + f = message.getDocumentType(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getWhere_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } + f = message.getOrderBy_asU8(); + if (f.length > 0) { + writer.writeBytes( + 4, + f + ); + } + f = message.getLimit(); + if (f !== 0) { + writer.writeUint32( + 5, + f + ); + } + f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 6)); + if (f != null) { + writer.writeBytes( + 6, + f + ); + } + f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 7)); + if (f != null) { + writer.writeBytes( + 7, + f + ); + } f = message.getProve(); if (f) { writer.writeBool( - 2, + 8, f ); } @@ -1983,309 +7513,275 @@ proto.org.dash.platform.dapi.v0.GetDataContractRequest.serializeBinaryToWriter = /** - * optional bytes id = 1; + * optional bytes data_contract_id = 1; * @return {string} */ -proto.org.dash.platform.dapi.v0.GetDataContractRequest.prototype.getId = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getDataContractId = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** - * optional bytes id = 1; - * This is a type-conversion wrapper around `getId()` + * optional bytes data_contract_id = 1; + * This is a type-conversion wrapper around `getDataContractId()` * @return {string} */ -proto.org.dash.platform.dapi.v0.GetDataContractRequest.prototype.getId_asB64 = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getDataContractId_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getId())); + this.getDataContractId())); }; /** - * optional bytes id = 1; + * optional bytes data_contract_id = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getId()` + * This is a type-conversion wrapper around `getDataContractId()` * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetDataContractRequest.prototype.getId_asU8 = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getDataContractId_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getId())); + this.getDataContractId())); }; /** * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetDataContractRequest} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this */ -proto.org.dash.platform.dapi.v0.GetDataContractRequest.prototype.setId = function(value) { +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.setDataContractId = function(value) { return jspb.Message.setProto3BytesField(this, 1, value); }; /** - * optional bool prove = 2; - * @return {boolean} + * optional string document_type = 2; + * @return {string} */ -proto.org.dash.platform.dapi.v0.GetDataContractRequest.prototype.getProve = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getDocumentType = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** - * @param {boolean} value - * @return {!proto.org.dash.platform.dapi.v0.GetDataContractRequest} returns this + * @param {string} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this */ -proto.org.dash.platform.dapi.v0.GetDataContractRequest.prototype.setProve = function(value) { - return jspb.Message.setProto3BooleanField(this, 2, value); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.setDocumentType = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); }; +/** + * optional bytes where = 3; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getWhere = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + +/** + * optional bytes where = 3; + * This is a type-conversion wrapper around `getWhere()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getWhere_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getWhere())); +}; -if (jspb.Message.GENERATE_TO_OBJECT) { /** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} + * optional bytes where = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getWhere()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getWhere_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getWhere())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this */ -proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetDataContractResponse.toObject(opt_includeInstance, this); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.setWhere = function(value) { + return jspb.Message.setProto3BytesField(this, 3, value); }; /** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetDataContractResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages + * optional bytes order_by = 4; + * @return {string} */ -proto.org.dash.platform.dapi.v0.GetDataContractResponse.toObject = function(includeInstance, msg) { - var f, obj = { - dataContract: msg.getDataContract_asB64(), - proof: (f = msg.getProof()) && proto.org.dash.platform.dapi.v0.Proof.toObject(includeInstance, f), - metadata: (f = msg.getMetadata()) && proto.org.dash.platform.dapi.v0.ResponseMetadata.toObject(includeInstance, f) - }; +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getOrderBy = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; + +/** + * optional bytes order_by = 4; + * This is a type-conversion wrapper around `getOrderBy()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getOrderBy_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getOrderBy())); }; -} /** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetDataContractResponse} + * optional bytes order_by = 4; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getOrderBy()` + * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetDataContractResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetDataContractResponse; - return proto.org.dash.platform.dapi.v0.GetDataContractResponse.deserializeBinaryFromReader(msg, reader); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getOrderBy_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getOrderBy())); }; /** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetDataContractResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetDataContractResponse} + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this */ -proto.org.dash.platform.dapi.v0.GetDataContractResponse.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setDataContract(value); - break; - case 2: - var value = new proto.org.dash.platform.dapi.v0.Proof; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.Proof.deserializeBinaryFromReader); - msg.setProof(value); - break; - case 3: - var value = new proto.org.dash.platform.dapi.v0.ResponseMetadata; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.ResponseMetadata.deserializeBinaryFromReader); - msg.setMetadata(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.setOrderBy = function(value) { + return jspb.Message.setProto3BytesField(this, 4, value); }; /** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} + * optional uint32 limit = 5; + * @return {number} */ -proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetDataContractResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getLimit = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); }; /** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetDataContractResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages + * @param {number} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this */ -proto.org.dash.platform.dapi.v0.GetDataContractResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getDataContract_asU8(); - if (f.length > 0) { - writer.writeBytes( - 1, - f - ); - } - f = message.getProof(); - if (f != null) { - writer.writeMessage( - 2, - f, - proto.org.dash.platform.dapi.v0.Proof.serializeBinaryToWriter - ); - } - f = message.getMetadata(); - if (f != null) { - writer.writeMessage( - 3, - f, - proto.org.dash.platform.dapi.v0.ResponseMetadata.serializeBinaryToWriter - ); - } +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.setLimit = function(value) { + return jspb.Message.setProto3IntField(this, 5, value); }; /** - * optional bytes data_contract = 1; + * optional bytes start_after = 6; * @return {string} */ -proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.getDataContract = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getStartAfter = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); }; /** - * optional bytes data_contract = 1; - * This is a type-conversion wrapper around `getDataContract()` + * optional bytes start_after = 6; + * This is a type-conversion wrapper around `getStartAfter()` * @return {string} */ -proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.getDataContract_asB64 = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getStartAfter_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getDataContract())); + this.getStartAfter())); }; /** - * optional bytes data_contract = 1; + * optional bytes start_after = 6; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getDataContract()` + * This is a type-conversion wrapper around `getStartAfter()` * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.getDataContract_asU8 = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getStartAfter_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getDataContract())); + this.getStartAfter())); }; /** * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetDataContractResponse} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this */ -proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.setDataContract = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.setStartAfter = function(value) { + return jspb.Message.setOneofField(this, 6, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.oneofGroups_[0], value); }; /** - * optional Proof proof = 2; - * @return {?proto.org.dash.platform.dapi.v0.Proof} + * Clears the field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this */ -proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.getProof = function() { - return /** @type{?proto.org.dash.platform.dapi.v0.Proof} */ ( - jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.Proof, 2)); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.clearStartAfter = function() { + return jspb.Message.setOneofField(this, 6, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.oneofGroups_[0], undefined); }; /** - * @param {?proto.org.dash.platform.dapi.v0.Proof|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetDataContractResponse} returns this -*/ -proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.setProof = function(value) { - return jspb.Message.setWrapperField(this, 2, value); + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.hasStartAfter = function() { + return jspb.Message.getField(this, 6) != null; }; /** - * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetDataContractResponse} returns this + * optional bytes start_at = 7; + * @return {string} */ -proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.clearProof = function() { - return this.setProof(undefined); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getStartAt = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "")); }; /** - * Returns whether this field is set. - * @return {boolean} + * optional bytes start_at = 7; + * This is a type-conversion wrapper around `getStartAt()` + * @return {string} */ -proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.hasProof = function() { - return jspb.Message.getField(this, 2) != null; +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getStartAt_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getStartAt())); }; /** - * optional ResponseMetadata metadata = 3; - * @return {?proto.org.dash.platform.dapi.v0.ResponseMetadata} + * optional bytes start_at = 7; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getStartAt()` + * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.getMetadata = function() { - return /** @type{?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ ( - jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.ResponseMetadata, 3)); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getStartAt_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getStartAt())); }; /** - * @param {?proto.org.dash.platform.dapi.v0.ResponseMetadata|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetDataContractResponse} returns this -*/ -proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.setMetadata = function(value) { - return jspb.Message.setWrapperField(this, 3, value); + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.setStartAt = function(value) { + return jspb.Message.setOneofField(this, 7, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.oneofGroups_[0], value); }; /** - * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetDataContractResponse} returns this + * Clears the field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this */ -proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.clearMetadata = function() { - return this.setMetadata(undefined); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.clearStartAt = function() { + return jspb.Message.setOneofField(this, 7, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.oneofGroups_[0], undefined); }; @@ -2293,37 +7789,36 @@ proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.clearMetadata * Returns whether this field is set. * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.hasMetadata = function() { - return jspb.Message.getField(this, 3) != null; +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.hasStartAt = function() { + return jspb.Message.getField(this, 7) != null; }; - /** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const + * optional bool prove = 8; + * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.oneofGroups_ = [[6,7]]; +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getProve = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 8, false)); +}; + /** - * @enum {number} - */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.StartCase = { - START_NOT_SET: 0, - START_AFTER: 6, - START_AT: 7 + * @param {boolean} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.setProve = function(value) { + return jspb.Message.setProto3BooleanField(this, 8, value); }; + + /** - * @return {proto.org.dash.platform.dapi.v0.GetDocumentsRequest.StartCase} + * List of repeated fields within this message type. + * @private {!Array} + * @const */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getStartCase = function() { - return /** @type {proto.org.dash.platform.dapi.v0.GetDocumentsRequest.StartCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.oneofGroups_[0])); -}; +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.repeatedFields_ = [1]; @@ -2340,8 +7835,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetDocumentsRequest.toObject(opt_includeInstance, this); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.toObject(opt_includeInstance, this); }; @@ -2350,20 +7845,15 @@ proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.toObject = functio * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} msg The msg instance to transform. + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.toObject = function(includeInstance, msg) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.toObject = function(includeInstance, msg) { var f, obj = { - dataContractId: msg.getDataContractId_asB64(), - documentType: jspb.Message.getFieldWithDefault(msg, 2, ""), - where: msg.getWhere_asB64(), - orderBy: msg.getOrderBy_asB64(), - limit: jspb.Message.getFieldWithDefault(msg, 5, 0), - startAfter: msg.getStartAfter_asB64(), - startAt: msg.getStartAt_asB64(), - prove: jspb.Message.getBooleanFieldWithDefault(msg, 8, false) + documentsList: msg.getDocumentsList_asB64(), + proof: (f = msg.getProof()) && proto.org.dash.platform.dapi.v0.Proof.toObject(includeInstance, f), + metadata: (f = msg.getMetadata()) && proto.org.dash.platform.dapi.v0.ResponseMetadata.toObject(includeInstance, f) }; if (includeInstance) { @@ -2377,23 +7867,23 @@ proto.org.dash.platform.dapi.v0.GetDocumentsRequest.toObject = function(includeI /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.deserializeBinary = function(bytes) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsRequest; - return proto.org.dash.platform.dapi.v0.GetDocumentsRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsResponse; + return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} msg The message object to deserialize into. + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -2402,35 +7892,17 @@ proto.org.dash.platform.dapi.v0.GetDocumentsRequest.deserializeBinaryFromReader switch (field) { case 1: var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setDataContractId(value); + msg.addDocuments(value); break; case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setDocumentType(value); + var value = new proto.org.dash.platform.dapi.v0.Proof; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.Proof.deserializeBinaryFromReader); + msg.setProof(value); break; case 3: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setWhere(value); - break; - case 4: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setOrderBy(value); - break; - case 5: - var value = /** @type {number} */ (reader.readUint32()); - msg.setLimit(value); - break; - case 6: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setStartAfter(value); - break; - case 7: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setStartAt(value); - break; - case 8: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setProve(value); + var value = new proto.org.dash.platform.dapi.v0.ResponseMetadata; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.ResponseMetadata.deserializeBinaryFromReader); + msg.setMetadata(value); break; default: reader.skipField(); @@ -2445,9 +7917,9 @@ proto.org.dash.platform.dapi.v0.GetDocumentsRequest.deserializeBinaryFromReader * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.serializeBinary = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetDocumentsRequest.serializeBinaryToWriter(this, writer); + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -2455,368 +7927,380 @@ proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.serializeBinary = /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} message + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.serializeBinaryToWriter = function(message, writer) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getDataContractId_asU8(); + f = message.getDocumentsList_asU8(); if (f.length > 0) { - writer.writeBytes( + writer.writeRepeatedBytes( 1, f ); } - f = message.getDocumentType(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getWhere_asU8(); - if (f.length > 0) { - writer.writeBytes( - 3, - f - ); - } - f = message.getOrderBy_asU8(); - if (f.length > 0) { - writer.writeBytes( - 4, - f - ); - } - f = message.getLimit(); - if (f !== 0) { - writer.writeUint32( - 5, - f - ); - } - f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 6)); + f = message.getProof(); if (f != null) { - writer.writeBytes( - 6, - f + writer.writeMessage( + 2, + f, + proto.org.dash.platform.dapi.v0.Proof.serializeBinaryToWriter ); } - f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 7)); + f = message.getMetadata(); if (f != null) { - writer.writeBytes( - 7, - f - ); - } - f = message.getProve(); - if (f) { - writer.writeBool( - 8, - f + writer.writeMessage( + 3, + f, + proto.org.dash.platform.dapi.v0.ResponseMetadata.serializeBinaryToWriter ); } }; /** - * optional bytes data_contract_id = 1; - * @return {string} + * repeated bytes documents = 1; + * @return {!Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getDataContractId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.getDocumentsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); }; /** - * optional bytes data_contract_id = 1; - * This is a type-conversion wrapper around `getDataContractId()` - * @return {string} + * repeated bytes documents = 1; + * This is a type-conversion wrapper around `getDocumentsList()` + * @return {!Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getDataContractId_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getDataContractId())); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.getDocumentsList_asB64 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsB64( + this.getDocumentsList())); }; /** - * optional bytes data_contract_id = 1; + * repeated bytes documents = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getDataContractId()` - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getDataContractId_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getDataContractId())); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this + * This is a type-conversion wrapper around `getDocumentsList()` + * @return {!Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.setDataContractId = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.getDocumentsList_asU8 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsU8( + this.getDocumentsList())); }; /** - * optional string document_type = 2; - * @return {string} + * @param {!(Array|Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getDocumentType = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.setDocumentsList = function(value) { + return jspb.Message.setField(this, 1, value || []); }; /** - * @param {string} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this + * @param {!(string|Uint8Array)} value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.setDocumentType = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.addDocuments = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); }; /** - * optional bytes where = 3; - * @return {string} + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getWhere = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.clearDocumentsList = function() { + return this.setDocumentsList([]); }; /** - * optional bytes where = 3; - * This is a type-conversion wrapper around `getWhere()` - * @return {string} + * optional Proof proof = 2; + * @return {?proto.org.dash.platform.dapi.v0.Proof} */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getWhere_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getWhere())); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.getProof = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.Proof} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.Proof, 2)); }; /** - * optional bytes where = 3; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getWhere()` - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getWhere_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getWhere())); + * @param {?proto.org.dash.platform.dapi.v0.Proof|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.setProof = function(value) { + return jspb.Message.setWrapperField(this, 2, value); }; /** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.setWhere = function(value) { - return jspb.Message.setProto3BytesField(this, 3, value); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.clearProof = function() { + return this.setProof(undefined); }; /** - * optional bytes order_by = 4; - * @return {string} + * Returns whether this field is set. + * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getOrderBy = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.hasProof = function() { + return jspb.Message.getField(this, 2) != null; }; /** - * optional bytes order_by = 4; - * This is a type-conversion wrapper around `getOrderBy()` - * @return {string} + * optional ResponseMetadata metadata = 3; + * @return {?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getOrderBy_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getOrderBy())); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.getMetadata = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.ResponseMetadata, 3)); }; /** - * optional bytes order_by = 4; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getOrderBy()` - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getOrderBy_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getOrderBy())); + * @param {?proto.org.dash.platform.dapi.v0.ResponseMetadata|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.setMetadata = function(value) { + return jspb.Message.setWrapperField(this, 3, value); }; /** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.setOrderBy = function(value) { - return jspb.Message.setProto3BytesField(this, 4, value); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.clearMetadata = function() { + return this.setMetadata(undefined); }; /** - * optional uint32 limit = 5; - * @return {number} + * Returns whether this field is set. + * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getLimit = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.hasMetadata = function() { + return jspb.Message.getField(this, 3) != null; }; + /** - * @param {number} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this + * List of repeated fields within this message type. + * @private {!Array} + * @const */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.setLimit = function(value) { - return jspb.Message.setProto3IntField(this, 5, value); -}; +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.repeatedFields_ = [1]; + +if (jspb.Message.GENERATE_TO_OBJECT) { /** - * optional bytes start_after = 6; - * @return {string} + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getStartAfter = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.toObject(opt_includeInstance, this); }; /** - * optional bytes start_after = 6; - * This is a type-conversion wrapper around `getStartAfter()` - * @return {string} + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getStartAfter_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getStartAfter())); +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.toObject = function(includeInstance, msg) { + var f, obj = { + publicKeyHashesList: msg.getPublicKeyHashesList_asB64(), + prove: jspb.Message.getBooleanFieldWithDefault(msg, 2, false) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; }; +} /** - * optional bytes start_after = 6; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getStartAfter()` - * @return {!Uint8Array} + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest} */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getStartAfter_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getStartAfter())); +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest; + return proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.deserializeBinaryFromReader(msg, reader); }; /** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest} */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.setStartAfter = function(value) { - return jspb.Message.setOneofField(this, 6, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.oneofGroups_[0], value); +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.addPublicKeyHashes(value); + break; + case 2: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setProve(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; }; /** - * Clears the field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.clearStartAfter = function() { - return jspb.Message.setOneofField(this, 6, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.oneofGroups_[0], undefined); +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); }; /** - * Returns whether this field is set. - * @return {boolean} + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.hasStartAfter = function() { - return jspb.Message.getField(this, 6) != null; +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getPublicKeyHashesList_asU8(); + if (f.length > 0) { + writer.writeRepeatedBytes( + 1, + f + ); + } + f = message.getProve(); + if (f) { + writer.writeBool( + 2, + f + ); + } }; /** - * optional bytes start_at = 7; - * @return {string} + * repeated bytes public_key_hashes = 1; + * @return {!Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getStartAt = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "")); +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.prototype.getPublicKeyHashesList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); }; /** - * optional bytes start_at = 7; - * This is a type-conversion wrapper around `getStartAt()` - * @return {string} + * repeated bytes public_key_hashes = 1; + * This is a type-conversion wrapper around `getPublicKeyHashesList()` + * @return {!Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getStartAt_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getStartAt())); +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.prototype.getPublicKeyHashesList_asB64 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsB64( + this.getPublicKeyHashesList())); }; /** - * optional bytes start_at = 7; + * repeated bytes public_key_hashes = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getStartAt()` - * @return {!Uint8Array} + * This is a type-conversion wrapper around `getPublicKeyHashesList()` + * @return {!Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getStartAt_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getStartAt())); +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.prototype.getPublicKeyHashesList_asU8 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsU8( + this.getPublicKeyHashesList())); }; /** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this + * @param {!(Array|Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.setStartAt = function(value) { - return jspb.Message.setOneofField(this, 7, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.oneofGroups_[0], value); +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.prototype.setPublicKeyHashesList = function(value) { + return jspb.Message.setField(this, 1, value || []); }; /** - * Clears the field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this + * @param {!(string|Uint8Array)} value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.clearStartAt = function() { - return jspb.Message.setOneofField(this, 7, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.oneofGroups_[0], undefined); +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.prototype.addPublicKeyHashes = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); }; /** - * Returns whether this field is set. - * @return {boolean} + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.hasStartAt = function() { - return jspb.Message.getField(this, 7) != null; +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.prototype.clearPublicKeyHashesList = function() { + return this.setPublicKeyHashesList([]); }; /** - * optional bool prove = 8; + * optional bool prove = 2; * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getProve = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 8, false)); +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.prototype.getProve = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); }; /** * @param {boolean} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.setProve = function(value) { - return jspb.Message.setProto3BooleanField(this, 8, value); +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.prototype.setProve = function(value) { + return jspb.Message.setProto3BooleanField(this, 2, value); }; @@ -2826,7 +8310,7 @@ proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.setProve = functio * @private {!Array} * @const */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.repeatedFields_ = [1]; +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.repeatedFields_ = [1]; @@ -2843,8 +8327,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.toObject(opt_includeInstance, this); +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.toObject(opt_includeInstance, this); }; @@ -2853,13 +8337,13 @@ proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.toObject = functi * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} msg The msg instance to transform. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.toObject = function(includeInstance, msg) { +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.toObject = function(includeInstance, msg) { var f, obj = { - documentsList: msg.getDocumentsList_asB64(), + identitiesList: msg.getIdentitiesList_asB64(), proof: (f = msg.getProof()) && proto.org.dash.platform.dapi.v0.Proof.toObject(includeInstance, f), metadata: (f = msg.getMetadata()) && proto.org.dash.platform.dapi.v0.ResponseMetadata.toObject(includeInstance, f) }; @@ -2875,23 +8359,23 @@ proto.org.dash.platform.dapi.v0.GetDocumentsResponse.toObject = function(include /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsResponse; - return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.deserializeBinaryFromReader(msg, reader); +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse; + return proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} msg The message object to deserialize into. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.deserializeBinaryFromReader = function(msg, reader) { +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -2900,7 +8384,7 @@ proto.org.dash.platform.dapi.v0.GetDocumentsResponse.deserializeBinaryFromReader switch (field) { case 1: var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.addDocuments(value); + msg.addIdentities(value); break; case 2: var value = new proto.org.dash.platform.dapi.v0.Proof; @@ -2925,9 +8409,9 @@ proto.org.dash.platform.dapi.v0.GetDocumentsResponse.deserializeBinaryFromReader * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.serializeBinary = function() { +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetDocumentsResponse.serializeBinaryToWriter(this, writer); + proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -2935,13 +8419,13 @@ proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.serializeBinary = /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} message + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.serializeBinaryToWriter = function(message, writer) { +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getDocumentsList_asU8(); + f = message.getIdentitiesList_asU8(); if (f.length > 0) { writer.writeRepeatedBytes( 1, @@ -2968,43 +8452,43 @@ proto.org.dash.platform.dapi.v0.GetDocumentsResponse.serializeBinaryToWriter = f /** - * repeated bytes documents = 1; + * repeated bytes identities = 1; * @return {!Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.getDocumentsList = function() { +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.getIdentitiesList = function() { return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); }; /** - * repeated bytes documents = 1; - * This is a type-conversion wrapper around `getDocumentsList()` + * repeated bytes identities = 1; + * This is a type-conversion wrapper around `getIdentitiesList()` * @return {!Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.getDocumentsList_asB64 = function() { +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.getIdentitiesList_asB64 = function() { return /** @type {!Array} */ (jspb.Message.bytesListAsB64( - this.getDocumentsList())); + this.getIdentitiesList())); }; /** - * repeated bytes documents = 1; + * repeated bytes identities = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getDocumentsList()` + * This is a type-conversion wrapper around `getIdentitiesList()` * @return {!Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.getDocumentsList_asU8 = function() { +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.getIdentitiesList_asU8 = function() { return /** @type {!Array} */ (jspb.Message.bytesListAsU8( - this.getDocumentsList())); + this.getIdentitiesList())); }; /** * @param {!(Array|Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.setDocumentsList = function(value) { +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.setIdentitiesList = function(value) { return jspb.Message.setField(this, 1, value || []); }; @@ -3012,19 +8496,19 @@ proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.setDocumentsList /** * @param {!(string|Uint8Array)} value * @param {number=} opt_index - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.addDocuments = function(value, opt_index) { +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.addIdentities = function(value, opt_index) { return jspb.Message.addToRepeatedField(this, 1, value, opt_index); }; /** * Clears the list making it empty but non-null. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.clearDocumentsList = function() { - return this.setDocumentsList([]); +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.clearIdentitiesList = function() { + return this.setIdentitiesList([]); }; @@ -3032,7 +8516,7 @@ proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.clearDocumentsLis * optional Proof proof = 2; * @return {?proto.org.dash.platform.dapi.v0.Proof} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.getProof = function() { +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.getProof = function() { return /** @type{?proto.org.dash.platform.dapi.v0.Proof} */ ( jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.Proof, 2)); }; @@ -3040,18 +8524,18 @@ proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.getProof = functi /** * @param {?proto.org.dash.platform.dapi.v0.Proof|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.setProof = function(value) { +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.setProof = function(value) { return jspb.Message.setWrapperField(this, 2, value); }; /** * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.clearProof = function() { +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.clearProof = function() { return this.setProof(undefined); }; @@ -3060,7 +8544,7 @@ proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.clearProof = func * Returns whether this field is set. * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.hasProof = function() { +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.hasProof = function() { return jspb.Message.getField(this, 2) != null; }; @@ -3069,7 +8553,7 @@ proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.hasProof = functi * optional ResponseMetadata metadata = 3; * @return {?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.getMetadata = function() { +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.getMetadata = function() { return /** @type{?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ ( jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.ResponseMetadata, 3)); }; @@ -3077,18 +8561,18 @@ proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.getMetadata = fun /** * @param {?proto.org.dash.platform.dapi.v0.ResponseMetadata|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.setMetadata = function(value) { +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.setMetadata = function(value) { return jspb.Message.setWrapperField(this, 3, value); }; /** * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.clearMetadata = function() { +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.clearMetadata = function() { return this.setMetadata(undefined); }; @@ -3097,19 +8581,12 @@ proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.clearMetadata = f * Returns whether this field is set. * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.hasMetadata = function() { +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.hasMetadata = function() { return jspb.Message.getField(this, 3) != null; }; -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.repeatedFields_ = [1]; - if (jspb.Message.GENERATE_TO_OBJECT) { @@ -3125,8 +8602,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.toObject(opt_includeInstance, this); +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest.toObject(opt_includeInstance, this); }; @@ -3135,13 +8612,13 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.prototype. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest} msg The msg instance to transform. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.toObject = function(includeInstance, msg) { +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest.toObject = function(includeInstance, msg) { var f, obj = { - publicKeyHashesList: msg.getPublicKeyHashesList_asB64(), + publicKeyHash: msg.getPublicKeyHash_asB64(), prove: jspb.Message.getBooleanFieldWithDefault(msg, 2, false) }; @@ -3156,23 +8633,23 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.toObject = /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest} + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest} */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.deserializeBinary = function(bytes) { +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest; - return proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest; + return proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest} msg The message object to deserialize into. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest} + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest} */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -3181,7 +8658,7 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.deserializ switch (field) { case 1: var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.addPublicKeyHashes(value); + msg.setPublicKeyHash(value); break; case 2: var value = /** @type {boolean} */ (reader.readBool()); @@ -3200,9 +8677,9 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.deserializ * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.prototype.serializeBinary = function() { +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.serializeBinaryToWriter(this, writer); + proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -3210,15 +8687,15 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.prototype. /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest} message + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.serializeBinaryToWriter = function(message, writer) { +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getPublicKeyHashesList_asU8(); + f = message.getPublicKeyHash_asU8(); if (f.length > 0) { - writer.writeRepeatedBytes( + writer.writeBytes( 1, f ); @@ -3234,63 +8711,44 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.serializeB /** - * repeated bytes public_key_hashes = 1; - * @return {!Array} + * optional bytes public_key_hash = 1; + * @return {string} */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.prototype.getPublicKeyHashesList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest.prototype.getPublicKeyHash = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** - * repeated bytes public_key_hashes = 1; - * This is a type-conversion wrapper around `getPublicKeyHashesList()` - * @return {!Array} + * optional bytes public_key_hash = 1; + * This is a type-conversion wrapper around `getPublicKeyHash()` + * @return {string} */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.prototype.getPublicKeyHashesList_asB64 = function() { - return /** @type {!Array} */ (jspb.Message.bytesListAsB64( - this.getPublicKeyHashesList())); +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest.prototype.getPublicKeyHash_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getPublicKeyHash())); }; /** - * repeated bytes public_key_hashes = 1; + * optional bytes public_key_hash = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getPublicKeyHashesList()` - * @return {!Array} - */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.prototype.getPublicKeyHashesList_asU8 = function() { - return /** @type {!Array} */ (jspb.Message.bytesListAsU8( - this.getPublicKeyHashesList())); -}; - - -/** - * @param {!(Array|Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest} returns this + * This is a type-conversion wrapper around `getPublicKeyHash()` + * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.prototype.setPublicKeyHashesList = function(value) { - return jspb.Message.setField(this, 1, value || []); +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest.prototype.getPublicKeyHash_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getPublicKeyHash())); }; /** * @param {!(string|Uint8Array)} value - * @param {number=} opt_index - * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.prototype.addPublicKeyHashes = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 1, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest} returns this */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.prototype.clearPublicKeyHashesList = function() { - return this.setPublicKeyHashesList([]); +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest.prototype.setPublicKeyHash = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); }; @@ -3298,27 +8756,46 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.prototype. * optional bool prove = 2; * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.prototype.getProve = function() { +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest.prototype.getProve = function() { return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); }; /** * @param {boolean} value - * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest} returns this */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.prototype.setProve = function(value) { +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest.prototype.setProve = function(value) { return jspb.Message.setProto3BooleanField(this, 2, value); }; /** - * List of repeated fields within this message type. - * @private {!Array} + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} * @const */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.repeatedFields_ = [1]; +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.oneofGroups_ = [[1,2]]; + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.ResultCase = { + RESULT_NOT_SET: 0, + IDENTITY: 1, + PROOF: 2 +}; + +/** + * @return {proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.ResultCase} + */ +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.prototype.getResultCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.ResultCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.oneofGroups_[0])); +}; @@ -3335,8 +8812,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.toObject(opt_includeInstance, this); +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.toObject(opt_includeInstance, this); }; @@ -3345,13 +8822,13 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} msg The msg instance to transform. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.toObject = function(includeInstance, msg) { +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.toObject = function(includeInstance, msg) { var f, obj = { - identitiesList: msg.getIdentitiesList_asB64(), + identity: msg.getIdentity_asB64(), proof: (f = msg.getProof()) && proto.org.dash.platform.dapi.v0.Proof.toObject(includeInstance, f), metadata: (f = msg.getMetadata()) && proto.org.dash.platform.dapi.v0.ResponseMetadata.toObject(includeInstance, f) }; @@ -3367,23 +8844,23 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.toObject /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse} */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.deserializeBinary = function(bytes) { +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse; - return proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.deserializeBinaryFromReader(msg, reader); + var msg = new proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse; + return proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} msg The message object to deserialize into. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse} */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.deserializeBinaryFromReader = function(msg, reader) { +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -3392,7 +8869,7 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.deseriali switch (field) { case 1: var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.addIdentities(value); + msg.setIdentity(value); break; case 2: var value = new proto.org.dash.platform.dapi.v0.Proof; @@ -3417,9 +8894,9 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.deseriali * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.serializeBinary = function() { +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.serializeBinaryToWriter(this, writer); + proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -3427,15 +8904,15 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} message + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.serializeBinaryToWriter = function(message, writer) { +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getIdentitiesList_asU8(); - if (f.length > 0) { - writer.writeRepeatedBytes( + f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeBytes( 1, f ); @@ -3460,63 +8937,62 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.serialize /** - * repeated bytes identities = 1; - * @return {!Array} + * optional bytes identity = 1; + * @return {string} */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.getIdentitiesList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.prototype.getIdentity = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** - * repeated bytes identities = 1; - * This is a type-conversion wrapper around `getIdentitiesList()` - * @return {!Array} + * optional bytes identity = 1; + * This is a type-conversion wrapper around `getIdentity()` + * @return {string} */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.getIdentitiesList_asB64 = function() { - return /** @type {!Array} */ (jspb.Message.bytesListAsB64( - this.getIdentitiesList())); +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.prototype.getIdentity_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getIdentity())); }; /** - * repeated bytes identities = 1; + * optional bytes identity = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getIdentitiesList()` - * @return {!Array} + * This is a type-conversion wrapper around `getIdentity()` + * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.getIdentitiesList_asU8 = function() { - return /** @type {!Array} */ (jspb.Message.bytesListAsU8( - this.getIdentitiesList())); +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.prototype.getIdentity_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getIdentity())); }; /** - * @param {!(Array|Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} returns this + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.setIdentitiesList = function(value) { - return jspb.Message.setField(this, 1, value || []); +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.prototype.setIdentity = function(value) { + return jspb.Message.setOneofField(this, 1, proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.oneofGroups_[0], value); }; /** - * @param {!(string|Uint8Array)} value - * @param {number=} opt_index - * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} returns this + * Clears the field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.addIdentities = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.prototype.clearIdentity = function() { + return jspb.Message.setOneofField(this, 1, proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.oneofGroups_[0], undefined); }; /** - * Clears the list making it empty but non-null. - * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} returns this + * Returns whether this field is set. + * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.clearIdentitiesList = function() { - return this.setIdentitiesList([]); +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.prototype.hasIdentity = function() { + return jspb.Message.getField(this, 1) != null; }; @@ -3524,7 +9000,7 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype * optional Proof proof = 2; * @return {?proto.org.dash.platform.dapi.v0.Proof} */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.getProof = function() { +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.prototype.getProof = function() { return /** @type{?proto.org.dash.platform.dapi.v0.Proof} */ ( jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.Proof, 2)); }; @@ -3532,18 +9008,18 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype /** * @param {?proto.org.dash.platform.dapi.v0.Proof|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.setProof = function(value) { - return jspb.Message.setWrapperField(this, 2, value); +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.prototype.setProof = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.oneofGroups_[0], value); }; /** * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.clearProof = function() { +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.prototype.clearProof = function() { return this.setProof(undefined); }; @@ -3552,7 +9028,7 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype * Returns whether this field is set. * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.hasProof = function() { +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.prototype.hasProof = function() { return jspb.Message.getField(this, 2) != null; }; @@ -3561,7 +9037,7 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype * optional ResponseMetadata metadata = 3; * @return {?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.getMetadata = function() { +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.prototype.getMetadata = function() { return /** @type{?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ ( jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.ResponseMetadata, 3)); }; @@ -3569,18 +9045,18 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype /** * @param {?proto.org.dash.platform.dapi.v0.ResponseMetadata|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.setMetadata = function(value) { +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.prototype.setMetadata = function(value) { return jspb.Message.setWrapperField(this, 3, value); }; /** * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.clearMetadata = function() { +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.prototype.clearMetadata = function() { return this.setMetadata(undefined); }; @@ -3589,7 +9065,7 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype * Returns whether this field is set. * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.hasMetadata = function() { +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.prototype.hasMetadata = function() { return jspb.Message.getField(this, 3) != null; }; diff --git a/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.h b/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.h index ddb096836c..1c5206ea01 100644 --- a/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.h +++ b/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.h @@ -27,14 +27,69 @@ CF_EXTERN_C_BEGIN +@class AllKeys; @class ConsensusParamsBlock; @class ConsensusParamsEvidence; +@class GPBUInt32Value; +@class GPBUInt64Value; +@class GetDataContractsResponse_DataContractEntry; +@class GetDataContractsResponse_DataContractValue; +@class GetDataContractsResponse_DataContracts; +@class GetIdentitiesKeysResponse_PublicKey; +@class GetIdentitiesKeysResponse_PublicKeyEntries; +@class GetIdentitiesKeysResponse_PublicKeyEntry; +@class GetIdentityKeysResponse_Keys; +@class KeyRequestType; @class Proof; @class ResponseMetadata; +@class SearchKey; +@class SecurityLevelMap; +@class SpecificKeys; @class StateTransitionBroadcastError; NS_ASSUME_NONNULL_BEGIN +#pragma mark - Enum SecurityLevelMap_KeyKindRequestType + +typedef GPB_ENUM(SecurityLevelMap_KeyKindRequestType) { + /** + * Value used if any message's field encounters a value that is not defined + * by this enum. The message will also have C functions to get/set the rawValue + * of the field. + **/ + SecurityLevelMap_KeyKindRequestType_GPBUnrecognizedEnumeratorValue = kGPBUnrecognizedEnumeratorValue, + SecurityLevelMap_KeyKindRequestType_CurrentKeyOfKindRequest = 0, + SecurityLevelMap_KeyKindRequestType_AllKeysOfKindRequest = 1, +}; + +GPBEnumDescriptor *SecurityLevelMap_KeyKindRequestType_EnumDescriptor(void); + +/** + * Checks to see if the given value is defined by the enum or was not known at + * the time this source was generated. + **/ +BOOL SecurityLevelMap_KeyKindRequestType_IsValidValue(int32_t value); + +#pragma mark - Enum GetIdentitiesKeysRequest_SecurityLevelMap_KeyKindRequestType + +typedef GPB_ENUM(GetIdentitiesKeysRequest_SecurityLevelMap_KeyKindRequestType) { + /** + * Value used if any message's field encounters a value that is not defined + * by this enum. The message will also have C functions to get/set the rawValue + * of the field. + **/ + GetIdentitiesKeysRequest_SecurityLevelMap_KeyKindRequestType_GPBUnrecognizedEnumeratorValue = kGPBUnrecognizedEnumeratorValue, + GetIdentitiesKeysRequest_SecurityLevelMap_KeyKindRequestType_CurrentKeyOfKindRequest = 0, +}; + +GPBEnumDescriptor *GetIdentitiesKeysRequest_SecurityLevelMap_KeyKindRequestType_EnumDescriptor(void); + +/** + * Checks to see if the given value is defined by the enum or was not known at + * the time this source was generated. + **/ +BOOL GetIdentitiesKeysRequest_SecurityLevelMap_KeyKindRequestType_IsValidValue(int32_t value); + #pragma mark - PlatformRoot /** @@ -53,7 +108,7 @@ GPB_FINAL @interface PlatformRoot : GPBRootObject #pragma mark - Proof typedef GPB_ENUM(Proof_FieldNumber) { - Proof_FieldNumber_MerkleProof = 1, + Proof_FieldNumber_GrovedbProof = 1, Proof_FieldNumber_QuorumHash = 2, Proof_FieldNumber_Signature = 3, Proof_FieldNumber_Round = 4, @@ -61,7 +116,7 @@ typedef GPB_ENUM(Proof_FieldNumber) { GPB_FINAL @interface Proof : GPBMessage -@property(nonatomic, readwrite, copy, null_resettable) NSData *merkleProof; +@property(nonatomic, readwrite, copy, null_resettable) NSData *grovedbProof; @property(nonatomic, readwrite, copy, null_resettable) NSData *quorumHash; @@ -82,7 +137,7 @@ typedef GPB_ENUM(ResponseMetadata_FieldNumber) { GPB_FINAL @interface ResponseMetadata : GPBMessage -@property(nonatomic, readwrite) int64_t height; +@property(nonatomic, readwrite) uint64_t height; @property(nonatomic, readwrite) uint32_t coreChainLockedHeight; @@ -165,6 +220,340 @@ GPB_FINAL @interface GetIdentityResponse : GPBMessage @end +#pragma mark - GetIdentityBalanceResponse + +typedef GPB_ENUM(GetIdentityBalanceResponse_FieldNumber) { + GetIdentityBalanceResponse_FieldNumber_Balance = 1, + GetIdentityBalanceResponse_FieldNumber_Proof = 2, + GetIdentityBalanceResponse_FieldNumber_Metadata = 3, +}; + +GPB_FINAL @interface GetIdentityBalanceResponse : GPBMessage + +@property(nonatomic, readwrite, strong, null_resettable) GPBUInt64Value *balance; +/** Test to see if @c balance has been set. */ +@property(nonatomic, readwrite) BOOL hasBalance; + +@property(nonatomic, readwrite, strong, null_resettable) Proof *proof; +/** Test to see if @c proof has been set. */ +@property(nonatomic, readwrite) BOOL hasProof; + +@property(nonatomic, readwrite, strong, null_resettable) ResponseMetadata *metadata; +/** Test to see if @c metadata has been set. */ +@property(nonatomic, readwrite) BOOL hasMetadata; + +@end + +#pragma mark - GetIdentityBalanceAndRevisionResponse + +typedef GPB_ENUM(GetIdentityBalanceAndRevisionResponse_FieldNumber) { + GetIdentityBalanceAndRevisionResponse_FieldNumber_Balance = 1, + GetIdentityBalanceAndRevisionResponse_FieldNumber_Revision = 2, + GetIdentityBalanceAndRevisionResponse_FieldNumber_Proof = 3, + GetIdentityBalanceAndRevisionResponse_FieldNumber_Metadata = 4, +}; + +GPB_FINAL @interface GetIdentityBalanceAndRevisionResponse : GPBMessage + +@property(nonatomic, readwrite, strong, null_resettable) GPBUInt64Value *balance; +/** Test to see if @c balance has been set. */ +@property(nonatomic, readwrite) BOOL hasBalance; + +@property(nonatomic, readwrite, strong, null_resettable) GPBUInt64Value *revision; +/** Test to see if @c revision has been set. */ +@property(nonatomic, readwrite) BOOL hasRevision; + +@property(nonatomic, readwrite, strong, null_resettable) Proof *proof; +/** Test to see if @c proof has been set. */ +@property(nonatomic, readwrite) BOOL hasProof; + +@property(nonatomic, readwrite, strong, null_resettable) ResponseMetadata *metadata; +/** Test to see if @c metadata has been set. */ +@property(nonatomic, readwrite) BOOL hasMetadata; + +@end + +#pragma mark - KeyRequestType + +typedef GPB_ENUM(KeyRequestType_FieldNumber) { + KeyRequestType_FieldNumber_AllKeys = 1, + KeyRequestType_FieldNumber_SpecificKeys = 2, + KeyRequestType_FieldNumber_SearchKey = 3, +}; + +typedef GPB_ENUM(KeyRequestType_Request_OneOfCase) { + KeyRequestType_Request_OneOfCase_GPBUnsetOneOfCase = 0, + KeyRequestType_Request_OneOfCase_AllKeys = 1, + KeyRequestType_Request_OneOfCase_SpecificKeys = 2, + KeyRequestType_Request_OneOfCase_SearchKey = 3, +}; + +GPB_FINAL @interface KeyRequestType : GPBMessage + +@property(nonatomic, readonly) KeyRequestType_Request_OneOfCase requestOneOfCase; + +@property(nonatomic, readwrite, strong, null_resettable) AllKeys *allKeys; + +@property(nonatomic, readwrite, strong, null_resettable) SpecificKeys *specificKeys; + +@property(nonatomic, readwrite, strong, null_resettable) SearchKey *searchKey; + +@end + +/** + * Clears whatever value was set for the oneof 'request'. + **/ +void KeyRequestType_ClearRequestOneOfCase(KeyRequestType *message); + +#pragma mark - AllKeys + +GPB_FINAL @interface AllKeys : GPBMessage + +@end + +#pragma mark - SpecificKeys + +typedef GPB_ENUM(SpecificKeys_FieldNumber) { + SpecificKeys_FieldNumber_KeyIdsArray = 1, +}; + +GPB_FINAL @interface SpecificKeys : GPBMessage + +@property(nonatomic, readwrite, strong, null_resettable) GPBUInt32Array *keyIdsArray; +/** The number of items in @c keyIdsArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger keyIdsArray_Count; + +@end + +#pragma mark - SearchKey + +typedef GPB_ENUM(SearchKey_FieldNumber) { + SearchKey_FieldNumber_PurposeMap = 1, +}; + +GPB_FINAL @interface SearchKey : GPBMessage + +@property(nonatomic, readwrite, strong, null_resettable) GPBUInt32ObjectDictionary *purposeMap; +/** The number of items in @c purposeMap without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger purposeMap_Count; + +@end + +#pragma mark - SecurityLevelMap + +typedef GPB_ENUM(SecurityLevelMap_FieldNumber) { + SecurityLevelMap_FieldNumber_SecurityLevelMap = 1, +}; + +GPB_FINAL @interface SecurityLevelMap : GPBMessage + +// |securityLevelMap| values are |SecurityLevelMap_KeyKindRequestType| +@property(nonatomic, readwrite, strong, null_resettable) GPBUInt32EnumDictionary *securityLevelMap; +/** The number of items in @c securityLevelMap without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger securityLevelMap_Count; + +@end + +#pragma mark - GetIdentityKeysRequest + +typedef GPB_ENUM(GetIdentityKeysRequest_FieldNumber) { + GetIdentityKeysRequest_FieldNumber_IdentityId = 1, + GetIdentityKeysRequest_FieldNumber_RequestType = 2, + GetIdentityKeysRequest_FieldNumber_Limit = 3, + GetIdentityKeysRequest_FieldNumber_Offset = 4, + GetIdentityKeysRequest_FieldNumber_Prove = 5, +}; + +GPB_FINAL @interface GetIdentityKeysRequest : GPBMessage + +@property(nonatomic, readwrite, copy, null_resettable) NSData *identityId; + +@property(nonatomic, readwrite, strong, null_resettable) KeyRequestType *requestType; +/** Test to see if @c requestType has been set. */ +@property(nonatomic, readwrite) BOOL hasRequestType; + +@property(nonatomic, readwrite, strong, null_resettable) GPBUInt32Value *limit; +/** Test to see if @c limit has been set. */ +@property(nonatomic, readwrite) BOOL hasLimit; + +@property(nonatomic, readwrite, strong, null_resettable) GPBUInt32Value *offset; +/** Test to see if @c offset has been set. */ +@property(nonatomic, readwrite) BOOL hasOffset; + +@property(nonatomic, readwrite) BOOL prove; + +@end + +#pragma mark - GetIdentityKeysResponse + +typedef GPB_ENUM(GetIdentityKeysResponse_FieldNumber) { + GetIdentityKeysResponse_FieldNumber_Keys = 1, + GetIdentityKeysResponse_FieldNumber_Proof = 2, + GetIdentityKeysResponse_FieldNumber_Metadata = 3, +}; + +typedef GPB_ENUM(GetIdentityKeysResponse_Result_OneOfCase) { + GetIdentityKeysResponse_Result_OneOfCase_GPBUnsetOneOfCase = 0, + GetIdentityKeysResponse_Result_OneOfCase_Keys = 1, + GetIdentityKeysResponse_Result_OneOfCase_Proof = 2, +}; + +GPB_FINAL @interface GetIdentityKeysResponse : GPBMessage + +@property(nonatomic, readonly) GetIdentityKeysResponse_Result_OneOfCase resultOneOfCase; + +@property(nonatomic, readwrite, strong, null_resettable) GetIdentityKeysResponse_Keys *keys; + +@property(nonatomic, readwrite, strong, null_resettable) Proof *proof; + +@property(nonatomic, readwrite, strong, null_resettable) ResponseMetadata *metadata; +/** Test to see if @c metadata has been set. */ +@property(nonatomic, readwrite) BOOL hasMetadata; + +@end + +/** + * Clears whatever value was set for the oneof 'result'. + **/ +void GetIdentityKeysResponse_ClearResultOneOfCase(GetIdentityKeysResponse *message); + +#pragma mark - GetIdentityKeysResponse_Keys + +typedef GPB_ENUM(GetIdentityKeysResponse_Keys_FieldNumber) { + GetIdentityKeysResponse_Keys_FieldNumber_KeysBytesArray = 1, +}; + +GPB_FINAL @interface GetIdentityKeysResponse_Keys : GPBMessage + +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *keysBytesArray; +/** The number of items in @c keysBytesArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger keysBytesArray_Count; + +@end + +#pragma mark - GetIdentitiesKeysRequest + +typedef GPB_ENUM(GetIdentitiesKeysRequest_FieldNumber) { + GetIdentitiesKeysRequest_FieldNumber_IdentityIdsArray = 1, + GetIdentitiesKeysRequest_FieldNumber_RequestType = 2, + GetIdentitiesKeysRequest_FieldNumber_Limit = 3, + GetIdentitiesKeysRequest_FieldNumber_Offset = 4, + GetIdentitiesKeysRequest_FieldNumber_Prove = 5, +}; + +GPB_FINAL @interface GetIdentitiesKeysRequest : GPBMessage + +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *identityIdsArray; +/** The number of items in @c identityIdsArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger identityIdsArray_Count; + +@property(nonatomic, readwrite, strong, null_resettable) KeyRequestType *requestType; +/** Test to see if @c requestType has been set. */ +@property(nonatomic, readwrite) BOOL hasRequestType; + +@property(nonatomic, readwrite, strong, null_resettable) GPBUInt32Value *limit; +/** Test to see if @c limit has been set. */ +@property(nonatomic, readwrite) BOOL hasLimit; + +@property(nonatomic, readwrite, strong, null_resettable) GPBUInt32Value *offset; +/** Test to see if @c offset has been set. */ +@property(nonatomic, readwrite) BOOL hasOffset; + +@property(nonatomic, readwrite) BOOL prove; + +@end + +#pragma mark - GetIdentitiesKeysRequest_SecurityLevelMap + +typedef GPB_ENUM(GetIdentitiesKeysRequest_SecurityLevelMap_FieldNumber) { + GetIdentitiesKeysRequest_SecurityLevelMap_FieldNumber_SecurityLevelMap = 1, +}; + +GPB_FINAL @interface GetIdentitiesKeysRequest_SecurityLevelMap : GPBMessage + +// |securityLevelMap| values are |GetIdentitiesKeysRequest_SecurityLevelMap_KeyKindRequestType| +@property(nonatomic, readwrite, strong, null_resettable) GPBUInt32EnumDictionary *securityLevelMap; +/** The number of items in @c securityLevelMap without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger securityLevelMap_Count; + +@end + +#pragma mark - GetIdentitiesKeysResponse + +typedef GPB_ENUM(GetIdentitiesKeysResponse_FieldNumber) { + GetIdentitiesKeysResponse_FieldNumber_PublicKeys = 1, + GetIdentitiesKeysResponse_FieldNumber_Proof = 2, + GetIdentitiesKeysResponse_FieldNumber_Metadata = 3, +}; + +typedef GPB_ENUM(GetIdentitiesKeysResponse_Result_OneOfCase) { + GetIdentitiesKeysResponse_Result_OneOfCase_GPBUnsetOneOfCase = 0, + GetIdentitiesKeysResponse_Result_OneOfCase_PublicKeys = 1, + GetIdentitiesKeysResponse_Result_OneOfCase_Proof = 2, +}; + +GPB_FINAL @interface GetIdentitiesKeysResponse : GPBMessage + +@property(nonatomic, readonly) GetIdentitiesKeysResponse_Result_OneOfCase resultOneOfCase; + +@property(nonatomic, readwrite, strong, null_resettable) GetIdentitiesKeysResponse_PublicKeyEntries *publicKeys; + +@property(nonatomic, readwrite, strong, null_resettable) Proof *proof; + +@property(nonatomic, readwrite, strong, null_resettable) ResponseMetadata *metadata; +/** Test to see if @c metadata has been set. */ +@property(nonatomic, readwrite) BOOL hasMetadata; + +@end + +/** + * Clears whatever value was set for the oneof 'result'. + **/ +void GetIdentitiesKeysResponse_ClearResultOneOfCase(GetIdentitiesKeysResponse *message); + +#pragma mark - GetIdentitiesKeysResponse_PublicKey + +typedef GPB_ENUM(GetIdentitiesKeysResponse_PublicKey_FieldNumber) { + GetIdentitiesKeysResponse_PublicKey_FieldNumber_Value = 1, +}; + +GPB_FINAL @interface GetIdentitiesKeysResponse_PublicKey : GPBMessage + +@property(nonatomic, readwrite, copy, null_resettable) NSData *value; + +@end + +#pragma mark - GetIdentitiesKeysResponse_PublicKeyEntry + +typedef GPB_ENUM(GetIdentitiesKeysResponse_PublicKeyEntry_FieldNumber) { + GetIdentitiesKeysResponse_PublicKeyEntry_FieldNumber_Key = 1, + GetIdentitiesKeysResponse_PublicKeyEntry_FieldNumber_Value = 2, +}; + +GPB_FINAL @interface GetIdentitiesKeysResponse_PublicKeyEntry : GPBMessage + +@property(nonatomic, readwrite, copy, null_resettable) NSData *key; + +@property(nonatomic, readwrite, strong, null_resettable) GetIdentitiesKeysResponse_PublicKey *value; +/** Test to see if @c value has been set. */ +@property(nonatomic, readwrite) BOOL hasValue; + +@end + +#pragma mark - GetIdentitiesKeysResponse_PublicKeyEntries + +typedef GPB_ENUM(GetIdentitiesKeysResponse_PublicKeyEntries_FieldNumber) { + GetIdentitiesKeysResponse_PublicKeyEntries_FieldNumber_PublicKeyEntriesArray = 1, +}; + +GPB_FINAL @interface GetIdentitiesKeysResponse_PublicKeyEntries : GPBMessage + +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *publicKeyEntriesArray; +/** The number of items in @c publicKeyEntriesArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger publicKeyEntriesArray_Count; + +@end + #pragma mark - GetDataContractRequest typedef GPB_ENUM(GetDataContractRequest_FieldNumber) { @@ -202,6 +591,99 @@ GPB_FINAL @interface GetDataContractResponse : GPBMessage @end +#pragma mark - GetDataContractsRequest + +typedef GPB_ENUM(GetDataContractsRequest_FieldNumber) { + GetDataContractsRequest_FieldNumber_IdsArray = 1, + GetDataContractsRequest_FieldNumber_Prove = 2, +}; + +GPB_FINAL @interface GetDataContractsRequest : GPBMessage + +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *idsArray; +/** The number of items in @c idsArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger idsArray_Count; + +@property(nonatomic, readwrite) BOOL prove; + +@end + +#pragma mark - GetDataContractsResponse + +typedef GPB_ENUM(GetDataContractsResponse_FieldNumber) { + GetDataContractsResponse_FieldNumber_DataContracts = 1, + GetDataContractsResponse_FieldNumber_Proof = 2, + GetDataContractsResponse_FieldNumber_Metadata = 3, +}; + +typedef GPB_ENUM(GetDataContractsResponse_Result_OneOfCase) { + GetDataContractsResponse_Result_OneOfCase_GPBUnsetOneOfCase = 0, + GetDataContractsResponse_Result_OneOfCase_DataContracts = 1, + GetDataContractsResponse_Result_OneOfCase_Proof = 2, +}; + +GPB_FINAL @interface GetDataContractsResponse : GPBMessage + +@property(nonatomic, readonly) GetDataContractsResponse_Result_OneOfCase resultOneOfCase; + +@property(nonatomic, readwrite, strong, null_resettable) GetDataContractsResponse_DataContracts *dataContracts; + +@property(nonatomic, readwrite, strong, null_resettable) Proof *proof; + +@property(nonatomic, readwrite, strong, null_resettable) ResponseMetadata *metadata; +/** Test to see if @c metadata has been set. */ +@property(nonatomic, readwrite) BOOL hasMetadata; + +@end + +/** + * Clears whatever value was set for the oneof 'result'. + **/ +void GetDataContractsResponse_ClearResultOneOfCase(GetDataContractsResponse *message); + +#pragma mark - GetDataContractsResponse_DataContractValue + +typedef GPB_ENUM(GetDataContractsResponse_DataContractValue_FieldNumber) { + GetDataContractsResponse_DataContractValue_FieldNumber_Value = 1, +}; + +GPB_FINAL @interface GetDataContractsResponse_DataContractValue : GPBMessage + +@property(nonatomic, readwrite, copy, null_resettable) NSData *value; + +@end + +#pragma mark - GetDataContractsResponse_DataContractEntry + +typedef GPB_ENUM(GetDataContractsResponse_DataContractEntry_FieldNumber) { + GetDataContractsResponse_DataContractEntry_FieldNumber_Key = 1, + GetDataContractsResponse_DataContractEntry_FieldNumber_Value = 2, +}; + +GPB_FINAL @interface GetDataContractsResponse_DataContractEntry : GPBMessage + +@property(nonatomic, readwrite, copy, null_resettable) NSData *key; + +@property(nonatomic, readwrite, strong, null_resettable) GetDataContractsResponse_DataContractValue *value; +/** Test to see if @c value has been set. */ +@property(nonatomic, readwrite) BOOL hasValue; + +@end + +#pragma mark - GetDataContractsResponse_DataContracts + +typedef GPB_ENUM(GetDataContractsResponse_DataContracts_FieldNumber) { + GetDataContractsResponse_DataContracts_FieldNumber_DataContractEntriesArray = 1, +}; + +GPB_FINAL @interface GetDataContractsResponse_DataContracts : GPBMessage + +@property(nonatomic, readwrite, strong, null_resettable) NSMutableArray *dataContractEntriesArray; +/** The number of items in @c dataContractEntriesArray without causing the array to be created. */ +@property(nonatomic, readonly) NSUInteger dataContractEntriesArray_Count; + +@end + #pragma mark - GetDocumentsRequest typedef GPB_ENUM(GetDocumentsRequest_FieldNumber) { @@ -313,6 +795,54 @@ GPB_FINAL @interface GetIdentitiesByPublicKeyHashesResponse : GPBMessage @end +#pragma mark - GetIdentityByPublicKeyHashesRequest + +typedef GPB_ENUM(GetIdentityByPublicKeyHashesRequest_FieldNumber) { + GetIdentityByPublicKeyHashesRequest_FieldNumber_PublicKeyHash = 1, + GetIdentityByPublicKeyHashesRequest_FieldNumber_Prove = 2, +}; + +GPB_FINAL @interface GetIdentityByPublicKeyHashesRequest : GPBMessage + +@property(nonatomic, readwrite, copy, null_resettable) NSData *publicKeyHash; + +@property(nonatomic, readwrite) BOOL prove; + +@end + +#pragma mark - GetIdentityByPublicKeyHashesResponse + +typedef GPB_ENUM(GetIdentityByPublicKeyHashesResponse_FieldNumber) { + GetIdentityByPublicKeyHashesResponse_FieldNumber_Identity = 1, + GetIdentityByPublicKeyHashesResponse_FieldNumber_Proof = 2, + GetIdentityByPublicKeyHashesResponse_FieldNumber_Metadata = 3, +}; + +typedef GPB_ENUM(GetIdentityByPublicKeyHashesResponse_Result_OneOfCase) { + GetIdentityByPublicKeyHashesResponse_Result_OneOfCase_GPBUnsetOneOfCase = 0, + GetIdentityByPublicKeyHashesResponse_Result_OneOfCase_Identity = 1, + GetIdentityByPublicKeyHashesResponse_Result_OneOfCase_Proof = 2, +}; + +GPB_FINAL @interface GetIdentityByPublicKeyHashesResponse : GPBMessage + +@property(nonatomic, readonly) GetIdentityByPublicKeyHashesResponse_Result_OneOfCase resultOneOfCase; + +@property(nonatomic, readwrite, copy, null_resettable) NSData *identity; + +@property(nonatomic, readwrite, strong, null_resettable) Proof *proof; + +@property(nonatomic, readwrite, strong, null_resettable) ResponseMetadata *metadata; +/** Test to see if @c metadata has been set. */ +@property(nonatomic, readwrite) BOOL hasMetadata; + +@end + +/** + * Clears whatever value was set for the oneof 'result'. + **/ +void GetIdentityByPublicKeyHashesResponse_ClearResultOneOfCase(GetIdentityByPublicKeyHashesResponse *message); + #pragma mark - WaitForStateTransitionResultRequest typedef GPB_ENUM(WaitForStateTransitionResultRequest_FieldNumber) { diff --git a/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.m b/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.m index 02e866cf59..5f2d44a09a 100644 --- a/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.m +++ b/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbobjc.m @@ -13,6 +13,8 @@ #import "GPBProtocolBuffers_RuntimeSupport.h" #endif +#import + #import "Platform.pbobjc.h" // @@protoc_insertion_point(imports) @@ -25,10 +27,29 @@ // Forward declarations of Objective C classes that we can use as // static values in struct initializers. // We don't use [Foo class] because it is not a static value. +GPBObjCClassDeclaration(AllKeys); GPBObjCClassDeclaration(ConsensusParamsBlock); GPBObjCClassDeclaration(ConsensusParamsEvidence); +GPBObjCClassDeclaration(GPBUInt32Value); +GPBObjCClassDeclaration(GPBUInt64Value); +GPBObjCClassDeclaration(GetDataContractsResponse); +GPBObjCClassDeclaration(GetDataContractsResponse_DataContractEntry); +GPBObjCClassDeclaration(GetDataContractsResponse_DataContractValue); +GPBObjCClassDeclaration(GetDataContractsResponse_DataContracts); +GPBObjCClassDeclaration(GetIdentitiesKeysRequest); +GPBObjCClassDeclaration(GetIdentitiesKeysRequest_SecurityLevelMap); +GPBObjCClassDeclaration(GetIdentitiesKeysResponse); +GPBObjCClassDeclaration(GetIdentitiesKeysResponse_PublicKey); +GPBObjCClassDeclaration(GetIdentitiesKeysResponse_PublicKeyEntries); +GPBObjCClassDeclaration(GetIdentitiesKeysResponse_PublicKeyEntry); +GPBObjCClassDeclaration(GetIdentityKeysResponse); +GPBObjCClassDeclaration(GetIdentityKeysResponse_Keys); +GPBObjCClassDeclaration(KeyRequestType); GPBObjCClassDeclaration(Proof); GPBObjCClassDeclaration(ResponseMetadata); +GPBObjCClassDeclaration(SearchKey); +GPBObjCClassDeclaration(SecurityLevelMap); +GPBObjCClassDeclaration(SpecificKeys); GPBObjCClassDeclaration(StateTransitionBroadcastError); #pragma mark - PlatformRoot @@ -58,7 +79,7 @@ @implementation PlatformRoot @implementation Proof -@dynamic merkleProof; +@dynamic grovedbProof; @dynamic quorumHash; @dynamic signature; @dynamic round; @@ -66,7 +87,7 @@ @implementation Proof typedef struct Proof__storage_ { uint32_t _has_storage_[1]; uint32_t round; - NSData *merkleProof; + NSData *grovedbProof; NSData *quorumHash; NSData *signature; } Proof__storage_; @@ -78,11 +99,11 @@ + (GPBDescriptor *)descriptor { if (!descriptor) { static GPBMessageFieldDescription fields[] = { { - .name = "merkleProof", + .name = "grovedbProof", .dataTypeSpecific.clazz = Nil, - .number = Proof_FieldNumber_MerkleProof, + .number = Proof_FieldNumber_GrovedbProof, .hasIndex = 0, - .offset = (uint32_t)offsetof(Proof__storage_, merkleProof), + .offset = (uint32_t)offsetof(Proof__storage_, grovedbProof), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), .dataType = GPBDataTypeBytes, }, @@ -145,7 +166,7 @@ @implementation ResponseMetadata uint32_t _has_storage_[1]; uint32_t coreChainLockedHeight; uint32_t protocolVersion; - int64_t height; + uint64_t height; uint64_t timeMs; } ResponseMetadata__storage_; @@ -162,7 +183,7 @@ + (GPBDescriptor *)descriptor { .hasIndex = 0, .offset = (uint32_t)offsetof(ResponseMetadata__storage_, height), .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), - .dataType = GPBDataTypeInt64, + .dataType = GPBDataTypeUInt64, }, { .name = "coreChainLockedHeight", @@ -476,17 +497,20 @@ + (GPBDescriptor *)descriptor { @end -#pragma mark - GetDataContractRequest +#pragma mark - GetIdentityBalanceResponse -@implementation GetDataContractRequest +@implementation GetIdentityBalanceResponse -@dynamic id_p; -@dynamic prove; +@dynamic hasBalance, balance; +@dynamic hasProof, proof; +@dynamic hasMetadata, metadata; -typedef struct GetDataContractRequest__storage_ { +typedef struct GetIdentityBalanceResponse__storage_ { uint32_t _has_storage_[1]; - NSData *id_p; -} GetDataContractRequest__storage_; + GPBUInt64Value *balance; + Proof *proof; + ResponseMetadata *metadata; +} GetIdentityBalanceResponse__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. @@ -495,31 +519,40 @@ + (GPBDescriptor *)descriptor { if (!descriptor) { static GPBMessageFieldDescription fields[] = { { - .name = "id_p", - .dataTypeSpecific.clazz = Nil, - .number = GetDataContractRequest_FieldNumber_Id_p, + .name = "balance", + .dataTypeSpecific.clazz = GPBObjCClass(GPBUInt64Value), + .number = GetIdentityBalanceResponse_FieldNumber_Balance, .hasIndex = 0, - .offset = (uint32_t)offsetof(GetDataContractRequest__storage_, id_p), - .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), - .dataType = GPBDataTypeBytes, + .offset = (uint32_t)offsetof(GetIdentityBalanceResponse__storage_, balance), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, }, { - .name = "prove", - .dataTypeSpecific.clazz = Nil, - .number = GetDataContractRequest_FieldNumber_Prove, + .name = "proof", + .dataTypeSpecific.clazz = GPBObjCClass(Proof), + .number = GetIdentityBalanceResponse_FieldNumber_Proof, .hasIndex = 1, - .offset = 2, // Stored in _has_storage_ to save space. - .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), - .dataType = GPBDataTypeBool, + .offset = (uint32_t)offsetof(GetIdentityBalanceResponse__storage_, proof), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "metadata", + .dataTypeSpecific.clazz = GPBObjCClass(ResponseMetadata), + .number = GetIdentityBalanceResponse_FieldNumber_Metadata, + .hasIndex = 2, + .offset = (uint32_t)offsetof(GetIdentityBalanceResponse__storage_, metadata), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, }, }; GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GetDataContractRequest class] + [GPBDescriptor allocDescriptorForClass:[GetIdentityBalanceResponse class] rootClass:[PlatformRoot class] file:PlatformRoot_FileDescriptor() fields:fields fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GetDataContractRequest__storage_) + storageSize:sizeof(GetIdentityBalanceResponse__storage_) flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; #if defined(DEBUG) && DEBUG NSAssert(descriptor == nil, @"Startup recursed!"); @@ -531,20 +564,22 @@ + (GPBDescriptor *)descriptor { @end -#pragma mark - GetDataContractResponse +#pragma mark - GetIdentityBalanceAndRevisionResponse -@implementation GetDataContractResponse +@implementation GetIdentityBalanceAndRevisionResponse -@dynamic dataContract; +@dynamic hasBalance, balance; +@dynamic hasRevision, revision; @dynamic hasProof, proof; @dynamic hasMetadata, metadata; -typedef struct GetDataContractResponse__storage_ { +typedef struct GetIdentityBalanceAndRevisionResponse__storage_ { uint32_t _has_storage_[1]; - NSData *dataContract; + GPBUInt64Value *balance; + GPBUInt64Value *revision; Proof *proof; ResponseMetadata *metadata; -} GetDataContractResponse__storage_; +} GetIdentityBalanceAndRevisionResponse__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. @@ -553,40 +588,49 @@ + (GPBDescriptor *)descriptor { if (!descriptor) { static GPBMessageFieldDescription fields[] = { { - .name = "dataContract", - .dataTypeSpecific.clazz = Nil, - .number = GetDataContractResponse_FieldNumber_DataContract, + .name = "balance", + .dataTypeSpecific.clazz = GPBObjCClass(GPBUInt64Value), + .number = GetIdentityBalanceAndRevisionResponse_FieldNumber_Balance, .hasIndex = 0, - .offset = (uint32_t)offsetof(GetDataContractResponse__storage_, dataContract), - .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), - .dataType = GPBDataTypeBytes, + .offset = (uint32_t)offsetof(GetIdentityBalanceAndRevisionResponse__storage_, balance), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "revision", + .dataTypeSpecific.clazz = GPBObjCClass(GPBUInt64Value), + .number = GetIdentityBalanceAndRevisionResponse_FieldNumber_Revision, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GetIdentityBalanceAndRevisionResponse__storage_, revision), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, }, { .name = "proof", .dataTypeSpecific.clazz = GPBObjCClass(Proof), - .number = GetDataContractResponse_FieldNumber_Proof, - .hasIndex = 1, - .offset = (uint32_t)offsetof(GetDataContractResponse__storage_, proof), + .number = GetIdentityBalanceAndRevisionResponse_FieldNumber_Proof, + .hasIndex = 2, + .offset = (uint32_t)offsetof(GetIdentityBalanceAndRevisionResponse__storage_, proof), .flags = GPBFieldOptional, .dataType = GPBDataTypeMessage, }, { .name = "metadata", .dataTypeSpecific.clazz = GPBObjCClass(ResponseMetadata), - .number = GetDataContractResponse_FieldNumber_Metadata, - .hasIndex = 2, - .offset = (uint32_t)offsetof(GetDataContractResponse__storage_, metadata), + .number = GetIdentityBalanceAndRevisionResponse_FieldNumber_Metadata, + .hasIndex = 3, + .offset = (uint32_t)offsetof(GetIdentityBalanceAndRevisionResponse__storage_, metadata), .flags = GPBFieldOptional, .dataType = GPBDataTypeMessage, }, }; GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GetDataContractResponse class] + [GPBDescriptor allocDescriptorForClass:[GetIdentityBalanceAndRevisionResponse class] rootClass:[PlatformRoot class] file:PlatformRoot_FileDescriptor() fields:fields fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GetDataContractResponse__storage_) + storageSize:sizeof(GetIdentityBalanceAndRevisionResponse__storage_) flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; #if defined(DEBUG) && DEBUG NSAssert(descriptor == nil, @"Startup recursed!"); @@ -598,30 +642,21 @@ + (GPBDescriptor *)descriptor { @end -#pragma mark - GetDocumentsRequest +#pragma mark - KeyRequestType -@implementation GetDocumentsRequest +@implementation KeyRequestType -@dynamic startOneOfCase; -@dynamic dataContractId; -@dynamic documentType; -@dynamic where; -@dynamic orderBy; -@dynamic limit; -@dynamic startAfter; -@dynamic startAt; -@dynamic prove; +@dynamic requestOneOfCase; +@dynamic allKeys; +@dynamic specificKeys; +@dynamic searchKey; -typedef struct GetDocumentsRequest__storage_ { +typedef struct KeyRequestType__storage_ { uint32_t _has_storage_[2]; - uint32_t limit; - NSData *dataContractId; - NSString *documentType; - NSData *where; - NSData *orderBy; - NSData *startAfter; - NSData *startAt; -} GetDocumentsRequest__storage_; + AllKeys *allKeys; + SpecificKeys *specificKeys; + SearchKey *searchKey; +} KeyRequestType__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. @@ -630,88 +665,43 @@ + (GPBDescriptor *)descriptor { if (!descriptor) { static GPBMessageFieldDescription fields[] = { { - .name = "dataContractId", - .dataTypeSpecific.clazz = Nil, - .number = GetDocumentsRequest_FieldNumber_DataContractId, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GetDocumentsRequest__storage_, dataContractId), - .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), - .dataType = GPBDataTypeBytes, - }, - { - .name = "documentType", - .dataTypeSpecific.clazz = Nil, - .number = GetDocumentsRequest_FieldNumber_DocumentType, - .hasIndex = 1, - .offset = (uint32_t)offsetof(GetDocumentsRequest__storage_, documentType), - .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), - .dataType = GPBDataTypeString, - }, - { - .name = "where", - .dataTypeSpecific.clazz = Nil, - .number = GetDocumentsRequest_FieldNumber_Where, - .hasIndex = 2, - .offset = (uint32_t)offsetof(GetDocumentsRequest__storage_, where), - .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), - .dataType = GPBDataTypeBytes, - }, - { - .name = "orderBy", - .dataTypeSpecific.clazz = Nil, - .number = GetDocumentsRequest_FieldNumber_OrderBy, - .hasIndex = 3, - .offset = (uint32_t)offsetof(GetDocumentsRequest__storage_, orderBy), - .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), - .dataType = GPBDataTypeBytes, - }, - { - .name = "limit", - .dataTypeSpecific.clazz = Nil, - .number = GetDocumentsRequest_FieldNumber_Limit, - .hasIndex = 4, - .offset = (uint32_t)offsetof(GetDocumentsRequest__storage_, limit), - .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), - .dataType = GPBDataTypeUInt32, - }, - { - .name = "startAfter", - .dataTypeSpecific.clazz = Nil, - .number = GetDocumentsRequest_FieldNumber_StartAfter, + .name = "allKeys", + .dataTypeSpecific.clazz = GPBObjCClass(AllKeys), + .number = KeyRequestType_FieldNumber_AllKeys, .hasIndex = -1, - .offset = (uint32_t)offsetof(GetDocumentsRequest__storage_, startAfter), + .offset = (uint32_t)offsetof(KeyRequestType__storage_, allKeys), .flags = GPBFieldOptional, - .dataType = GPBDataTypeBytes, + .dataType = GPBDataTypeMessage, }, { - .name = "startAt", - .dataTypeSpecific.clazz = Nil, - .number = GetDocumentsRequest_FieldNumber_StartAt, + .name = "specificKeys", + .dataTypeSpecific.clazz = GPBObjCClass(SpecificKeys), + .number = KeyRequestType_FieldNumber_SpecificKeys, .hasIndex = -1, - .offset = (uint32_t)offsetof(GetDocumentsRequest__storage_, startAt), + .offset = (uint32_t)offsetof(KeyRequestType__storage_, specificKeys), .flags = GPBFieldOptional, - .dataType = GPBDataTypeBytes, + .dataType = GPBDataTypeMessage, }, { - .name = "prove", - .dataTypeSpecific.clazz = Nil, - .number = GetDocumentsRequest_FieldNumber_Prove, - .hasIndex = 5, - .offset = 6, // Stored in _has_storage_ to save space. - .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), - .dataType = GPBDataTypeBool, + .name = "searchKey", + .dataTypeSpecific.clazz = GPBObjCClass(SearchKey), + .number = KeyRequestType_FieldNumber_SearchKey, + .hasIndex = -1, + .offset = (uint32_t)offsetof(KeyRequestType__storage_, searchKey), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, }, }; GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GetDocumentsRequest class] + [GPBDescriptor allocDescriptorForClass:[KeyRequestType class] rootClass:[PlatformRoot class] file:PlatformRoot_FileDescriptor() fields:fields fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GetDocumentsRequest__storage_) + storageSize:sizeof(KeyRequestType__storage_) flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; static const char *oneofs[] = { - "start", + "request", }; [localDescriptor setupOneofs:oneofs count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) @@ -726,67 +716,32 @@ + (GPBDescriptor *)descriptor { @end -void GetDocumentsRequest_ClearStartOneOfCase(GetDocumentsRequest *message) { - GPBDescriptor *descriptor = [GetDocumentsRequest descriptor]; +void KeyRequestType_ClearRequestOneOfCase(KeyRequestType *message) { + GPBDescriptor *descriptor = [KeyRequestType descriptor]; GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; GPBClearOneof(message, oneof); } -#pragma mark - GetDocumentsResponse +#pragma mark - AllKeys -@implementation GetDocumentsResponse +@implementation AllKeys -@dynamic documentsArray, documentsArray_Count; -@dynamic hasProof, proof; -@dynamic hasMetadata, metadata; -typedef struct GetDocumentsResponse__storage_ { +typedef struct AllKeys__storage_ { uint32_t _has_storage_[1]; - NSMutableArray *documentsArray; - Proof *proof; - ResponseMetadata *metadata; -} GetDocumentsResponse__storage_; +} AllKeys__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. + (GPBDescriptor *)descriptor { static GPBDescriptor *descriptor = nil; if (!descriptor) { - static GPBMessageFieldDescription fields[] = { - { - .name = "documentsArray", - .dataTypeSpecific.clazz = Nil, - .number = GetDocumentsResponse_FieldNumber_DocumentsArray, - .hasIndex = GPBNoHasBit, - .offset = (uint32_t)offsetof(GetDocumentsResponse__storage_, documentsArray), - .flags = GPBFieldRepeated, - .dataType = GPBDataTypeBytes, - }, - { - .name = "proof", - .dataTypeSpecific.clazz = GPBObjCClass(Proof), - .number = GetDocumentsResponse_FieldNumber_Proof, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GetDocumentsResponse__storage_, proof), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - { - .name = "metadata", - .dataTypeSpecific.clazz = GPBObjCClass(ResponseMetadata), - .number = GetDocumentsResponse_FieldNumber_Metadata, - .hasIndex = 1, - .offset = (uint32_t)offsetof(GetDocumentsResponse__storage_, metadata), - .flags = GPBFieldOptional, - .dataType = GPBDataTypeMessage, - }, - }; GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GetDocumentsResponse class] + [GPBDescriptor allocDescriptorForClass:[AllKeys class] rootClass:[PlatformRoot class] file:PlatformRoot_FileDescriptor() - fields:fields - fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GetDocumentsResponse__storage_) + fields:NULL + fieldCount:0 + storageSize:sizeof(AllKeys__storage_) flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; #if defined(DEBUG) && DEBUG NSAssert(descriptor == nil, @"Startup recursed!"); @@ -798,17 +753,16 @@ + (GPBDescriptor *)descriptor { @end -#pragma mark - GetIdentitiesByPublicKeyHashesRequest +#pragma mark - SpecificKeys -@implementation GetIdentitiesByPublicKeyHashesRequest +@implementation SpecificKeys -@dynamic publicKeyHashesArray, publicKeyHashesArray_Count; -@dynamic prove; +@dynamic keyIdsArray, keyIdsArray_Count; -typedef struct GetIdentitiesByPublicKeyHashesRequest__storage_ { +typedef struct SpecificKeys__storage_ { uint32_t _has_storage_[1]; - NSMutableArray *publicKeyHashesArray; -} GetIdentitiesByPublicKeyHashesRequest__storage_; + GPBUInt32Array *keyIdsArray; +} SpecificKeys__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. @@ -817,31 +771,22 @@ + (GPBDescriptor *)descriptor { if (!descriptor) { static GPBMessageFieldDescription fields[] = { { - .name = "publicKeyHashesArray", + .name = "keyIdsArray", .dataTypeSpecific.clazz = Nil, - .number = GetIdentitiesByPublicKeyHashesRequest_FieldNumber_PublicKeyHashesArray, + .number = SpecificKeys_FieldNumber_KeyIdsArray, .hasIndex = GPBNoHasBit, - .offset = (uint32_t)offsetof(GetIdentitiesByPublicKeyHashesRequest__storage_, publicKeyHashesArray), - .flags = GPBFieldRepeated, - .dataType = GPBDataTypeBytes, - }, - { - .name = "prove", - .dataTypeSpecific.clazz = Nil, - .number = GetIdentitiesByPublicKeyHashesRequest_FieldNumber_Prove, - .hasIndex = 0, - .offset = 1, // Stored in _has_storage_ to save space. - .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), - .dataType = GPBDataTypeBool, + .offset = (uint32_t)offsetof(SpecificKeys__storage_, keyIdsArray), + .flags = (GPBFieldFlags)(GPBFieldRepeated | GPBFieldPacked), + .dataType = GPBDataTypeUInt32, }, }; GPBDescriptor *localDescriptor = - [GPBDescriptor allocDescriptorForClass:[GetIdentitiesByPublicKeyHashesRequest class] + [GPBDescriptor allocDescriptorForClass:[SpecificKeys class] rootClass:[PlatformRoot class] file:PlatformRoot_FileDescriptor() fields:fields fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) - storageSize:sizeof(GetIdentitiesByPublicKeyHashesRequest__storage_) + storageSize:sizeof(SpecificKeys__storage_) flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; #if defined(DEBUG) && DEBUG NSAssert(descriptor == nil, @"Startup recursed!"); @@ -853,20 +798,16 @@ + (GPBDescriptor *)descriptor { @end -#pragma mark - GetIdentitiesByPublicKeyHashesResponse +#pragma mark - SearchKey -@implementation GetIdentitiesByPublicKeyHashesResponse +@implementation SearchKey -@dynamic identitiesArray, identitiesArray_Count; -@dynamic hasProof, proof; -@dynamic hasMetadata, metadata; +@dynamic purposeMap, purposeMap_Count; -typedef struct GetIdentitiesByPublicKeyHashesResponse__storage_ { +typedef struct SearchKey__storage_ { uint32_t _has_storage_[1]; - NSMutableArray *identitiesArray; - Proof *proof; - ResponseMetadata *metadata; -} GetIdentitiesByPublicKeyHashesResponse__storage_; + GPBUInt32ObjectDictionary *purposeMap; +} SearchKey__storage_; // This method is threadsafe because it is initially called // in +initialize for each subclass. @@ -875,21 +816,1419 @@ + (GPBDescriptor *)descriptor { if (!descriptor) { static GPBMessageFieldDescription fields[] = { { - .name = "identitiesArray", - .dataTypeSpecific.clazz = Nil, - .number = GetIdentitiesByPublicKeyHashesResponse_FieldNumber_IdentitiesArray, + .name = "purposeMap", + .dataTypeSpecific.clazz = GPBObjCClass(SecurityLevelMap), + .number = SearchKey_FieldNumber_PurposeMap, .hasIndex = GPBNoHasBit, - .offset = (uint32_t)offsetof(GetIdentitiesByPublicKeyHashesResponse__storage_, identitiesArray), - .flags = GPBFieldRepeated, - .dataType = GPBDataTypeBytes, - }, - { - .name = "proof", - .dataTypeSpecific.clazz = GPBObjCClass(Proof), - .number = GetIdentitiesByPublicKeyHashesResponse_FieldNumber_Proof, - .hasIndex = 0, - .offset = (uint32_t)offsetof(GetIdentitiesByPublicKeyHashesResponse__storage_, proof), - .flags = GPBFieldOptional, + .offset = (uint32_t)offsetof(SearchKey__storage_, purposeMap), + .flags = GPBFieldMapKeyUInt32, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[SearchKey class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(SearchKey__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - SecurityLevelMap + +@implementation SecurityLevelMap + +@dynamic securityLevelMap, securityLevelMap_Count; + +typedef struct SecurityLevelMap__storage_ { + uint32_t _has_storage_[1]; + GPBUInt32EnumDictionary *securityLevelMap; +} SecurityLevelMap__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "securityLevelMap", + .dataTypeSpecific.enumDescFunc = SecurityLevelMap_KeyKindRequestType_EnumDescriptor, + .number = SecurityLevelMap_FieldNumber_SecurityLevelMap, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(SecurityLevelMap__storage_, securityLevelMap), + .flags = (GPBFieldFlags)(GPBFieldMapKeyUInt32 | GPBFieldHasEnumDescriptor), + .dataType = GPBDataTypeEnum, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[SecurityLevelMap class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(SecurityLevelMap__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - Enum SecurityLevelMap_KeyKindRequestType + +GPBEnumDescriptor *SecurityLevelMap_KeyKindRequestType_EnumDescriptor(void) { + static _Atomic(GPBEnumDescriptor*) descriptor = nil; + if (!descriptor) { + static const char *valueNames = + "CurrentKeyOfKindRequest\000AllKeysOfKindReq" + "uest\000"; + static const int32_t values[] = { + SecurityLevelMap_KeyKindRequestType_CurrentKeyOfKindRequest, + SecurityLevelMap_KeyKindRequestType_AllKeysOfKindRequest, + }; + GPBEnumDescriptor *worker = + [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(SecurityLevelMap_KeyKindRequestType) + valueNames:valueNames + values:values + count:(uint32_t)(sizeof(values) / sizeof(int32_t)) + enumVerifier:SecurityLevelMap_KeyKindRequestType_IsValidValue]; + GPBEnumDescriptor *expected = nil; + if (!atomic_compare_exchange_strong(&descriptor, &expected, worker)) { + [worker release]; + } + } + return descriptor; +} + +BOOL SecurityLevelMap_KeyKindRequestType_IsValidValue(int32_t value__) { + switch (value__) { + case SecurityLevelMap_KeyKindRequestType_CurrentKeyOfKindRequest: + case SecurityLevelMap_KeyKindRequestType_AllKeysOfKindRequest: + return YES; + default: + return NO; + } +} + +#pragma mark - GetIdentityKeysRequest + +@implementation GetIdentityKeysRequest + +@dynamic identityId; +@dynamic hasRequestType, requestType; +@dynamic hasLimit, limit; +@dynamic hasOffset, offset; +@dynamic prove; + +typedef struct GetIdentityKeysRequest__storage_ { + uint32_t _has_storage_[1]; + NSData *identityId; + KeyRequestType *requestType; + GPBUInt32Value *limit; + GPBUInt32Value *offset; +} GetIdentityKeysRequest__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "identityId", + .dataTypeSpecific.clazz = Nil, + .number = GetIdentityKeysRequest_FieldNumber_IdentityId, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GetIdentityKeysRequest__storage_, identityId), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeBytes, + }, + { + .name = "requestType", + .dataTypeSpecific.clazz = GPBObjCClass(KeyRequestType), + .number = GetIdentityKeysRequest_FieldNumber_RequestType, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GetIdentityKeysRequest__storage_, requestType), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "limit", + .dataTypeSpecific.clazz = GPBObjCClass(GPBUInt32Value), + .number = GetIdentityKeysRequest_FieldNumber_Limit, + .hasIndex = 2, + .offset = (uint32_t)offsetof(GetIdentityKeysRequest__storage_, limit), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "offset", + .dataTypeSpecific.clazz = GPBObjCClass(GPBUInt32Value), + .number = GetIdentityKeysRequest_FieldNumber_Offset, + .hasIndex = 3, + .offset = (uint32_t)offsetof(GetIdentityKeysRequest__storage_, offset), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "prove", + .dataTypeSpecific.clazz = Nil, + .number = GetIdentityKeysRequest_FieldNumber_Prove, + .hasIndex = 4, + .offset = 5, // Stored in _has_storage_ to save space. + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeBool, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetIdentityKeysRequest class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetIdentityKeysRequest__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GetIdentityKeysResponse + +@implementation GetIdentityKeysResponse + +@dynamic resultOneOfCase; +@dynamic keys; +@dynamic proof; +@dynamic hasMetadata, metadata; + +typedef struct GetIdentityKeysResponse__storage_ { + uint32_t _has_storage_[2]; + GetIdentityKeysResponse_Keys *keys; + Proof *proof; + ResponseMetadata *metadata; +} GetIdentityKeysResponse__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "keys", + .dataTypeSpecific.clazz = GPBObjCClass(GetIdentityKeysResponse_Keys), + .number = GetIdentityKeysResponse_FieldNumber_Keys, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GetIdentityKeysResponse__storage_, keys), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "proof", + .dataTypeSpecific.clazz = GPBObjCClass(Proof), + .number = GetIdentityKeysResponse_FieldNumber_Proof, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GetIdentityKeysResponse__storage_, proof), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "metadata", + .dataTypeSpecific.clazz = GPBObjCClass(ResponseMetadata), + .number = GetIdentityKeysResponse_FieldNumber_Metadata, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GetIdentityKeysResponse__storage_, metadata), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetIdentityKeysResponse class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetIdentityKeysResponse__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + static const char *oneofs[] = { + "result", + }; + [localDescriptor setupOneofs:oneofs + count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) + firstHasIndex:-1]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +void GetIdentityKeysResponse_ClearResultOneOfCase(GetIdentityKeysResponse *message) { + GPBDescriptor *descriptor = [GetIdentityKeysResponse descriptor]; + GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; + GPBClearOneof(message, oneof); +} +#pragma mark - GetIdentityKeysResponse_Keys + +@implementation GetIdentityKeysResponse_Keys + +@dynamic keysBytesArray, keysBytesArray_Count; + +typedef struct GetIdentityKeysResponse_Keys__storage_ { + uint32_t _has_storage_[1]; + NSMutableArray *keysBytesArray; +} GetIdentityKeysResponse_Keys__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "keysBytesArray", + .dataTypeSpecific.clazz = Nil, + .number = GetIdentityKeysResponse_Keys_FieldNumber_KeysBytesArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GetIdentityKeysResponse_Keys__storage_, keysBytesArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeBytes, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetIdentityKeysResponse_Keys class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetIdentityKeysResponse_Keys__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + [localDescriptor setupContainingMessageClass:GPBObjCClass(GetIdentityKeysResponse)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GetIdentitiesKeysRequest + +@implementation GetIdentitiesKeysRequest + +@dynamic identityIdsArray, identityIdsArray_Count; +@dynamic hasRequestType, requestType; +@dynamic hasLimit, limit; +@dynamic hasOffset, offset; +@dynamic prove; + +typedef struct GetIdentitiesKeysRequest__storage_ { + uint32_t _has_storage_[1]; + NSMutableArray *identityIdsArray; + KeyRequestType *requestType; + GPBUInt32Value *limit; + GPBUInt32Value *offset; +} GetIdentitiesKeysRequest__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "identityIdsArray", + .dataTypeSpecific.clazz = Nil, + .number = GetIdentitiesKeysRequest_FieldNumber_IdentityIdsArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GetIdentitiesKeysRequest__storage_, identityIdsArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeBytes, + }, + { + .name = "requestType", + .dataTypeSpecific.clazz = GPBObjCClass(KeyRequestType), + .number = GetIdentitiesKeysRequest_FieldNumber_RequestType, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GetIdentitiesKeysRequest__storage_, requestType), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "limit", + .dataTypeSpecific.clazz = GPBObjCClass(GPBUInt32Value), + .number = GetIdentitiesKeysRequest_FieldNumber_Limit, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GetIdentitiesKeysRequest__storage_, limit), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "offset", + .dataTypeSpecific.clazz = GPBObjCClass(GPBUInt32Value), + .number = GetIdentitiesKeysRequest_FieldNumber_Offset, + .hasIndex = 2, + .offset = (uint32_t)offsetof(GetIdentitiesKeysRequest__storage_, offset), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "prove", + .dataTypeSpecific.clazz = Nil, + .number = GetIdentitiesKeysRequest_FieldNumber_Prove, + .hasIndex = 3, + .offset = 4, // Stored in _has_storage_ to save space. + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeBool, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetIdentitiesKeysRequest class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetIdentitiesKeysRequest__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GetIdentitiesKeysRequest_SecurityLevelMap + +@implementation GetIdentitiesKeysRequest_SecurityLevelMap + +@dynamic securityLevelMap, securityLevelMap_Count; + +typedef struct GetIdentitiesKeysRequest_SecurityLevelMap__storage_ { + uint32_t _has_storage_[1]; + GPBUInt32EnumDictionary *securityLevelMap; +} GetIdentitiesKeysRequest_SecurityLevelMap__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "securityLevelMap", + .dataTypeSpecific.enumDescFunc = GetIdentitiesKeysRequest_SecurityLevelMap_KeyKindRequestType_EnumDescriptor, + .number = GetIdentitiesKeysRequest_SecurityLevelMap_FieldNumber_SecurityLevelMap, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GetIdentitiesKeysRequest_SecurityLevelMap__storage_, securityLevelMap), + .flags = (GPBFieldFlags)(GPBFieldMapKeyUInt32 | GPBFieldHasEnumDescriptor), + .dataType = GPBDataTypeEnum, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetIdentitiesKeysRequest_SecurityLevelMap class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetIdentitiesKeysRequest_SecurityLevelMap__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + [localDescriptor setupContainingMessageClass:GPBObjCClass(GetIdentitiesKeysRequest)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - Enum GetIdentitiesKeysRequest_SecurityLevelMap_KeyKindRequestType + +GPBEnumDescriptor *GetIdentitiesKeysRequest_SecurityLevelMap_KeyKindRequestType_EnumDescriptor(void) { + static _Atomic(GPBEnumDescriptor*) descriptor = nil; + if (!descriptor) { + static const char *valueNames = + "CurrentKeyOfKindRequest\000"; + static const int32_t values[] = { + GetIdentitiesKeysRequest_SecurityLevelMap_KeyKindRequestType_CurrentKeyOfKindRequest, + }; + GPBEnumDescriptor *worker = + [GPBEnumDescriptor allocDescriptorForName:GPBNSStringifySymbol(GetIdentitiesKeysRequest_SecurityLevelMap_KeyKindRequestType) + valueNames:valueNames + values:values + count:(uint32_t)(sizeof(values) / sizeof(int32_t)) + enumVerifier:GetIdentitiesKeysRequest_SecurityLevelMap_KeyKindRequestType_IsValidValue]; + GPBEnumDescriptor *expected = nil; + if (!atomic_compare_exchange_strong(&descriptor, &expected, worker)) { + [worker release]; + } + } + return descriptor; +} + +BOOL GetIdentitiesKeysRequest_SecurityLevelMap_KeyKindRequestType_IsValidValue(int32_t value__) { + switch (value__) { + case GetIdentitiesKeysRequest_SecurityLevelMap_KeyKindRequestType_CurrentKeyOfKindRequest: + return YES; + default: + return NO; + } +} + +#pragma mark - GetIdentitiesKeysResponse + +@implementation GetIdentitiesKeysResponse + +@dynamic resultOneOfCase; +@dynamic publicKeys; +@dynamic proof; +@dynamic hasMetadata, metadata; + +typedef struct GetIdentitiesKeysResponse__storage_ { + uint32_t _has_storage_[2]; + GetIdentitiesKeysResponse_PublicKeyEntries *publicKeys; + Proof *proof; + ResponseMetadata *metadata; +} GetIdentitiesKeysResponse__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "publicKeys", + .dataTypeSpecific.clazz = GPBObjCClass(GetIdentitiesKeysResponse_PublicKeyEntries), + .number = GetIdentitiesKeysResponse_FieldNumber_PublicKeys, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GetIdentitiesKeysResponse__storage_, publicKeys), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "proof", + .dataTypeSpecific.clazz = GPBObjCClass(Proof), + .number = GetIdentitiesKeysResponse_FieldNumber_Proof, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GetIdentitiesKeysResponse__storage_, proof), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "metadata", + .dataTypeSpecific.clazz = GPBObjCClass(ResponseMetadata), + .number = GetIdentitiesKeysResponse_FieldNumber_Metadata, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GetIdentitiesKeysResponse__storage_, metadata), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetIdentitiesKeysResponse class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetIdentitiesKeysResponse__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + static const char *oneofs[] = { + "result", + }; + [localDescriptor setupOneofs:oneofs + count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) + firstHasIndex:-1]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +void GetIdentitiesKeysResponse_ClearResultOneOfCase(GetIdentitiesKeysResponse *message) { + GPBDescriptor *descriptor = [GetIdentitiesKeysResponse descriptor]; + GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; + GPBClearOneof(message, oneof); +} +#pragma mark - GetIdentitiesKeysResponse_PublicKey + +@implementation GetIdentitiesKeysResponse_PublicKey + +@dynamic value; + +typedef struct GetIdentitiesKeysResponse_PublicKey__storage_ { + uint32_t _has_storage_[1]; + NSData *value; +} GetIdentitiesKeysResponse_PublicKey__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "value", + .dataTypeSpecific.clazz = Nil, + .number = GetIdentitiesKeysResponse_PublicKey_FieldNumber_Value, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GetIdentitiesKeysResponse_PublicKey__storage_, value), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeBytes, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetIdentitiesKeysResponse_PublicKey class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetIdentitiesKeysResponse_PublicKey__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + [localDescriptor setupContainingMessageClass:GPBObjCClass(GetIdentitiesKeysResponse)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GetIdentitiesKeysResponse_PublicKeyEntry + +@implementation GetIdentitiesKeysResponse_PublicKeyEntry + +@dynamic key; +@dynamic hasValue, value; + +typedef struct GetIdentitiesKeysResponse_PublicKeyEntry__storage_ { + uint32_t _has_storage_[1]; + NSData *key; + GetIdentitiesKeysResponse_PublicKey *value; +} GetIdentitiesKeysResponse_PublicKeyEntry__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "key", + .dataTypeSpecific.clazz = Nil, + .number = GetIdentitiesKeysResponse_PublicKeyEntry_FieldNumber_Key, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GetIdentitiesKeysResponse_PublicKeyEntry__storage_, key), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeBytes, + }, + { + .name = "value", + .dataTypeSpecific.clazz = GPBObjCClass(GetIdentitiesKeysResponse_PublicKey), + .number = GetIdentitiesKeysResponse_PublicKeyEntry_FieldNumber_Value, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GetIdentitiesKeysResponse_PublicKeyEntry__storage_, value), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetIdentitiesKeysResponse_PublicKeyEntry class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetIdentitiesKeysResponse_PublicKeyEntry__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + [localDescriptor setupContainingMessageClass:GPBObjCClass(GetIdentitiesKeysResponse)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GetIdentitiesKeysResponse_PublicKeyEntries + +@implementation GetIdentitiesKeysResponse_PublicKeyEntries + +@dynamic publicKeyEntriesArray, publicKeyEntriesArray_Count; + +typedef struct GetIdentitiesKeysResponse_PublicKeyEntries__storage_ { + uint32_t _has_storage_[1]; + NSMutableArray *publicKeyEntriesArray; +} GetIdentitiesKeysResponse_PublicKeyEntries__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "publicKeyEntriesArray", + .dataTypeSpecific.clazz = GPBObjCClass(GetIdentitiesKeysResponse_PublicKeyEntry), + .number = GetIdentitiesKeysResponse_PublicKeyEntries_FieldNumber_PublicKeyEntriesArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GetIdentitiesKeysResponse_PublicKeyEntries__storage_, publicKeyEntriesArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetIdentitiesKeysResponse_PublicKeyEntries class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetIdentitiesKeysResponse_PublicKeyEntries__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + [localDescriptor setupContainingMessageClass:GPBObjCClass(GetIdentitiesKeysResponse)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GetDataContractRequest + +@implementation GetDataContractRequest + +@dynamic id_p; +@dynamic prove; + +typedef struct GetDataContractRequest__storage_ { + uint32_t _has_storage_[1]; + NSData *id_p; +} GetDataContractRequest__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "id_p", + .dataTypeSpecific.clazz = Nil, + .number = GetDataContractRequest_FieldNumber_Id_p, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GetDataContractRequest__storage_, id_p), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeBytes, + }, + { + .name = "prove", + .dataTypeSpecific.clazz = Nil, + .number = GetDataContractRequest_FieldNumber_Prove, + .hasIndex = 1, + .offset = 2, // Stored in _has_storage_ to save space. + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeBool, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetDataContractRequest class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetDataContractRequest__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GetDataContractResponse + +@implementation GetDataContractResponse + +@dynamic dataContract; +@dynamic hasProof, proof; +@dynamic hasMetadata, metadata; + +typedef struct GetDataContractResponse__storage_ { + uint32_t _has_storage_[1]; + NSData *dataContract; + Proof *proof; + ResponseMetadata *metadata; +} GetDataContractResponse__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "dataContract", + .dataTypeSpecific.clazz = Nil, + .number = GetDataContractResponse_FieldNumber_DataContract, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GetDataContractResponse__storage_, dataContract), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeBytes, + }, + { + .name = "proof", + .dataTypeSpecific.clazz = GPBObjCClass(Proof), + .number = GetDataContractResponse_FieldNumber_Proof, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GetDataContractResponse__storage_, proof), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "metadata", + .dataTypeSpecific.clazz = GPBObjCClass(ResponseMetadata), + .number = GetDataContractResponse_FieldNumber_Metadata, + .hasIndex = 2, + .offset = (uint32_t)offsetof(GetDataContractResponse__storage_, metadata), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetDataContractResponse class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetDataContractResponse__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GetDataContractsRequest + +@implementation GetDataContractsRequest + +@dynamic idsArray, idsArray_Count; +@dynamic prove; + +typedef struct GetDataContractsRequest__storage_ { + uint32_t _has_storage_[1]; + NSMutableArray *idsArray; +} GetDataContractsRequest__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "idsArray", + .dataTypeSpecific.clazz = Nil, + .number = GetDataContractsRequest_FieldNumber_IdsArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GetDataContractsRequest__storage_, idsArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeBytes, + }, + { + .name = "prove", + .dataTypeSpecific.clazz = Nil, + .number = GetDataContractsRequest_FieldNumber_Prove, + .hasIndex = 0, + .offset = 1, // Stored in _has_storage_ to save space. + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeBool, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetDataContractsRequest class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetDataContractsRequest__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GetDataContractsResponse + +@implementation GetDataContractsResponse + +@dynamic resultOneOfCase; +@dynamic dataContracts; +@dynamic proof; +@dynamic hasMetadata, metadata; + +typedef struct GetDataContractsResponse__storage_ { + uint32_t _has_storage_[2]; + GetDataContractsResponse_DataContracts *dataContracts; + Proof *proof; + ResponseMetadata *metadata; +} GetDataContractsResponse__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "dataContracts", + .dataTypeSpecific.clazz = GPBObjCClass(GetDataContractsResponse_DataContracts), + .number = GetDataContractsResponse_FieldNumber_DataContracts, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GetDataContractsResponse__storage_, dataContracts), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "proof", + .dataTypeSpecific.clazz = GPBObjCClass(Proof), + .number = GetDataContractsResponse_FieldNumber_Proof, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GetDataContractsResponse__storage_, proof), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "metadata", + .dataTypeSpecific.clazz = GPBObjCClass(ResponseMetadata), + .number = GetDataContractsResponse_FieldNumber_Metadata, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GetDataContractsResponse__storage_, metadata), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetDataContractsResponse class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetDataContractsResponse__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + static const char *oneofs[] = { + "result", + }; + [localDescriptor setupOneofs:oneofs + count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) + firstHasIndex:-1]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +void GetDataContractsResponse_ClearResultOneOfCase(GetDataContractsResponse *message) { + GPBDescriptor *descriptor = [GetDataContractsResponse descriptor]; + GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; + GPBClearOneof(message, oneof); +} +#pragma mark - GetDataContractsResponse_DataContractValue + +@implementation GetDataContractsResponse_DataContractValue + +@dynamic value; + +typedef struct GetDataContractsResponse_DataContractValue__storage_ { + uint32_t _has_storage_[1]; + NSData *value; +} GetDataContractsResponse_DataContractValue__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "value", + .dataTypeSpecific.clazz = Nil, + .number = GetDataContractsResponse_DataContractValue_FieldNumber_Value, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GetDataContractsResponse_DataContractValue__storage_, value), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeBytes, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetDataContractsResponse_DataContractValue class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetDataContractsResponse_DataContractValue__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + [localDescriptor setupContainingMessageClass:GPBObjCClass(GetDataContractsResponse)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GetDataContractsResponse_DataContractEntry + +@implementation GetDataContractsResponse_DataContractEntry + +@dynamic key; +@dynamic hasValue, value; + +typedef struct GetDataContractsResponse_DataContractEntry__storage_ { + uint32_t _has_storage_[1]; + NSData *key; + GetDataContractsResponse_DataContractValue *value; +} GetDataContractsResponse_DataContractEntry__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "key", + .dataTypeSpecific.clazz = Nil, + .number = GetDataContractsResponse_DataContractEntry_FieldNumber_Key, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GetDataContractsResponse_DataContractEntry__storage_, key), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeBytes, + }, + { + .name = "value", + .dataTypeSpecific.clazz = GPBObjCClass(GetDataContractsResponse_DataContractValue), + .number = GetDataContractsResponse_DataContractEntry_FieldNumber_Value, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GetDataContractsResponse_DataContractEntry__storage_, value), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetDataContractsResponse_DataContractEntry class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetDataContractsResponse_DataContractEntry__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + [localDescriptor setupContainingMessageClass:GPBObjCClass(GetDataContractsResponse)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GetDataContractsResponse_DataContracts + +@implementation GetDataContractsResponse_DataContracts + +@dynamic dataContractEntriesArray, dataContractEntriesArray_Count; + +typedef struct GetDataContractsResponse_DataContracts__storage_ { + uint32_t _has_storage_[1]; + NSMutableArray *dataContractEntriesArray; +} GetDataContractsResponse_DataContracts__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "dataContractEntriesArray", + .dataTypeSpecific.clazz = GPBObjCClass(GetDataContractsResponse_DataContractEntry), + .number = GetDataContractsResponse_DataContracts_FieldNumber_DataContractEntriesArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GetDataContractsResponse_DataContracts__storage_, dataContractEntriesArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetDataContractsResponse_DataContracts class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetDataContractsResponse_DataContracts__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + [localDescriptor setupContainingMessageClass:GPBObjCClass(GetDataContractsResponse)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GetDocumentsRequest + +@implementation GetDocumentsRequest + +@dynamic startOneOfCase; +@dynamic dataContractId; +@dynamic documentType; +@dynamic where; +@dynamic orderBy; +@dynamic limit; +@dynamic startAfter; +@dynamic startAt; +@dynamic prove; + +typedef struct GetDocumentsRequest__storage_ { + uint32_t _has_storage_[2]; + uint32_t limit; + NSData *dataContractId; + NSString *documentType; + NSData *where; + NSData *orderBy; + NSData *startAfter; + NSData *startAt; +} GetDocumentsRequest__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "dataContractId", + .dataTypeSpecific.clazz = Nil, + .number = GetDocumentsRequest_FieldNumber_DataContractId, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GetDocumentsRequest__storage_, dataContractId), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeBytes, + }, + { + .name = "documentType", + .dataTypeSpecific.clazz = Nil, + .number = GetDocumentsRequest_FieldNumber_DocumentType, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GetDocumentsRequest__storage_, documentType), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeString, + }, + { + .name = "where", + .dataTypeSpecific.clazz = Nil, + .number = GetDocumentsRequest_FieldNumber_Where, + .hasIndex = 2, + .offset = (uint32_t)offsetof(GetDocumentsRequest__storage_, where), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeBytes, + }, + { + .name = "orderBy", + .dataTypeSpecific.clazz = Nil, + .number = GetDocumentsRequest_FieldNumber_OrderBy, + .hasIndex = 3, + .offset = (uint32_t)offsetof(GetDocumentsRequest__storage_, orderBy), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeBytes, + }, + { + .name = "limit", + .dataTypeSpecific.clazz = Nil, + .number = GetDocumentsRequest_FieldNumber_Limit, + .hasIndex = 4, + .offset = (uint32_t)offsetof(GetDocumentsRequest__storage_, limit), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeUInt32, + }, + { + .name = "startAfter", + .dataTypeSpecific.clazz = Nil, + .number = GetDocumentsRequest_FieldNumber_StartAfter, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GetDocumentsRequest__storage_, startAfter), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeBytes, + }, + { + .name = "startAt", + .dataTypeSpecific.clazz = Nil, + .number = GetDocumentsRequest_FieldNumber_StartAt, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GetDocumentsRequest__storage_, startAt), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeBytes, + }, + { + .name = "prove", + .dataTypeSpecific.clazz = Nil, + .number = GetDocumentsRequest_FieldNumber_Prove, + .hasIndex = 5, + .offset = 6, // Stored in _has_storage_ to save space. + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeBool, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetDocumentsRequest class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetDocumentsRequest__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + static const char *oneofs[] = { + "start", + }; + [localDescriptor setupOneofs:oneofs + count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) + firstHasIndex:-1]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +void GetDocumentsRequest_ClearStartOneOfCase(GetDocumentsRequest *message) { + GPBDescriptor *descriptor = [GetDocumentsRequest descriptor]; + GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; + GPBClearOneof(message, oneof); +} +#pragma mark - GetDocumentsResponse + +@implementation GetDocumentsResponse + +@dynamic documentsArray, documentsArray_Count; +@dynamic hasProof, proof; +@dynamic hasMetadata, metadata; + +typedef struct GetDocumentsResponse__storage_ { + uint32_t _has_storage_[1]; + NSMutableArray *documentsArray; + Proof *proof; + ResponseMetadata *metadata; +} GetDocumentsResponse__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "documentsArray", + .dataTypeSpecific.clazz = Nil, + .number = GetDocumentsResponse_FieldNumber_DocumentsArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GetDocumentsResponse__storage_, documentsArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeBytes, + }, + { + .name = "proof", + .dataTypeSpecific.clazz = GPBObjCClass(Proof), + .number = GetDocumentsResponse_FieldNumber_Proof, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GetDocumentsResponse__storage_, proof), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "metadata", + .dataTypeSpecific.clazz = GPBObjCClass(ResponseMetadata), + .number = GetDocumentsResponse_FieldNumber_Metadata, + .hasIndex = 1, + .offset = (uint32_t)offsetof(GetDocumentsResponse__storage_, metadata), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetDocumentsResponse class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetDocumentsResponse__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GetIdentitiesByPublicKeyHashesRequest + +@implementation GetIdentitiesByPublicKeyHashesRequest + +@dynamic publicKeyHashesArray, publicKeyHashesArray_Count; +@dynamic prove; + +typedef struct GetIdentitiesByPublicKeyHashesRequest__storage_ { + uint32_t _has_storage_[1]; + NSMutableArray *publicKeyHashesArray; +} GetIdentitiesByPublicKeyHashesRequest__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "publicKeyHashesArray", + .dataTypeSpecific.clazz = Nil, + .number = GetIdentitiesByPublicKeyHashesRequest_FieldNumber_PublicKeyHashesArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GetIdentitiesByPublicKeyHashesRequest__storage_, publicKeyHashesArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeBytes, + }, + { + .name = "prove", + .dataTypeSpecific.clazz = Nil, + .number = GetIdentitiesByPublicKeyHashesRequest_FieldNumber_Prove, + .hasIndex = 0, + .offset = 1, // Stored in _has_storage_ to save space. + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeBool, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetIdentitiesByPublicKeyHashesRequest class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetIdentitiesByPublicKeyHashesRequest__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GetIdentitiesByPublicKeyHashesResponse + +@implementation GetIdentitiesByPublicKeyHashesResponse + +@dynamic identitiesArray, identitiesArray_Count; +@dynamic hasProof, proof; +@dynamic hasMetadata, metadata; + +typedef struct GetIdentitiesByPublicKeyHashesResponse__storage_ { + uint32_t _has_storage_[1]; + NSMutableArray *identitiesArray; + Proof *proof; + ResponseMetadata *metadata; +} GetIdentitiesByPublicKeyHashesResponse__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "identitiesArray", + .dataTypeSpecific.clazz = Nil, + .number = GetIdentitiesByPublicKeyHashesResponse_FieldNumber_IdentitiesArray, + .hasIndex = GPBNoHasBit, + .offset = (uint32_t)offsetof(GetIdentitiesByPublicKeyHashesResponse__storage_, identitiesArray), + .flags = GPBFieldRepeated, + .dataType = GPBDataTypeBytes, + }, + { + .name = "proof", + .dataTypeSpecific.clazz = GPBObjCClass(Proof), + .number = GetIdentitiesByPublicKeyHashesResponse_FieldNumber_Proof, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GetIdentitiesByPublicKeyHashesResponse__storage_, proof), + .flags = GPBFieldOptional, .dataType = GPBDataTypeMessage, }, { @@ -920,6 +2259,140 @@ + (GPBDescriptor *)descriptor { @end +#pragma mark - GetIdentityByPublicKeyHashesRequest + +@implementation GetIdentityByPublicKeyHashesRequest + +@dynamic publicKeyHash; +@dynamic prove; + +typedef struct GetIdentityByPublicKeyHashesRequest__storage_ { + uint32_t _has_storage_[1]; + NSData *publicKeyHash; +} GetIdentityByPublicKeyHashesRequest__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "publicKeyHash", + .dataTypeSpecific.clazz = Nil, + .number = GetIdentityByPublicKeyHashesRequest_FieldNumber_PublicKeyHash, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GetIdentityByPublicKeyHashesRequest__storage_, publicKeyHash), + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeBytes, + }, + { + .name = "prove", + .dataTypeSpecific.clazz = Nil, + .number = GetIdentityByPublicKeyHashesRequest_FieldNumber_Prove, + .hasIndex = 1, + .offset = 2, // Stored in _has_storage_ to save space. + .flags = (GPBFieldFlags)(GPBFieldOptional | GPBFieldClearHasIvarOnZero), + .dataType = GPBDataTypeBool, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetIdentityByPublicKeyHashesRequest class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetIdentityByPublicKeyHashesRequest__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +#pragma mark - GetIdentityByPublicKeyHashesResponse + +@implementation GetIdentityByPublicKeyHashesResponse + +@dynamic resultOneOfCase; +@dynamic identity; +@dynamic proof; +@dynamic hasMetadata, metadata; + +typedef struct GetIdentityByPublicKeyHashesResponse__storage_ { + uint32_t _has_storage_[2]; + NSData *identity; + Proof *proof; + ResponseMetadata *metadata; +} GetIdentityByPublicKeyHashesResponse__storage_; + +// This method is threadsafe because it is initially called +// in +initialize for each subclass. ++ (GPBDescriptor *)descriptor { + static GPBDescriptor *descriptor = nil; + if (!descriptor) { + static GPBMessageFieldDescription fields[] = { + { + .name = "identity", + .dataTypeSpecific.clazz = Nil, + .number = GetIdentityByPublicKeyHashesResponse_FieldNumber_Identity, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GetIdentityByPublicKeyHashesResponse__storage_, identity), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeBytes, + }, + { + .name = "proof", + .dataTypeSpecific.clazz = GPBObjCClass(Proof), + .number = GetIdentityByPublicKeyHashesResponse_FieldNumber_Proof, + .hasIndex = -1, + .offset = (uint32_t)offsetof(GetIdentityByPublicKeyHashesResponse__storage_, proof), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + { + .name = "metadata", + .dataTypeSpecific.clazz = GPBObjCClass(ResponseMetadata), + .number = GetIdentityByPublicKeyHashesResponse_FieldNumber_Metadata, + .hasIndex = 0, + .offset = (uint32_t)offsetof(GetIdentityByPublicKeyHashesResponse__storage_, metadata), + .flags = GPBFieldOptional, + .dataType = GPBDataTypeMessage, + }, + }; + GPBDescriptor *localDescriptor = + [GPBDescriptor allocDescriptorForClass:[GetIdentityByPublicKeyHashesResponse class] + rootClass:[PlatformRoot class] + file:PlatformRoot_FileDescriptor() + fields:fields + fieldCount:(uint32_t)(sizeof(fields) / sizeof(GPBMessageFieldDescription)) + storageSize:sizeof(GetIdentityByPublicKeyHashesResponse__storage_) + flags:(GPBDescriptorInitializationFlags)(GPBDescriptorInitializationFlag_UsesClassRefs | GPBDescriptorInitializationFlag_Proto3OptionalKnown)]; + static const char *oneofs[] = { + "result", + }; + [localDescriptor setupOneofs:oneofs + count:(uint32_t)(sizeof(oneofs) / sizeof(char*)) + firstHasIndex:-1]; + #if defined(DEBUG) && DEBUG + NSAssert(descriptor == nil, @"Startup recursed!"); + #endif // DEBUG + descriptor = localDescriptor; + } + return descriptor; +} + +@end + +void GetIdentityByPublicKeyHashesResponse_ClearResultOneOfCase(GetIdentityByPublicKeyHashesResponse *message) { + GPBDescriptor *descriptor = [GetIdentityByPublicKeyHashesResponse descriptor]; + GPBOneofDescriptor *oneof = [descriptor.oneofs objectAtIndex:0]; + GPBClearOneof(message, oneof); +} #pragma mark - WaitForStateTransitionResultRequest @implementation WaitForStateTransitionResultRequest diff --git a/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbrpc.h b/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbrpc.h index e6ce0ddeb8..07279de48c 100644 --- a/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbrpc.h +++ b/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbrpc.h @@ -20,16 +20,34 @@ @class GetConsensusParamsResponse; @class GetDataContractRequest; @class GetDataContractResponse; +@class GetDataContractsRequest; +@class GetDataContractsResponse; @class GetDocumentsRequest; @class GetDocumentsResponse; @class GetIdentitiesByPublicKeyHashesRequest; @class GetIdentitiesByPublicKeyHashesResponse; +@class GetIdentityBalanceAndRevisionResponse; +@class GetIdentityBalanceResponse; +@class GetIdentityByPublicKeyHashesRequest; +@class GetIdentityByPublicKeyHashesResponse; +@class GetIdentityKeysRequest; +@class GetIdentityKeysResponse; @class GetIdentityRequest; @class GetIdentityResponse; @class WaitForStateTransitionResultRequest; @class WaitForStateTransitionResultResponse; #if !defined(GPB_GRPC_FORWARD_DECLARE_MESSAGE_PROTO) || !GPB_GRPC_FORWARD_DECLARE_MESSAGE_PROTO +#if defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) && GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS + #import +#else + #import "GPBWrappers.pbobjc.h" +#endif +#if defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) && GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS + #import +#else + #import "GPBStruct.pbobjc.h" +#endif #if defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) && GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS #import #else @@ -56,10 +74,29 @@ NS_ASSUME_NONNULL_BEGIN - (GRPCUnaryProtoCall *)getIdentityWithMessage:(GetIdentityRequest *)message responseHandler:(id)handler callOptions:(GRPCCallOptions *_Nullable)callOptions; +#pragma mark getIdentityKeys(GetIdentityKeysRequest) returns (GetIdentityKeysResponse) + +- (GRPCUnaryProtoCall *)getIdentityKeysWithMessage:(GetIdentityKeysRequest *)message responseHandler:(id)handler callOptions:(GRPCCallOptions *_Nullable)callOptions; + +#pragma mark getIdentityBalance(GetIdentityRequest) returns (GetIdentityBalanceResponse) + +/** + * rpc getIdentitiesKeys (GetIdentitiesKeysRequest) returns (GetIdentitiesKeysResponse); + */ +- (GRPCUnaryProtoCall *)getIdentityBalanceWithMessage:(GetIdentityRequest *)message responseHandler:(id)handler callOptions:(GRPCCallOptions *_Nullable)callOptions; + +#pragma mark getIdentityBalanceAndRevision(GetIdentityRequest) returns (GetIdentityBalanceAndRevisionResponse) + +- (GRPCUnaryProtoCall *)getIdentityBalanceAndRevisionWithMessage:(GetIdentityRequest *)message responseHandler:(id)handler callOptions:(GRPCCallOptions *_Nullable)callOptions; + #pragma mark getDataContract(GetDataContractRequest) returns (GetDataContractResponse) - (GRPCUnaryProtoCall *)getDataContractWithMessage:(GetDataContractRequest *)message responseHandler:(id)handler callOptions:(GRPCCallOptions *_Nullable)callOptions; +#pragma mark getDataContracts(GetDataContractsRequest) returns (GetDataContractsResponse) + +- (GRPCUnaryProtoCall *)getDataContractsWithMessage:(GetDataContractsRequest *)message responseHandler:(id)handler callOptions:(GRPCCallOptions *_Nullable)callOptions; + #pragma mark getDocuments(GetDocumentsRequest) returns (GetDocumentsResponse) - (GRPCUnaryProtoCall *)getDocumentsWithMessage:(GetDocumentsRequest *)message responseHandler:(id)handler callOptions:(GRPCCallOptions *_Nullable)callOptions; @@ -68,6 +105,10 @@ NS_ASSUME_NONNULL_BEGIN - (GRPCUnaryProtoCall *)getIdentitiesByPublicKeyHashesWithMessage:(GetIdentitiesByPublicKeyHashesRequest *)message responseHandler:(id)handler callOptions:(GRPCCallOptions *_Nullable)callOptions; +#pragma mark getIdentityByPublicKeyHashes(GetIdentityByPublicKeyHashesRequest) returns (GetIdentityByPublicKeyHashesResponse) + +- (GRPCUnaryProtoCall *)getIdentityByPublicKeyHashesWithMessage:(GetIdentityByPublicKeyHashesRequest *)message responseHandler:(id)handler callOptions:(GRPCCallOptions *_Nullable)callOptions; + #pragma mark waitForStateTransitionResult(WaitForStateTransitionResultRequest) returns (WaitForStateTransitionResultResponse) - (GRPCUnaryProtoCall *)waitForStateTransitionResultWithMessage:(WaitForStateTransitionResultRequest *)message responseHandler:(id)handler callOptions:(GRPCCallOptions *_Nullable)callOptions; @@ -98,6 +139,37 @@ NS_ASSUME_NONNULL_BEGIN - (GRPCProtoCall *)RPCTogetIdentityWithRequest:(GetIdentityRequest *)request handler:(void(^)(GetIdentityResponse *_Nullable response, NSError *_Nullable error))handler; +#pragma mark getIdentityKeys(GetIdentityKeysRequest) returns (GetIdentityKeysResponse) + +- (void)getIdentityKeysWithRequest:(GetIdentityKeysRequest *)request handler:(void(^)(GetIdentityKeysResponse *_Nullable response, NSError *_Nullable error))handler; + +- (GRPCProtoCall *)RPCTogetIdentityKeysWithRequest:(GetIdentityKeysRequest *)request handler:(void(^)(GetIdentityKeysResponse *_Nullable response, NSError *_Nullable error))handler; + + +#pragma mark getIdentityBalance(GetIdentityRequest) returns (GetIdentityBalanceResponse) + +/** + * rpc getIdentitiesKeys (GetIdentitiesKeysRequest) returns (GetIdentitiesKeysResponse); + * + * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended. + */ +- (void)getIdentityBalanceWithRequest:(GetIdentityRequest *)request handler:(void(^)(GetIdentityBalanceResponse *_Nullable response, NSError *_Nullable error))handler; + +/** + * rpc getIdentitiesKeys (GetIdentitiesKeysRequest) returns (GetIdentitiesKeysResponse); + * + * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended. + */ +- (GRPCProtoCall *)RPCTogetIdentityBalanceWithRequest:(GetIdentityRequest *)request handler:(void(^)(GetIdentityBalanceResponse *_Nullable response, NSError *_Nullable error))handler; + + +#pragma mark getIdentityBalanceAndRevision(GetIdentityRequest) returns (GetIdentityBalanceAndRevisionResponse) + +- (void)getIdentityBalanceAndRevisionWithRequest:(GetIdentityRequest *)request handler:(void(^)(GetIdentityBalanceAndRevisionResponse *_Nullable response, NSError *_Nullable error))handler; + +- (GRPCProtoCall *)RPCTogetIdentityBalanceAndRevisionWithRequest:(GetIdentityRequest *)request handler:(void(^)(GetIdentityBalanceAndRevisionResponse *_Nullable response, NSError *_Nullable error))handler; + + #pragma mark getDataContract(GetDataContractRequest) returns (GetDataContractResponse) - (void)getDataContractWithRequest:(GetDataContractRequest *)request handler:(void(^)(GetDataContractResponse *_Nullable response, NSError *_Nullable error))handler; @@ -105,6 +177,13 @@ NS_ASSUME_NONNULL_BEGIN - (GRPCProtoCall *)RPCTogetDataContractWithRequest:(GetDataContractRequest *)request handler:(void(^)(GetDataContractResponse *_Nullable response, NSError *_Nullable error))handler; +#pragma mark getDataContracts(GetDataContractsRequest) returns (GetDataContractsResponse) + +- (void)getDataContractsWithRequest:(GetDataContractsRequest *)request handler:(void(^)(GetDataContractsResponse *_Nullable response, NSError *_Nullable error))handler; + +- (GRPCProtoCall *)RPCTogetDataContractsWithRequest:(GetDataContractsRequest *)request handler:(void(^)(GetDataContractsResponse *_Nullable response, NSError *_Nullable error))handler; + + #pragma mark getDocuments(GetDocumentsRequest) returns (GetDocumentsResponse) - (void)getDocumentsWithRequest:(GetDocumentsRequest *)request handler:(void(^)(GetDocumentsResponse *_Nullable response, NSError *_Nullable error))handler; @@ -119,6 +198,13 @@ NS_ASSUME_NONNULL_BEGIN - (GRPCProtoCall *)RPCTogetIdentitiesByPublicKeyHashesWithRequest:(GetIdentitiesByPublicKeyHashesRequest *)request handler:(void(^)(GetIdentitiesByPublicKeyHashesResponse *_Nullable response, NSError *_Nullable error))handler; +#pragma mark getIdentityByPublicKeyHashes(GetIdentityByPublicKeyHashesRequest) returns (GetIdentityByPublicKeyHashesResponse) + +- (void)getIdentityByPublicKeyHashesWithRequest:(GetIdentityByPublicKeyHashesRequest *)request handler:(void(^)(GetIdentityByPublicKeyHashesResponse *_Nullable response, NSError *_Nullable error))handler; + +- (GRPCProtoCall *)RPCTogetIdentityByPublicKeyHashesWithRequest:(GetIdentityByPublicKeyHashesRequest *)request handler:(void(^)(GetIdentityByPublicKeyHashesResponse *_Nullable response, NSError *_Nullable error))handler; + + #pragma mark waitForStateTransitionResult(WaitForStateTransitionResultRequest) returns (WaitForStateTransitionResultResponse) - (void)waitForStateTransitionResultWithRequest:(WaitForStateTransitionResultRequest *)request handler:(void(^)(WaitForStateTransitionResultResponse *_Nullable response, NSError *_Nullable error))handler; diff --git a/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbrpc.m b/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbrpc.m index 374c7bcb3f..be0ee7434c 100644 --- a/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbrpc.m +++ b/packages/dapi-grpc/clients/platform/v0/objective-c/Platform.pbrpc.m @@ -7,6 +7,16 @@ #import #import +#if defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) && GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS +#import +#else +#import "GPBWrappers.pbobjc.h" +#endif +#if defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) && GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS +#import +#else +#import "GPBStruct.pbobjc.h" +#endif #if defined(GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS) && GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS #import #else @@ -100,6 +110,79 @@ - (GRPCUnaryProtoCall *)getIdentityWithMessage:(GetIdentityRequest *)message res responseClass:[GetIdentityResponse class]]; } +#pragma mark getIdentityKeys(GetIdentityKeysRequest) returns (GetIdentityKeysResponse) + +- (void)getIdentityKeysWithRequest:(GetIdentityKeysRequest *)request handler:(void(^)(GetIdentityKeysResponse *_Nullable response, NSError *_Nullable error))handler{ + [[self RPCTogetIdentityKeysWithRequest:request handler:handler] start]; +} +// Returns a not-yet-started RPC object. +- (GRPCProtoCall *)RPCTogetIdentityKeysWithRequest:(GetIdentityKeysRequest *)request handler:(void(^)(GetIdentityKeysResponse *_Nullable response, NSError *_Nullable error))handler{ + return [self RPCToMethod:@"getIdentityKeys" + requestsWriter:[GRXWriter writerWithValue:request] + responseClass:[GetIdentityKeysResponse class] + responsesWriteable:[GRXWriteable writeableWithSingleHandler:handler]]; +} +- (GRPCUnaryProtoCall *)getIdentityKeysWithMessage:(GetIdentityKeysRequest *)message responseHandler:(id)handler callOptions:(GRPCCallOptions *_Nullable)callOptions { + return [self RPCToMethod:@"getIdentityKeys" + message:message + responseHandler:handler + callOptions:callOptions + responseClass:[GetIdentityKeysResponse class]]; +} + +#pragma mark getIdentityBalance(GetIdentityRequest) returns (GetIdentityBalanceResponse) + +/** + * rpc getIdentitiesKeys (GetIdentitiesKeysRequest) returns (GetIdentitiesKeysResponse); + * + * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended. + */ +- (void)getIdentityBalanceWithRequest:(GetIdentityRequest *)request handler:(void(^)(GetIdentityBalanceResponse *_Nullable response, NSError *_Nullable error))handler{ + [[self RPCTogetIdentityBalanceWithRequest:request handler:handler] start]; +} +// Returns a not-yet-started RPC object. +/** + * rpc getIdentitiesKeys (GetIdentitiesKeysRequest) returns (GetIdentitiesKeysResponse); + * + * This method belongs to a set of APIs that have been deprecated. Using the v2 API is recommended. + */ +- (GRPCProtoCall *)RPCTogetIdentityBalanceWithRequest:(GetIdentityRequest *)request handler:(void(^)(GetIdentityBalanceResponse *_Nullable response, NSError *_Nullable error))handler{ + return [self RPCToMethod:@"getIdentityBalance" + requestsWriter:[GRXWriter writerWithValue:request] + responseClass:[GetIdentityBalanceResponse class] + responsesWriteable:[GRXWriteable writeableWithSingleHandler:handler]]; +} +/** + * rpc getIdentitiesKeys (GetIdentitiesKeysRequest) returns (GetIdentitiesKeysResponse); + */ +- (GRPCUnaryProtoCall *)getIdentityBalanceWithMessage:(GetIdentityRequest *)message responseHandler:(id)handler callOptions:(GRPCCallOptions *_Nullable)callOptions { + return [self RPCToMethod:@"getIdentityBalance" + message:message + responseHandler:handler + callOptions:callOptions + responseClass:[GetIdentityBalanceResponse class]]; +} + +#pragma mark getIdentityBalanceAndRevision(GetIdentityRequest) returns (GetIdentityBalanceAndRevisionResponse) + +- (void)getIdentityBalanceAndRevisionWithRequest:(GetIdentityRequest *)request handler:(void(^)(GetIdentityBalanceAndRevisionResponse *_Nullable response, NSError *_Nullable error))handler{ + [[self RPCTogetIdentityBalanceAndRevisionWithRequest:request handler:handler] start]; +} +// Returns a not-yet-started RPC object. +- (GRPCProtoCall *)RPCTogetIdentityBalanceAndRevisionWithRequest:(GetIdentityRequest *)request handler:(void(^)(GetIdentityBalanceAndRevisionResponse *_Nullable response, NSError *_Nullable error))handler{ + return [self RPCToMethod:@"getIdentityBalanceAndRevision" + requestsWriter:[GRXWriter writerWithValue:request] + responseClass:[GetIdentityBalanceAndRevisionResponse class] + responsesWriteable:[GRXWriteable writeableWithSingleHandler:handler]]; +} +- (GRPCUnaryProtoCall *)getIdentityBalanceAndRevisionWithMessage:(GetIdentityRequest *)message responseHandler:(id)handler callOptions:(GRPCCallOptions *_Nullable)callOptions { + return [self RPCToMethod:@"getIdentityBalanceAndRevision" + message:message + responseHandler:handler + callOptions:callOptions + responseClass:[GetIdentityBalanceAndRevisionResponse class]]; +} + #pragma mark getDataContract(GetDataContractRequest) returns (GetDataContractResponse) - (void)getDataContractWithRequest:(GetDataContractRequest *)request handler:(void(^)(GetDataContractResponse *_Nullable response, NSError *_Nullable error))handler{ @@ -120,6 +203,26 @@ - (GRPCUnaryProtoCall *)getDataContractWithMessage:(GetDataContractRequest *)mes responseClass:[GetDataContractResponse class]]; } +#pragma mark getDataContracts(GetDataContractsRequest) returns (GetDataContractsResponse) + +- (void)getDataContractsWithRequest:(GetDataContractsRequest *)request handler:(void(^)(GetDataContractsResponse *_Nullable response, NSError *_Nullable error))handler{ + [[self RPCTogetDataContractsWithRequest:request handler:handler] start]; +} +// Returns a not-yet-started RPC object. +- (GRPCProtoCall *)RPCTogetDataContractsWithRequest:(GetDataContractsRequest *)request handler:(void(^)(GetDataContractsResponse *_Nullable response, NSError *_Nullable error))handler{ + return [self RPCToMethod:@"getDataContracts" + requestsWriter:[GRXWriter writerWithValue:request] + responseClass:[GetDataContractsResponse class] + responsesWriteable:[GRXWriteable writeableWithSingleHandler:handler]]; +} +- (GRPCUnaryProtoCall *)getDataContractsWithMessage:(GetDataContractsRequest *)message responseHandler:(id)handler callOptions:(GRPCCallOptions *_Nullable)callOptions { + return [self RPCToMethod:@"getDataContracts" + message:message + responseHandler:handler + callOptions:callOptions + responseClass:[GetDataContractsResponse class]]; +} + #pragma mark getDocuments(GetDocumentsRequest) returns (GetDocumentsResponse) - (void)getDocumentsWithRequest:(GetDocumentsRequest *)request handler:(void(^)(GetDocumentsResponse *_Nullable response, NSError *_Nullable error))handler{ @@ -160,6 +263,26 @@ - (GRPCUnaryProtoCall *)getIdentitiesByPublicKeyHashesWithMessage:(GetIdentities responseClass:[GetIdentitiesByPublicKeyHashesResponse class]]; } +#pragma mark getIdentityByPublicKeyHashes(GetIdentityByPublicKeyHashesRequest) returns (GetIdentityByPublicKeyHashesResponse) + +- (void)getIdentityByPublicKeyHashesWithRequest:(GetIdentityByPublicKeyHashesRequest *)request handler:(void(^)(GetIdentityByPublicKeyHashesResponse *_Nullable response, NSError *_Nullable error))handler{ + [[self RPCTogetIdentityByPublicKeyHashesWithRequest:request handler:handler] start]; +} +// Returns a not-yet-started RPC object. +- (GRPCProtoCall *)RPCTogetIdentityByPublicKeyHashesWithRequest:(GetIdentityByPublicKeyHashesRequest *)request handler:(void(^)(GetIdentityByPublicKeyHashesResponse *_Nullable response, NSError *_Nullable error))handler{ + return [self RPCToMethod:@"getIdentityByPublicKeyHashes" + requestsWriter:[GRXWriter writerWithValue:request] + responseClass:[GetIdentityByPublicKeyHashesResponse class] + responsesWriteable:[GRXWriteable writeableWithSingleHandler:handler]]; +} +- (GRPCUnaryProtoCall *)getIdentityByPublicKeyHashesWithMessage:(GetIdentityByPublicKeyHashesRequest *)message responseHandler:(id)handler callOptions:(GRPCCallOptions *_Nullable)callOptions { + return [self RPCToMethod:@"getIdentityByPublicKeyHashes" + message:message + responseHandler:handler + callOptions:callOptions + responseClass:[GetIdentityByPublicKeyHashesResponse class]]; +} + #pragma mark waitForStateTransitionResult(WaitForStateTransitionResultRequest) returns (WaitForStateTransitionResultResponse) - (void)waitForStateTransitionResultWithRequest:(WaitForStateTransitionResultRequest *)request handler:(void(^)(WaitForStateTransitionResultResponse *_Nullable response, NSError *_Nullable error))handler{ diff --git a/packages/dapi-grpc/clients/platform/v0/python/platform_pb2.py b/packages/dapi-grpc/clients/platform/v0/python/platform_pb2.py index 93386d136f..8aa1cc5dd9 100644 --- a/packages/dapi-grpc/clients/platform/v0/python/platform_pb2.py +++ b/packages/dapi-grpc/clients/platform/v0/python/platform_pb2.py @@ -11,6 +11,8 @@ _sym_db = _symbol_database.Default() +from google.protobuf import wrappers_pb2 as google_dot_protobuf_dot_wrappers__pb2 +from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2 from google.protobuf import timestamp_pb2 as google_dot_protobuf_dot_timestamp__pb2 @@ -20,12 +22,57 @@ syntax='proto3', serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_pb=b'\n\x0eplatform.proto\x12\x19org.dash.platform.dapi.v0\x1a\x1fgoogle/protobuf/timestamp.proto\"T\n\x05Proof\x12\x14\n\x0cmerkle_proof\x18\x01 \x01(\x0c\x12\x13\n\x0bquorum_hash\x18\x02 \x01(\x0c\x12\x11\n\tsignature\x18\x03 \x01(\x0c\x12\r\n\x05round\x18\x04 \x01(\r\"o\n\x10ResponseMetadata\x12\x0e\n\x06height\x18\x01 \x01(\x03\x12 \n\x18\x63ore_chain_locked_height\x18\x02 \x01(\r\x12\x0f\n\x07time_ms\x18\x03 \x01(\x04\x12\x18\n\x10protocol_version\x18\x04 \x01(\r\"L\n\x1dStateTransitionBroadcastError\x12\x0c\n\x04\x63ode\x18\x01 \x01(\r\x12\x0f\n\x07message\x18\x02 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\";\n\x1f\x42roadcastStateTransitionRequest\x12\x18\n\x10state_transition\x18\x01 \x01(\x0c\"\"\n BroadcastStateTransitionResponse\"/\n\x12GetIdentityRequest\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\"\x97\x01\n\x13GetIdentityResponse\x12\x10\n\x08identity\x18\x01 \x01(\x0c\x12/\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.Proof\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\"3\n\x16GetDataContractRequest\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\"\xa0\x01\n\x17GetDataContractResponse\x12\x15\n\rdata_contract\x18\x01 \x01(\x0c\x12/\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.Proof\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\"\xb9\x01\n\x13GetDocumentsRequest\x12\x18\n\x10\x64\x61ta_contract_id\x18\x01 \x01(\x0c\x12\x15\n\rdocument_type\x18\x02 \x01(\t\x12\r\n\x05where\x18\x03 \x01(\x0c\x12\x10\n\x08order_by\x18\x04 \x01(\x0c\x12\r\n\x05limit\x18\x05 \x01(\r\x12\x15\n\x0bstart_after\x18\x06 \x01(\x0cH\x00\x12\x12\n\x08start_at\x18\x07 \x01(\x0cH\x00\x12\r\n\x05prove\x18\x08 \x01(\x08\x42\x07\n\x05start\"\x99\x01\n\x14GetDocumentsResponse\x12\x11\n\tdocuments\x18\x01 \x03(\x0c\x12/\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.Proof\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\"Q\n%GetIdentitiesByPublicKeyHashesRequest\x12\x19\n\x11public_key_hashes\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\"\xac\x01\n&GetIdentitiesByPublicKeyHashesResponse\x12\x12\n\nidentities\x18\x01 \x03(\x0c\x12/\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.Proof\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\"S\n#WaitForStateTransitionResultRequest\x12\x1d\n\x15state_transition_hash\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\"\xf0\x01\n$WaitForStateTransitionResultResponse\x12I\n\x05\x65rror\x18\x01 \x01(\x0b\x32\x38.org.dash.platform.dapi.v0.StateTransitionBroadcastErrorH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x0b\n\tresponses\"P\n\x14\x43onsensusParamsBlock\x12\x11\n\tmax_bytes\x18\x01 \x01(\t\x12\x0f\n\x07max_gas\x18\x02 \x01(\t\x12\x14\n\x0ctime_iota_ms\x18\x03 \x01(\t\"b\n\x17\x43onsensusParamsEvidence\x12\x1a\n\x12max_age_num_blocks\x18\x01 \x01(\t\x12\x18\n\x10max_age_duration\x18\x02 \x01(\t\x12\x11\n\tmax_bytes\x18\x03 \x01(\t\":\n\x19GetConsensusParamsRequest\x12\x0e\n\x06height\x18\x01 \x01(\x03\x12\r\n\x05prove\x18\x02 \x01(\x08\"\xa2\x01\n\x1aGetConsensusParamsResponse\x12>\n\x05\x62lock\x18\x01 \x01(\x0b\x32/.org.dash.platform.dapi.v0.ConsensusParamsBlock\x12\x44\n\x08\x65vidence\x18\x02 \x01(\x0b\x32\x32.org.dash.platform.dapi.v0.ConsensusParamsEvidence2\xc7\x07\n\x08Platform\x12\x93\x01\n\x18\x62roadcastStateTransition\x12:.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest\x1a;.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse\x12l\n\x0bgetIdentity\x12-.org.dash.platform.dapi.v0.GetIdentityRequest\x1a..org.dash.platform.dapi.v0.GetIdentityResponse\x12x\n\x0fgetDataContract\x12\x31.org.dash.platform.dapi.v0.GetDataContractRequest\x1a\x32.org.dash.platform.dapi.v0.GetDataContractResponse\x12o\n\x0cgetDocuments\x12..org.dash.platform.dapi.v0.GetDocumentsRequest\x1a/.org.dash.platform.dapi.v0.GetDocumentsResponse\x12\xa5\x01\n\x1egetIdentitiesByPublicKeyHashes\x12@.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest\x1a\x41.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse\x12\x9f\x01\n\x1cwaitForStateTransitionResult\x12>.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest\x1a?.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse\x12\x81\x01\n\x12getConsensusParams\x12\x34.org.dash.platform.dapi.v0.GetConsensusParamsRequest\x1a\x35.org.dash.platform.dapi.v0.GetConsensusParamsResponseb\x06proto3' + serialized_pb=b'\n\x0eplatform.proto\x12\x19org.dash.platform.dapi.v0\x1a\x1egoogle/protobuf/wrappers.proto\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\"U\n\x05Proof\x12\x15\n\rgrovedb_proof\x18\x01 \x01(\x0c\x12\x13\n\x0bquorum_hash\x18\x02 \x01(\x0c\x12\x11\n\tsignature\x18\x03 \x01(\x0c\x12\r\n\x05round\x18\x04 \x01(\r\"o\n\x10ResponseMetadata\x12\x0e\n\x06height\x18\x01 \x01(\x04\x12 \n\x18\x63ore_chain_locked_height\x18\x02 \x01(\r\x12\x0f\n\x07time_ms\x18\x03 \x01(\x04\x12\x18\n\x10protocol_version\x18\x04 \x01(\r\"L\n\x1dStateTransitionBroadcastError\x12\x0c\n\x04\x63ode\x18\x01 \x01(\r\x12\x0f\n\x07message\x18\x02 \x01(\t\x12\x0c\n\x04\x64\x61ta\x18\x03 \x01(\x0c\";\n\x1f\x42roadcastStateTransitionRequest\x12\x18\n\x10state_transition\x18\x01 \x01(\x0c\"\"\n BroadcastStateTransitionResponse\"/\n\x12GetIdentityRequest\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\"\x97\x01\n\x13GetIdentityResponse\x12\x10\n\x08identity\x18\x01 \x01(\x0c\x12/\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.Proof\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\"\xbb\x01\n\x1aGetIdentityBalanceResponse\x12-\n\x07\x62\x61lance\x18\x01 \x01(\x0b\x32\x1c.google.protobuf.UInt64Value\x12/\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.Proof\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\"\xf6\x01\n%GetIdentityBalanceAndRevisionResponse\x12-\n\x07\x62\x61lance\x18\x01 \x01(\x0b\x32\x1c.google.protobuf.UInt64Value\x12.\n\x08revision\x18\x02 \x01(\x0b\x32\x1c.google.protobuf.UInt64Value\x12/\n\x05proof\x18\x03 \x01(\x0b\x32 .org.dash.platform.dapi.v0.Proof\x12=\n\x08metadata\x18\x04 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\"\xd1\x01\n\x0eKeyRequestType\x12\x36\n\x08\x61ll_keys\x18\x01 \x01(\x0b\x32\".org.dash.platform.dapi.v0.AllKeysH\x00\x12@\n\rspecific_keys\x18\x02 \x01(\x0b\x32\'.org.dash.platform.dapi.v0.SpecificKeysH\x00\x12:\n\nsearch_key\x18\x03 \x01(\x0b\x32$.org.dash.platform.dapi.v0.SearchKeyH\x00\x42\t\n\x07request\"\t\n\x07\x41llKeys\"\x1f\n\x0cSpecificKeys\x12\x0f\n\x07key_ids\x18\x01 \x03(\r\"\xb6\x01\n\tSearchKey\x12I\n\x0bpurpose_map\x18\x01 \x03(\x0b\x32\x34.org.dash.platform.dapi.v0.SearchKey.PurposeMapEntry\x1a^\n\x0fPurposeMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12:\n\x05value\x18\x02 \x01(\x0b\x32+.org.dash.platform.dapi.v0.SecurityLevelMap:\x02\x38\x01\"\xbf\x02\n\x10SecurityLevelMap\x12]\n\x12security_level_map\x18\x01 \x03(\x0b\x32\x41.org.dash.platform.dapi.v0.SecurityLevelMap.SecurityLevelMapEntry\x1aw\n\x15SecurityLevelMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12M\n\x05value\x18\x02 \x01(\x0e\x32>.org.dash.platform.dapi.v0.SecurityLevelMap.KeyKindRequestType:\x02\x38\x01\"S\n\x12KeyKindRequestType\x12\x1f\n\x1b\x43URRENT_KEY_OF_KIND_REQUEST\x10\x00\x12\x1c\n\x18\x41LL_KEYS_OF_KIND_REQUEST\x10\x01\"\xd8\x01\n\x16GetIdentityKeysRequest\x12\x13\n\x0bidentity_id\x18\x01 \x01(\x0c\x12?\n\x0crequest_type\x18\x02 \x01(\x0b\x32).org.dash.platform.dapi.v0.KeyRequestType\x12+\n\x05limit\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12,\n\x06offset\x18\x04 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12\r\n\x05prove\x18\x05 \x01(\x08\"\xfa\x01\n\x17GetIdentityKeysResponse\x12G\n\x04keys\x18\x01 \x01(\x0b\x32\x37.org.dash.platform.dapi.v0.GetIdentityKeysResponse.KeysH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x1a\n\x04Keys\x12\x12\n\nkeys_bytes\x18\x01 \x03(\x0c\x42\x08\n\x06result\"\xb2\x04\n\x18GetIdentitiesKeysRequest\x12\x14\n\x0cidentity_ids\x18\x01 \x03(\x0c\x12?\n\x0crequest_type\x18\x02 \x01(\x0b\x32).org.dash.platform.dapi.v0.KeyRequestType\x12+\n\x05limit\x18\x03 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12,\n\x06offset\x18\x04 \x01(\x0b\x32\x1c.google.protobuf.UInt32Value\x12\r\n\x05prove\x18\x05 \x01(\x08\x1a\xd4\x02\n\x10SecurityLevelMap\x12v\n\x12security_level_map\x18\x01 \x03(\x0b\x32Z.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap.SecurityLevelMapEntry\x1a\x90\x01\n\x15SecurityLevelMapEntry\x12\x0b\n\x03key\x18\x01 \x01(\r\x12\x66\n\x05value\x18\x02 \x01(\x0e\x32W.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap.KeyKindRequestType:\x02\x38\x01\"5\n\x12KeyKindRequestType\x12\x1f\n\x1b\x43URRENT_KEY_OF_KIND_REQUEST\x10\x00\"\xf4\x03\n\x19GetIdentitiesKeysResponse\x12\\\n\x0bpublic_keys\x18\x01 \x01(\x0b\x32\x45.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntriesH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\x1a\n\tPublicKey\x12\r\n\x05value\x18\x01 \x01(\x0c\x1al\n\x0ePublicKeyEntry\x12\x0b\n\x03key\x18\x01 \x01(\x0c\x12M\n\x05value\x18\x02 \x01(\x0b\x32>.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey\x1as\n\x10PublicKeyEntries\x12_\n\x12public_key_entries\x18\x01 \x03(\x0b\x32\x43.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntryB\x08\n\x06result\"3\n\x16GetDataContractRequest\x12\n\n\x02id\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\"\xa0\x01\n\x17GetDataContractResponse\x12\x15\n\rdata_contract\x18\x01 \x01(\x0c\x12/\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.Proof\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\"5\n\x17GetDataContractsRequest\x12\x0b\n\x03ids\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\"\x86\x04\n\x18GetDataContractsResponse\x12[\n\x0e\x64\x61ta_contracts\x18\x01 \x01(\x0b\x32\x41.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractsH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\x1a\"\n\x11\x44\x61taContractValue\x12\r\n\x05value\x18\x01 \x01(\x0c\x1av\n\x11\x44\x61taContractEntry\x12\x0b\n\x03key\x18\x01 \x01(\x0c\x12T\n\x05value\x18\x02 \x01(\x0b\x32\x45.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue\x1au\n\rDataContracts\x12\x64\n\x15\x64\x61ta_contract_entries\x18\x01 \x03(\x0b\x32\x45.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntryB\x08\n\x06result\"\xb9\x01\n\x13GetDocumentsRequest\x12\x18\n\x10\x64\x61ta_contract_id\x18\x01 \x01(\x0c\x12\x15\n\rdocument_type\x18\x02 \x01(\t\x12\r\n\x05where\x18\x03 \x01(\x0c\x12\x10\n\x08order_by\x18\x04 \x01(\x0c\x12\r\n\x05limit\x18\x05 \x01(\r\x12\x15\n\x0bstart_after\x18\x06 \x01(\x0cH\x00\x12\x12\n\x08start_at\x18\x07 \x01(\x0cH\x00\x12\r\n\x05prove\x18\x08 \x01(\x08\x42\x07\n\x05start\"\x99\x01\n\x14GetDocumentsResponse\x12\x11\n\tdocuments\x18\x01 \x03(\x0c\x12/\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.Proof\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\"Q\n%GetIdentitiesByPublicKeyHashesRequest\x12\x19\n\x11public_key_hashes\x18\x01 \x03(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\"\xac\x01\n&GetIdentitiesByPublicKeyHashesResponse\x12\x12\n\nidentities\x18\x01 \x03(\x0c\x12/\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.Proof\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadata\"M\n#GetIdentityByPublicKeyHashesRequest\x12\x17\n\x0fpublic_key_hash\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\"\xb6\x01\n$GetIdentityByPublicKeyHashesResponse\x12\x12\n\x08identity\x18\x01 \x01(\x0cH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x08\n\x06result\"S\n#WaitForStateTransitionResultRequest\x12\x1d\n\x15state_transition_hash\x18\x01 \x01(\x0c\x12\r\n\x05prove\x18\x02 \x01(\x08\"\xf0\x01\n$WaitForStateTransitionResultResponse\x12I\n\x05\x65rror\x18\x01 \x01(\x0b\x32\x38.org.dash.platform.dapi.v0.StateTransitionBroadcastErrorH\x00\x12\x31\n\x05proof\x18\x02 \x01(\x0b\x32 .org.dash.platform.dapi.v0.ProofH\x00\x12=\n\x08metadata\x18\x03 \x01(\x0b\x32+.org.dash.platform.dapi.v0.ResponseMetadataB\x0b\n\tresponses\"P\n\x14\x43onsensusParamsBlock\x12\x11\n\tmax_bytes\x18\x01 \x01(\t\x12\x0f\n\x07max_gas\x18\x02 \x01(\t\x12\x14\n\x0ctime_iota_ms\x18\x03 \x01(\t\"b\n\x17\x43onsensusParamsEvidence\x12\x1a\n\x12max_age_num_blocks\x18\x01 \x01(\t\x12\x18\n\x10max_age_duration\x18\x02 \x01(\t\x12\x11\n\tmax_bytes\x18\x03 \x01(\t\":\n\x19GetConsensusParamsRequest\x12\x0e\n\x06height\x18\x01 \x01(\x03\x12\r\n\x05prove\x18\x02 \x01(\x08\"\xa2\x01\n\x1aGetConsensusParamsResponse\x12>\n\x05\x62lock\x18\x01 \x01(\x0b\x32/.org.dash.platform.dapi.v0.ConsensusParamsBlock\x12\x44\n\x08\x65vidence\x18\x02 \x01(\x0b\x32\x32.org.dash.platform.dapi.v0.ConsensusParamsEvidence2\xef\x0c\n\x08Platform\x12\x93\x01\n\x18\x62roadcastStateTransition\x12:.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest\x1a;.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse\x12l\n\x0bgetIdentity\x12-.org.dash.platform.dapi.v0.GetIdentityRequest\x1a..org.dash.platform.dapi.v0.GetIdentityResponse\x12x\n\x0fgetIdentityKeys\x12\x31.org.dash.platform.dapi.v0.GetIdentityKeysRequest\x1a\x32.org.dash.platform.dapi.v0.GetIdentityKeysResponse\x12z\n\x12getIdentityBalance\x12-.org.dash.platform.dapi.v0.GetIdentityRequest\x1a\x35.org.dash.platform.dapi.v0.GetIdentityBalanceResponse\x12\x90\x01\n\x1dgetIdentityBalanceAndRevision\x12-.org.dash.platform.dapi.v0.GetIdentityRequest\x1a@.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse\x12x\n\x0fgetDataContract\x12\x31.org.dash.platform.dapi.v0.GetDataContractRequest\x1a\x32.org.dash.platform.dapi.v0.GetDataContractResponse\x12{\n\x10getDataContracts\x12\x32.org.dash.platform.dapi.v0.GetDataContractsRequest\x1a\x33.org.dash.platform.dapi.v0.GetDataContractsResponse\x12o\n\x0cgetDocuments\x12..org.dash.platform.dapi.v0.GetDocumentsRequest\x1a/.org.dash.platform.dapi.v0.GetDocumentsResponse\x12\xa5\x01\n\x1egetIdentitiesByPublicKeyHashes\x12@.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest\x1a\x41.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse\x12\x9f\x01\n\x1cgetIdentityByPublicKeyHashes\x12>.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest\x1a?.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse\x12\x9f\x01\n\x1cwaitForStateTransitionResult\x12>.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest\x1a?.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse\x12\x81\x01\n\x12getConsensusParams\x12\x34.org.dash.platform.dapi.v0.GetConsensusParamsRequest\x1a\x35.org.dash.platform.dapi.v0.GetConsensusParamsResponseb\x06proto3' , - dependencies=[google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR,]) + dependencies=[google_dot_protobuf_dot_wrappers__pb2.DESCRIPTOR,google_dot_protobuf_dot_struct__pb2.DESCRIPTOR,google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR,]) +_SECURITYLEVELMAP_KEYKINDREQUESTTYPE = _descriptor.EnumDescriptor( + name='KeyKindRequestType', + full_name='org.dash.platform.dapi.v0.SecurityLevelMap.KeyKindRequestType', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='CURRENT_KEY_OF_KIND_REQUEST', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + _descriptor.EnumValueDescriptor( + name='ALL_KEYS_OF_KIND_REQUEST', index=1, number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=1835, + serialized_end=1918, +) +_sym_db.RegisterEnumDescriptor(_SECURITYLEVELMAP_KEYKINDREQUESTTYPE) + +_GETIDENTITIESKEYSREQUEST_SECURITYLEVELMAP_KEYKINDREQUESTTYPE = _descriptor.EnumDescriptor( + name='KeyKindRequestType', + full_name='org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap.KeyKindRequestType', + filename=None, + file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, + values=[ + _descriptor.EnumValueDescriptor( + name='CURRENT_KEY_OF_KIND_REQUEST', index=0, number=0, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key), + ], + containing_type=None, + serialized_options=None, + serialized_start=1835, + serialized_end=1888, +) +_sym_db.RegisterEnumDescriptor(_GETIDENTITIESKEYSREQUEST_SECURITYLEVELMAP_KEYKINDREQUESTTYPE) + _PROOF = _descriptor.Descriptor( name='Proof', @@ -36,7 +83,7 @@ create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='merkle_proof', full_name='org.dash.platform.dapi.v0.Proof.merkle_proof', index=0, + name='grovedb_proof', full_name='org.dash.platform.dapi.v0.Proof.grovedb_proof', index=0, number=1, type=12, cpp_type=9, label=1, has_default_value=False, default_value=b"", message_type=None, enum_type=None, containing_type=None, @@ -75,8 +122,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=78, - serialized_end=162, + serialized_start=140, + serialized_end=225, ) @@ -90,7 +137,7 @@ fields=[ _descriptor.FieldDescriptor( name='height', full_name='org.dash.platform.dapi.v0.ResponseMetadata.height', index=0, - number=1, type=3, cpp_type=2, label=1, + number=1, type=4, cpp_type=4, label=1, has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, @@ -128,8 +175,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=164, - serialized_end=275, + serialized_start=227, + serialized_end=338, ) @@ -174,8 +221,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=277, - serialized_end=353, + serialized_start=340, + serialized_end=416, ) @@ -188,9 +235,975 @@ create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='state_transition', full_name='org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.state_transition', index=0, - number=1, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=b"", + name='state_transition', full_name='org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.state_transition', index=0, + number=1, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=b"", + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=418, + serialized_end=477, +) + + +_BROADCASTSTATETRANSITIONRESPONSE = _descriptor.Descriptor( + name='BroadcastStateTransitionResponse', + full_name='org.dash.platform.dapi.v0.BroadcastStateTransitionResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=479, + serialized_end=513, +) + + +_GETIDENTITYREQUEST = _descriptor.Descriptor( + name='GetIdentityRequest', + full_name='org.dash.platform.dapi.v0.GetIdentityRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='id', full_name='org.dash.platform.dapi.v0.GetIdentityRequest.id', index=0, + number=1, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=b"", + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='prove', full_name='org.dash.platform.dapi.v0.GetIdentityRequest.prove', index=1, + number=2, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=515, + serialized_end=562, +) + + +_GETIDENTITYRESPONSE = _descriptor.Descriptor( + name='GetIdentityResponse', + full_name='org.dash.platform.dapi.v0.GetIdentityResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='identity', full_name='org.dash.platform.dapi.v0.GetIdentityResponse.identity', index=0, + number=1, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=b"", + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='proof', full_name='org.dash.platform.dapi.v0.GetIdentityResponse.proof', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='metadata', full_name='org.dash.platform.dapi.v0.GetIdentityResponse.metadata', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=565, + serialized_end=716, +) + + +_GETIDENTITYBALANCERESPONSE = _descriptor.Descriptor( + name='GetIdentityBalanceResponse', + full_name='org.dash.platform.dapi.v0.GetIdentityBalanceResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='balance', full_name='org.dash.platform.dapi.v0.GetIdentityBalanceResponse.balance', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='proof', full_name='org.dash.platform.dapi.v0.GetIdentityBalanceResponse.proof', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='metadata', full_name='org.dash.platform.dapi.v0.GetIdentityBalanceResponse.metadata', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=719, + serialized_end=906, +) + + +_GETIDENTITYBALANCEANDREVISIONRESPONSE = _descriptor.Descriptor( + name='GetIdentityBalanceAndRevisionResponse', + full_name='org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='balance', full_name='org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.balance', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='revision', full_name='org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.revision', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='proof', full_name='org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.proof', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='metadata', full_name='org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.metadata', index=3, + number=4, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=909, + serialized_end=1155, +) + + +_KEYREQUESTTYPE = _descriptor.Descriptor( + name='KeyRequestType', + full_name='org.dash.platform.dapi.v0.KeyRequestType', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='all_keys', full_name='org.dash.platform.dapi.v0.KeyRequestType.all_keys', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='specific_keys', full_name='org.dash.platform.dapi.v0.KeyRequestType.specific_keys', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='search_key', full_name='org.dash.platform.dapi.v0.KeyRequestType.search_key', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='request', full_name='org.dash.platform.dapi.v0.KeyRequestType.request', + index=0, containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[]), + ], + serialized_start=1158, + serialized_end=1367, +) + + +_ALLKEYS = _descriptor.Descriptor( + name='AllKeys', + full_name='org.dash.platform.dapi.v0.AllKeys', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1369, + serialized_end=1378, +) + + +_SPECIFICKEYS = _descriptor.Descriptor( + name='SpecificKeys', + full_name='org.dash.platform.dapi.v0.SpecificKeys', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='key_ids', full_name='org.dash.platform.dapi.v0.SpecificKeys.key_ids', index=0, + number=1, type=13, cpp_type=3, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1380, + serialized_end=1411, +) + + +_SEARCHKEY_PURPOSEMAPENTRY = _descriptor.Descriptor( + name='PurposeMapEntry', + full_name='org.dash.platform.dapi.v0.SearchKey.PurposeMapEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='org.dash.platform.dapi.v0.SearchKey.PurposeMapEntry.key', index=0, + number=1, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='value', full_name='org.dash.platform.dapi.v0.SearchKey.PurposeMapEntry.value', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=b'8\001', + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1502, + serialized_end=1596, +) + +_SEARCHKEY = _descriptor.Descriptor( + name='SearchKey', + full_name='org.dash.platform.dapi.v0.SearchKey', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='purpose_map', full_name='org.dash.platform.dapi.v0.SearchKey.purpose_map', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[_SEARCHKEY_PURPOSEMAPENTRY, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1414, + serialized_end=1596, +) + + +_SECURITYLEVELMAP_SECURITYLEVELMAPENTRY = _descriptor.Descriptor( + name='SecurityLevelMapEntry', + full_name='org.dash.platform.dapi.v0.SecurityLevelMap.SecurityLevelMapEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='org.dash.platform.dapi.v0.SecurityLevelMap.SecurityLevelMapEntry.key', index=0, + number=1, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='value', full_name='org.dash.platform.dapi.v0.SecurityLevelMap.SecurityLevelMapEntry.value', index=1, + number=2, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=b'8\001', + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1714, + serialized_end=1833, +) + +_SECURITYLEVELMAP = _descriptor.Descriptor( + name='SecurityLevelMap', + full_name='org.dash.platform.dapi.v0.SecurityLevelMap', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='security_level_map', full_name='org.dash.platform.dapi.v0.SecurityLevelMap.security_level_map', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[_SECURITYLEVELMAP_SECURITYLEVELMAPENTRY, ], + enum_types=[ + _SECURITYLEVELMAP_KEYKINDREQUESTTYPE, + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1599, + serialized_end=1918, +) + + +_GETIDENTITYKEYSREQUEST = _descriptor.Descriptor( + name='GetIdentityKeysRequest', + full_name='org.dash.platform.dapi.v0.GetIdentityKeysRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='identity_id', full_name='org.dash.platform.dapi.v0.GetIdentityKeysRequest.identity_id', index=0, + number=1, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=b"", + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='request_type', full_name='org.dash.platform.dapi.v0.GetIdentityKeysRequest.request_type', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='limit', full_name='org.dash.platform.dapi.v0.GetIdentityKeysRequest.limit', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='offset', full_name='org.dash.platform.dapi.v0.GetIdentityKeysRequest.offset', index=3, + number=4, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='prove', full_name='org.dash.platform.dapi.v0.GetIdentityKeysRequest.prove', index=4, + number=5, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=1921, + serialized_end=2137, +) + + +_GETIDENTITYKEYSRESPONSE_KEYS = _descriptor.Descriptor( + name='Keys', + full_name='org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='keys_bytes', full_name='org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.keys_bytes', index=0, + number=1, type=12, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2354, + serialized_end=2380, +) + +_GETIDENTITYKEYSRESPONSE = _descriptor.Descriptor( + name='GetIdentityKeysResponse', + full_name='org.dash.platform.dapi.v0.GetIdentityKeysResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='keys', full_name='org.dash.platform.dapi.v0.GetIdentityKeysResponse.keys', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='proof', full_name='org.dash.platform.dapi.v0.GetIdentityKeysResponse.proof', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='metadata', full_name='org.dash.platform.dapi.v0.GetIdentityKeysResponse.metadata', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[_GETIDENTITYKEYSRESPONSE_KEYS, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='result', full_name='org.dash.platform.dapi.v0.GetIdentityKeysResponse.result', + index=0, containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[]), + ], + serialized_start=2140, + serialized_end=2390, +) + + +_GETIDENTITIESKEYSREQUEST_SECURITYLEVELMAP_SECURITYLEVELMAPENTRY = _descriptor.Descriptor( + name='SecurityLevelMapEntry', + full_name='org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap.SecurityLevelMapEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap.SecurityLevelMapEntry.key', index=0, + number=1, type=13, cpp_type=3, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='value', full_name='org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap.SecurityLevelMapEntry.value', index=1, + number=2, type=14, cpp_type=8, label=1, + has_default_value=False, default_value=0, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=b'8\001', + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2756, + serialized_end=2900, +) + +_GETIDENTITIESKEYSREQUEST_SECURITYLEVELMAP = _descriptor.Descriptor( + name='SecurityLevelMap', + full_name='org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='security_level_map', full_name='org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap.security_level_map', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[_GETIDENTITIESKEYSREQUEST_SECURITYLEVELMAP_SECURITYLEVELMAPENTRY, ], + enum_types=[ + _GETIDENTITIESKEYSREQUEST_SECURITYLEVELMAP_KEYKINDREQUESTTYPE, + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2615, + serialized_end=2955, +) + +_GETIDENTITIESKEYSREQUEST = _descriptor.Descriptor( + name='GetIdentitiesKeysRequest', + full_name='org.dash.platform.dapi.v0.GetIdentitiesKeysRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='identity_ids', full_name='org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.identity_ids', index=0, + number=1, type=12, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='request_type', full_name='org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.request_type', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='limit', full_name='org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.limit', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='offset', full_name='org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.offset', index=3, + number=4, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='prove', full_name='org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.prove', index=4, + number=5, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[_GETIDENTITIESKEYSREQUEST_SECURITYLEVELMAP, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=2393, + serialized_end=2955, +) + + +_GETIDENTITIESKEYSRESPONSE_PUBLICKEY = _descriptor.Descriptor( + name='PublicKey', + full_name='org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='value', full_name='org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey.value', index=0, + number=1, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=b"", + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3195, + serialized_end=3221, +) + +_GETIDENTITIESKEYSRESPONSE_PUBLICKEYENTRY = _descriptor.Descriptor( + name='PublicKeyEntry', + full_name='org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='key', full_name='org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.key', index=0, + number=1, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=b"", + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='value', full_name='org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.value', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3223, + serialized_end=3331, +) + +_GETIDENTITIESKEYSRESPONSE_PUBLICKEYENTRIES = _descriptor.Descriptor( + name='PublicKeyEntries', + full_name='org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='public_key_entries', full_name='org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.public_key_entries', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3333, + serialized_end=3448, +) + +_GETIDENTITIESKEYSRESPONSE = _descriptor.Descriptor( + name='GetIdentitiesKeysResponse', + full_name='org.dash.platform.dapi.v0.GetIdentitiesKeysResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='public_keys', full_name='org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.public_keys', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='proof', full_name='org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.proof', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='metadata', full_name='org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.metadata', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[_GETIDENTITIESKEYSRESPONSE_PUBLICKEY, _GETIDENTITIESKEYSRESPONSE_PUBLICKEYENTRY, _GETIDENTITIESKEYSRESPONSE_PUBLICKEYENTRIES, ], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='result', full_name='org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.result', + index=0, containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[]), + ], + serialized_start=2958, + serialized_end=3458, +) + + +_GETDATACONTRACTREQUEST = _descriptor.Descriptor( + name='GetDataContractRequest', + full_name='org.dash.platform.dapi.v0.GetDataContractRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='id', full_name='org.dash.platform.dapi.v0.GetDataContractRequest.id', index=0, + number=1, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=b"", + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='prove', full_name='org.dash.platform.dapi.v0.GetDataContractRequest.prove', index=1, + number=2, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=3460, + serialized_end=3511, +) + + +_GETDATACONTRACTRESPONSE = _descriptor.Descriptor( + name='GetDataContractResponse', + full_name='org.dash.platform.dapi.v0.GetDataContractResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='data_contract', full_name='org.dash.platform.dapi.v0.GetDataContractResponse.data_contract', index=0, + number=1, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=b"", + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='proof', full_name='org.dash.platform.dapi.v0.GetDataContractResponse.proof', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='metadata', full_name='org.dash.platform.dapi.v0.GetDataContractResponse.metadata', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), @@ -206,19 +1219,33 @@ extension_ranges=[], oneofs=[ ], - serialized_start=355, - serialized_end=414, + serialized_start=3514, + serialized_end=3674, ) -_BROADCASTSTATETRANSITIONRESPONSE = _descriptor.Descriptor( - name='BroadcastStateTransitionResponse', - full_name='org.dash.platform.dapi.v0.BroadcastStateTransitionResponse', +_GETDATACONTRACTSREQUEST = _descriptor.Descriptor( + name='GetDataContractsRequest', + full_name='org.dash.platform.dapi.v0.GetDataContractsRequest', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ + _descriptor.FieldDescriptor( + name='ids', full_name='org.dash.platform.dapi.v0.GetDataContractsRequest.ids', index=0, + number=1, type=12, cpp_type=9, label=3, + has_default_value=False, default_value=[], + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='prove', full_name='org.dash.platform.dapi.v0.GetDataContractsRequest.prove', index=1, + number=2, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -231,33 +1258,26 @@ extension_ranges=[], oneofs=[ ], - serialized_start=416, - serialized_end=450, + serialized_start=3676, + serialized_end=3729, ) -_GETIDENTITYREQUEST = _descriptor.Descriptor( - name='GetIdentityRequest', - full_name='org.dash.platform.dapi.v0.GetIdentityRequest', +_GETDATACONTRACTSRESPONSE_DATACONTRACTVALUE = _descriptor.Descriptor( + name='DataContractValue', + full_name='org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='id', full_name='org.dash.platform.dapi.v0.GetIdentityRequest.id', index=0, + name='value', full_name='org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue.value', index=0, number=1, type=12, cpp_type=9, label=1, has_default_value=False, default_value=b"", message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='prove', full_name='org.dash.platform.dapi.v0.GetIdentityRequest.prove', index=1, - number=2, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -270,40 +1290,32 @@ extension_ranges=[], oneofs=[ ], - serialized_start=452, - serialized_end=499, + serialized_start=3967, + serialized_end=4001, ) - -_GETIDENTITYRESPONSE = _descriptor.Descriptor( - name='GetIdentityResponse', - full_name='org.dash.platform.dapi.v0.GetIdentityResponse', +_GETDATACONTRACTSRESPONSE_DATACONTRACTENTRY = _descriptor.Descriptor( + name='DataContractEntry', + full_name='org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='identity', full_name='org.dash.platform.dapi.v0.GetIdentityResponse.identity', index=0, + name='key', full_name='org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.key', index=0, number=1, type=12, cpp_type=9, label=1, has_default_value=False, default_value=b"", message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='proof', full_name='org.dash.platform.dapi.v0.GetIdentityResponse.proof', index=1, + name='value', full_name='org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.value', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='metadata', full_name='org.dash.platform.dapi.v0.GetIdentityResponse.metadata', index=2, - number=3, type=11, cpp_type=10, label=1, - has_default_value=False, default_value=None, - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), ], extensions=[ ], @@ -316,30 +1328,22 @@ extension_ranges=[], oneofs=[ ], - serialized_start=502, - serialized_end=653, + serialized_start=4003, + serialized_end=4121, ) - -_GETDATACONTRACTREQUEST = _descriptor.Descriptor( - name='GetDataContractRequest', - full_name='org.dash.platform.dapi.v0.GetDataContractRequest', +_GETDATACONTRACTSRESPONSE_DATACONTRACTS = _descriptor.Descriptor( + name='DataContracts', + full_name='org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='id', full_name='org.dash.platform.dapi.v0.GetDataContractRequest.id', index=0, - number=1, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=b"", - message_type=None, enum_type=None, containing_type=None, - is_extension=False, extension_scope=None, - serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), - _descriptor.FieldDescriptor( - name='prove', full_name='org.dash.platform.dapi.v0.GetDataContractRequest.prove', index=1, - number=2, type=8, cpp_type=7, label=1, - has_default_value=False, default_value=False, + name='data_contract_entries', full_name='org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.data_contract_entries', index=0, + number=1, type=11, cpp_type=10, label=3, + has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), @@ -355,35 +1359,34 @@ extension_ranges=[], oneofs=[ ], - serialized_start=655, - serialized_end=706, + serialized_start=4123, + serialized_end=4240, ) - -_GETDATACONTRACTRESPONSE = _descriptor.Descriptor( - name='GetDataContractResponse', - full_name='org.dash.platform.dapi.v0.GetDataContractResponse', +_GETDATACONTRACTSRESPONSE = _descriptor.Descriptor( + name='GetDataContractsResponse', + full_name='org.dash.platform.dapi.v0.GetDataContractsResponse', filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( - name='data_contract', full_name='org.dash.platform.dapi.v0.GetDataContractResponse.data_contract', index=0, - number=1, type=12, cpp_type=9, label=1, - has_default_value=False, default_value=b"", + name='data_contracts', full_name='org.dash.platform.dapi.v0.GetDataContractsResponse.data_contracts', index=0, + number=1, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='proof', full_name='org.dash.platform.dapi.v0.GetDataContractResponse.proof', index=1, + name='proof', full_name='org.dash.platform.dapi.v0.GetDataContractsResponse.proof', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), _descriptor.FieldDescriptor( - name='metadata', full_name='org.dash.platform.dapi.v0.GetDataContractResponse.metadata', index=2, + name='metadata', full_name='org.dash.platform.dapi.v0.GetDataContractsResponse.metadata', index=2, number=3, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, @@ -392,7 +1395,7 @@ ], extensions=[ ], - nested_types=[], + nested_types=[_GETDATACONTRACTSRESPONSE_DATACONTRACTVALUE, _GETDATACONTRACTSRESPONSE_DATACONTRACTENTRY, _GETDATACONTRACTSRESPONSE_DATACONTRACTS, ], enum_types=[ ], serialized_options=None, @@ -400,9 +1403,14 @@ syntax='proto3', extension_ranges=[], oneofs=[ + _descriptor.OneofDescriptor( + name='result', full_name='org.dash.platform.dapi.v0.GetDataContractsResponse.result', + index=0, containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[]), ], - serialized_start=709, - serialized_end=869, + serialized_start=3732, + serialized_end=4250, ) @@ -487,8 +1495,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=872, - serialized_end=1057, + serialized_start=4253, + serialized_end=4438, ) @@ -533,8 +1541,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1060, - serialized_end=1213, + serialized_start=4441, + serialized_end=4594, ) @@ -572,8 +1580,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1215, - serialized_end=1296, + serialized_start=4596, + serialized_end=4677, ) @@ -618,8 +1626,98 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1299, - serialized_end=1471, + serialized_start=4680, + serialized_end=4852, +) + + +_GETIDENTITYBYPUBLICKEYHASHESREQUEST = _descriptor.Descriptor( + name='GetIdentityByPublicKeyHashesRequest', + full_name='org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='public_key_hash', full_name='org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest.public_key_hash', index=0, + number=1, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=b"", + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='prove', full_name='org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest.prove', index=1, + number=2, type=8, cpp_type=7, label=1, + has_default_value=False, default_value=False, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + ], + serialized_start=4854, + serialized_end=4931, +) + + +_GETIDENTITYBYPUBLICKEYHASHESRESPONSE = _descriptor.Descriptor( + name='GetIdentityByPublicKeyHashesResponse', + full_name='org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse', + filename=None, + file=DESCRIPTOR, + containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[ + _descriptor.FieldDescriptor( + name='identity', full_name='org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.identity', index=0, + number=1, type=12, cpp_type=9, label=1, + has_default_value=False, default_value=b"", + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='proof', full_name='org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.proof', index=1, + number=2, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + _descriptor.FieldDescriptor( + name='metadata', full_name='org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.metadata', index=2, + number=3, type=11, cpp_type=10, label=1, + has_default_value=False, default_value=None, + message_type=None, enum_type=None, containing_type=None, + is_extension=False, extension_scope=None, + serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), + ], + extensions=[ + ], + nested_types=[], + enum_types=[ + ], + serialized_options=None, + is_extendable=False, + syntax='proto3', + extension_ranges=[], + oneofs=[ + _descriptor.OneofDescriptor( + name='result', full_name='org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.result', + index=0, containing_type=None, + create_key=_descriptor._internal_create_key, + fields=[]), + ], + serialized_start=4934, + serialized_end=5116, ) @@ -657,8 +1755,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1473, - serialized_end=1556, + serialized_start=5118, + serialized_end=5201, ) @@ -708,8 +1806,8 @@ create_key=_descriptor._internal_create_key, fields=[]), ], - serialized_start=1559, - serialized_end=1799, + serialized_start=5204, + serialized_end=5444, ) @@ -754,8 +1852,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1801, - serialized_end=1881, + serialized_start=5446, + serialized_end=5526, ) @@ -800,8 +1898,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1883, - serialized_end=1981, + serialized_start=5528, + serialized_end=5626, ) @@ -839,8 +1937,8 @@ extension_ranges=[], oneofs=[ ], - serialized_start=1983, - serialized_end=2041, + serialized_start=5628, + serialized_end=5686, ) @@ -878,14 +1976,89 @@ extension_ranges=[], oneofs=[ ], - serialized_start=2044, - serialized_end=2206, + serialized_start=5689, + serialized_end=5851, ) _GETIDENTITYRESPONSE.fields_by_name['proof'].message_type = _PROOF _GETIDENTITYRESPONSE.fields_by_name['metadata'].message_type = _RESPONSEMETADATA +_GETIDENTITYBALANCERESPONSE.fields_by_name['balance'].message_type = google_dot_protobuf_dot_wrappers__pb2._UINT64VALUE +_GETIDENTITYBALANCERESPONSE.fields_by_name['proof'].message_type = _PROOF +_GETIDENTITYBALANCERESPONSE.fields_by_name['metadata'].message_type = _RESPONSEMETADATA +_GETIDENTITYBALANCEANDREVISIONRESPONSE.fields_by_name['balance'].message_type = google_dot_protobuf_dot_wrappers__pb2._UINT64VALUE +_GETIDENTITYBALANCEANDREVISIONRESPONSE.fields_by_name['revision'].message_type = google_dot_protobuf_dot_wrappers__pb2._UINT64VALUE +_GETIDENTITYBALANCEANDREVISIONRESPONSE.fields_by_name['proof'].message_type = _PROOF +_GETIDENTITYBALANCEANDREVISIONRESPONSE.fields_by_name['metadata'].message_type = _RESPONSEMETADATA +_KEYREQUESTTYPE.fields_by_name['all_keys'].message_type = _ALLKEYS +_KEYREQUESTTYPE.fields_by_name['specific_keys'].message_type = _SPECIFICKEYS +_KEYREQUESTTYPE.fields_by_name['search_key'].message_type = _SEARCHKEY +_KEYREQUESTTYPE.oneofs_by_name['request'].fields.append( + _KEYREQUESTTYPE.fields_by_name['all_keys']) +_KEYREQUESTTYPE.fields_by_name['all_keys'].containing_oneof = _KEYREQUESTTYPE.oneofs_by_name['request'] +_KEYREQUESTTYPE.oneofs_by_name['request'].fields.append( + _KEYREQUESTTYPE.fields_by_name['specific_keys']) +_KEYREQUESTTYPE.fields_by_name['specific_keys'].containing_oneof = _KEYREQUESTTYPE.oneofs_by_name['request'] +_KEYREQUESTTYPE.oneofs_by_name['request'].fields.append( + _KEYREQUESTTYPE.fields_by_name['search_key']) +_KEYREQUESTTYPE.fields_by_name['search_key'].containing_oneof = _KEYREQUESTTYPE.oneofs_by_name['request'] +_SEARCHKEY_PURPOSEMAPENTRY.fields_by_name['value'].message_type = _SECURITYLEVELMAP +_SEARCHKEY_PURPOSEMAPENTRY.containing_type = _SEARCHKEY +_SEARCHKEY.fields_by_name['purpose_map'].message_type = _SEARCHKEY_PURPOSEMAPENTRY +_SECURITYLEVELMAP_SECURITYLEVELMAPENTRY.fields_by_name['value'].enum_type = _SECURITYLEVELMAP_KEYKINDREQUESTTYPE +_SECURITYLEVELMAP_SECURITYLEVELMAPENTRY.containing_type = _SECURITYLEVELMAP +_SECURITYLEVELMAP.fields_by_name['security_level_map'].message_type = _SECURITYLEVELMAP_SECURITYLEVELMAPENTRY +_SECURITYLEVELMAP_KEYKINDREQUESTTYPE.containing_type = _SECURITYLEVELMAP +_GETIDENTITYKEYSREQUEST.fields_by_name['request_type'].message_type = _KEYREQUESTTYPE +_GETIDENTITYKEYSREQUEST.fields_by_name['limit'].message_type = google_dot_protobuf_dot_wrappers__pb2._UINT32VALUE +_GETIDENTITYKEYSREQUEST.fields_by_name['offset'].message_type = google_dot_protobuf_dot_wrappers__pb2._UINT32VALUE +_GETIDENTITYKEYSRESPONSE_KEYS.containing_type = _GETIDENTITYKEYSRESPONSE +_GETIDENTITYKEYSRESPONSE.fields_by_name['keys'].message_type = _GETIDENTITYKEYSRESPONSE_KEYS +_GETIDENTITYKEYSRESPONSE.fields_by_name['proof'].message_type = _PROOF +_GETIDENTITYKEYSRESPONSE.fields_by_name['metadata'].message_type = _RESPONSEMETADATA +_GETIDENTITYKEYSRESPONSE.oneofs_by_name['result'].fields.append( + _GETIDENTITYKEYSRESPONSE.fields_by_name['keys']) +_GETIDENTITYKEYSRESPONSE.fields_by_name['keys'].containing_oneof = _GETIDENTITYKEYSRESPONSE.oneofs_by_name['result'] +_GETIDENTITYKEYSRESPONSE.oneofs_by_name['result'].fields.append( + _GETIDENTITYKEYSRESPONSE.fields_by_name['proof']) +_GETIDENTITYKEYSRESPONSE.fields_by_name['proof'].containing_oneof = _GETIDENTITYKEYSRESPONSE.oneofs_by_name['result'] +_GETIDENTITIESKEYSREQUEST_SECURITYLEVELMAP_SECURITYLEVELMAPENTRY.fields_by_name['value'].enum_type = _GETIDENTITIESKEYSREQUEST_SECURITYLEVELMAP_KEYKINDREQUESTTYPE +_GETIDENTITIESKEYSREQUEST_SECURITYLEVELMAP_SECURITYLEVELMAPENTRY.containing_type = _GETIDENTITIESKEYSREQUEST_SECURITYLEVELMAP +_GETIDENTITIESKEYSREQUEST_SECURITYLEVELMAP.fields_by_name['security_level_map'].message_type = _GETIDENTITIESKEYSREQUEST_SECURITYLEVELMAP_SECURITYLEVELMAPENTRY +_GETIDENTITIESKEYSREQUEST_SECURITYLEVELMAP.containing_type = _GETIDENTITIESKEYSREQUEST +_GETIDENTITIESKEYSREQUEST_SECURITYLEVELMAP_KEYKINDREQUESTTYPE.containing_type = _GETIDENTITIESKEYSREQUEST_SECURITYLEVELMAP +_GETIDENTITIESKEYSREQUEST.fields_by_name['request_type'].message_type = _KEYREQUESTTYPE +_GETIDENTITIESKEYSREQUEST.fields_by_name['limit'].message_type = google_dot_protobuf_dot_wrappers__pb2._UINT32VALUE +_GETIDENTITIESKEYSREQUEST.fields_by_name['offset'].message_type = google_dot_protobuf_dot_wrappers__pb2._UINT32VALUE +_GETIDENTITIESKEYSRESPONSE_PUBLICKEY.containing_type = _GETIDENTITIESKEYSRESPONSE +_GETIDENTITIESKEYSRESPONSE_PUBLICKEYENTRY.fields_by_name['value'].message_type = _GETIDENTITIESKEYSRESPONSE_PUBLICKEY +_GETIDENTITIESKEYSRESPONSE_PUBLICKEYENTRY.containing_type = _GETIDENTITIESKEYSRESPONSE +_GETIDENTITIESKEYSRESPONSE_PUBLICKEYENTRIES.fields_by_name['public_key_entries'].message_type = _GETIDENTITIESKEYSRESPONSE_PUBLICKEYENTRY +_GETIDENTITIESKEYSRESPONSE_PUBLICKEYENTRIES.containing_type = _GETIDENTITIESKEYSRESPONSE +_GETIDENTITIESKEYSRESPONSE.fields_by_name['public_keys'].message_type = _GETIDENTITIESKEYSRESPONSE_PUBLICKEYENTRIES +_GETIDENTITIESKEYSRESPONSE.fields_by_name['proof'].message_type = _PROOF +_GETIDENTITIESKEYSRESPONSE.fields_by_name['metadata'].message_type = _RESPONSEMETADATA +_GETIDENTITIESKEYSRESPONSE.oneofs_by_name['result'].fields.append( + _GETIDENTITIESKEYSRESPONSE.fields_by_name['public_keys']) +_GETIDENTITIESKEYSRESPONSE.fields_by_name['public_keys'].containing_oneof = _GETIDENTITIESKEYSRESPONSE.oneofs_by_name['result'] +_GETIDENTITIESKEYSRESPONSE.oneofs_by_name['result'].fields.append( + _GETIDENTITIESKEYSRESPONSE.fields_by_name['proof']) +_GETIDENTITIESKEYSRESPONSE.fields_by_name['proof'].containing_oneof = _GETIDENTITIESKEYSRESPONSE.oneofs_by_name['result'] _GETDATACONTRACTRESPONSE.fields_by_name['proof'].message_type = _PROOF _GETDATACONTRACTRESPONSE.fields_by_name['metadata'].message_type = _RESPONSEMETADATA +_GETDATACONTRACTSRESPONSE_DATACONTRACTVALUE.containing_type = _GETDATACONTRACTSRESPONSE +_GETDATACONTRACTSRESPONSE_DATACONTRACTENTRY.fields_by_name['value'].message_type = _GETDATACONTRACTSRESPONSE_DATACONTRACTVALUE +_GETDATACONTRACTSRESPONSE_DATACONTRACTENTRY.containing_type = _GETDATACONTRACTSRESPONSE +_GETDATACONTRACTSRESPONSE_DATACONTRACTS.fields_by_name['data_contract_entries'].message_type = _GETDATACONTRACTSRESPONSE_DATACONTRACTENTRY +_GETDATACONTRACTSRESPONSE_DATACONTRACTS.containing_type = _GETDATACONTRACTSRESPONSE +_GETDATACONTRACTSRESPONSE.fields_by_name['data_contracts'].message_type = _GETDATACONTRACTSRESPONSE_DATACONTRACTS +_GETDATACONTRACTSRESPONSE.fields_by_name['proof'].message_type = _PROOF +_GETDATACONTRACTSRESPONSE.fields_by_name['metadata'].message_type = _RESPONSEMETADATA +_GETDATACONTRACTSRESPONSE.oneofs_by_name['result'].fields.append( + _GETDATACONTRACTSRESPONSE.fields_by_name['data_contracts']) +_GETDATACONTRACTSRESPONSE.fields_by_name['data_contracts'].containing_oneof = _GETDATACONTRACTSRESPONSE.oneofs_by_name['result'] +_GETDATACONTRACTSRESPONSE.oneofs_by_name['result'].fields.append( + _GETDATACONTRACTSRESPONSE.fields_by_name['proof']) +_GETDATACONTRACTSRESPONSE.fields_by_name['proof'].containing_oneof = _GETDATACONTRACTSRESPONSE.oneofs_by_name['result'] _GETDOCUMENTSREQUEST.oneofs_by_name['start'].fields.append( _GETDOCUMENTSREQUEST.fields_by_name['start_after']) _GETDOCUMENTSREQUEST.fields_by_name['start_after'].containing_oneof = _GETDOCUMENTSREQUEST.oneofs_by_name['start'] @@ -896,6 +2069,14 @@ _GETDOCUMENTSRESPONSE.fields_by_name['metadata'].message_type = _RESPONSEMETADATA _GETIDENTITIESBYPUBLICKEYHASHESRESPONSE.fields_by_name['proof'].message_type = _PROOF _GETIDENTITIESBYPUBLICKEYHASHESRESPONSE.fields_by_name['metadata'].message_type = _RESPONSEMETADATA +_GETIDENTITYBYPUBLICKEYHASHESRESPONSE.fields_by_name['proof'].message_type = _PROOF +_GETIDENTITYBYPUBLICKEYHASHESRESPONSE.fields_by_name['metadata'].message_type = _RESPONSEMETADATA +_GETIDENTITYBYPUBLICKEYHASHESRESPONSE.oneofs_by_name['result'].fields.append( + _GETIDENTITYBYPUBLICKEYHASHESRESPONSE.fields_by_name['identity']) +_GETIDENTITYBYPUBLICKEYHASHESRESPONSE.fields_by_name['identity'].containing_oneof = _GETIDENTITYBYPUBLICKEYHASHESRESPONSE.oneofs_by_name['result'] +_GETIDENTITYBYPUBLICKEYHASHESRESPONSE.oneofs_by_name['result'].fields.append( + _GETIDENTITYBYPUBLICKEYHASHESRESPONSE.fields_by_name['proof']) +_GETIDENTITYBYPUBLICKEYHASHESRESPONSE.fields_by_name['proof'].containing_oneof = _GETIDENTITYBYPUBLICKEYHASHESRESPONSE.oneofs_by_name['result'] _WAITFORSTATETRANSITIONRESULTRESPONSE.fields_by_name['error'].message_type = _STATETRANSITIONBROADCASTERROR _WAITFORSTATETRANSITIONRESULTRESPONSE.fields_by_name['proof'].message_type = _PROOF _WAITFORSTATETRANSITIONRESULTRESPONSE.fields_by_name['metadata'].message_type = _RESPONSEMETADATA @@ -914,12 +2095,27 @@ DESCRIPTOR.message_types_by_name['BroadcastStateTransitionResponse'] = _BROADCASTSTATETRANSITIONRESPONSE DESCRIPTOR.message_types_by_name['GetIdentityRequest'] = _GETIDENTITYREQUEST DESCRIPTOR.message_types_by_name['GetIdentityResponse'] = _GETIDENTITYRESPONSE +DESCRIPTOR.message_types_by_name['GetIdentityBalanceResponse'] = _GETIDENTITYBALANCERESPONSE +DESCRIPTOR.message_types_by_name['GetIdentityBalanceAndRevisionResponse'] = _GETIDENTITYBALANCEANDREVISIONRESPONSE +DESCRIPTOR.message_types_by_name['KeyRequestType'] = _KEYREQUESTTYPE +DESCRIPTOR.message_types_by_name['AllKeys'] = _ALLKEYS +DESCRIPTOR.message_types_by_name['SpecificKeys'] = _SPECIFICKEYS +DESCRIPTOR.message_types_by_name['SearchKey'] = _SEARCHKEY +DESCRIPTOR.message_types_by_name['SecurityLevelMap'] = _SECURITYLEVELMAP +DESCRIPTOR.message_types_by_name['GetIdentityKeysRequest'] = _GETIDENTITYKEYSREQUEST +DESCRIPTOR.message_types_by_name['GetIdentityKeysResponse'] = _GETIDENTITYKEYSRESPONSE +DESCRIPTOR.message_types_by_name['GetIdentitiesKeysRequest'] = _GETIDENTITIESKEYSREQUEST +DESCRIPTOR.message_types_by_name['GetIdentitiesKeysResponse'] = _GETIDENTITIESKEYSRESPONSE DESCRIPTOR.message_types_by_name['GetDataContractRequest'] = _GETDATACONTRACTREQUEST DESCRIPTOR.message_types_by_name['GetDataContractResponse'] = _GETDATACONTRACTRESPONSE +DESCRIPTOR.message_types_by_name['GetDataContractsRequest'] = _GETDATACONTRACTSREQUEST +DESCRIPTOR.message_types_by_name['GetDataContractsResponse'] = _GETDATACONTRACTSRESPONSE DESCRIPTOR.message_types_by_name['GetDocumentsRequest'] = _GETDOCUMENTSREQUEST DESCRIPTOR.message_types_by_name['GetDocumentsResponse'] = _GETDOCUMENTSRESPONSE DESCRIPTOR.message_types_by_name['GetIdentitiesByPublicKeyHashesRequest'] = _GETIDENTITIESBYPUBLICKEYHASHESREQUEST DESCRIPTOR.message_types_by_name['GetIdentitiesByPublicKeyHashesResponse'] = _GETIDENTITIESBYPUBLICKEYHASHESRESPONSE +DESCRIPTOR.message_types_by_name['GetIdentityByPublicKeyHashesRequest'] = _GETIDENTITYBYPUBLICKEYHASHESREQUEST +DESCRIPTOR.message_types_by_name['GetIdentityByPublicKeyHashesResponse'] = _GETIDENTITYBYPUBLICKEYHASHESRESPONSE DESCRIPTOR.message_types_by_name['WaitForStateTransitionResultRequest'] = _WAITFORSTATETRANSITIONRESULTREQUEST DESCRIPTOR.message_types_by_name['WaitForStateTransitionResultResponse'] = _WAITFORSTATETRANSITIONRESULTRESPONSE DESCRIPTOR.message_types_by_name['ConsensusParamsBlock'] = _CONSENSUSPARAMSBLOCK @@ -977,6 +2173,147 @@ }) _sym_db.RegisterMessage(GetIdentityResponse) +GetIdentityBalanceResponse = _reflection.GeneratedProtocolMessageType('GetIdentityBalanceResponse', (_message.Message,), { + 'DESCRIPTOR' : _GETIDENTITYBALANCERESPONSE, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetIdentityBalanceResponse) + }) +_sym_db.RegisterMessage(GetIdentityBalanceResponse) + +GetIdentityBalanceAndRevisionResponse = _reflection.GeneratedProtocolMessageType('GetIdentityBalanceAndRevisionResponse', (_message.Message,), { + 'DESCRIPTOR' : _GETIDENTITYBALANCEANDREVISIONRESPONSE, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse) + }) +_sym_db.RegisterMessage(GetIdentityBalanceAndRevisionResponse) + +KeyRequestType = _reflection.GeneratedProtocolMessageType('KeyRequestType', (_message.Message,), { + 'DESCRIPTOR' : _KEYREQUESTTYPE, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.KeyRequestType) + }) +_sym_db.RegisterMessage(KeyRequestType) + +AllKeys = _reflection.GeneratedProtocolMessageType('AllKeys', (_message.Message,), { + 'DESCRIPTOR' : _ALLKEYS, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.AllKeys) + }) +_sym_db.RegisterMessage(AllKeys) + +SpecificKeys = _reflection.GeneratedProtocolMessageType('SpecificKeys', (_message.Message,), { + 'DESCRIPTOR' : _SPECIFICKEYS, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.SpecificKeys) + }) +_sym_db.RegisterMessage(SpecificKeys) + +SearchKey = _reflection.GeneratedProtocolMessageType('SearchKey', (_message.Message,), { + + 'PurposeMapEntry' : _reflection.GeneratedProtocolMessageType('PurposeMapEntry', (_message.Message,), { + 'DESCRIPTOR' : _SEARCHKEY_PURPOSEMAPENTRY, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.SearchKey.PurposeMapEntry) + }) + , + 'DESCRIPTOR' : _SEARCHKEY, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.SearchKey) + }) +_sym_db.RegisterMessage(SearchKey) +_sym_db.RegisterMessage(SearchKey.PurposeMapEntry) + +SecurityLevelMap = _reflection.GeneratedProtocolMessageType('SecurityLevelMap', (_message.Message,), { + + 'SecurityLevelMapEntry' : _reflection.GeneratedProtocolMessageType('SecurityLevelMapEntry', (_message.Message,), { + 'DESCRIPTOR' : _SECURITYLEVELMAP_SECURITYLEVELMAPENTRY, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.SecurityLevelMap.SecurityLevelMapEntry) + }) + , + 'DESCRIPTOR' : _SECURITYLEVELMAP, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.SecurityLevelMap) + }) +_sym_db.RegisterMessage(SecurityLevelMap) +_sym_db.RegisterMessage(SecurityLevelMap.SecurityLevelMapEntry) + +GetIdentityKeysRequest = _reflection.GeneratedProtocolMessageType('GetIdentityKeysRequest', (_message.Message,), { + 'DESCRIPTOR' : _GETIDENTITYKEYSREQUEST, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetIdentityKeysRequest) + }) +_sym_db.RegisterMessage(GetIdentityKeysRequest) + +GetIdentityKeysResponse = _reflection.GeneratedProtocolMessageType('GetIdentityKeysResponse', (_message.Message,), { + + 'Keys' : _reflection.GeneratedProtocolMessageType('Keys', (_message.Message,), { + 'DESCRIPTOR' : _GETIDENTITYKEYSRESPONSE_KEYS, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys) + }) + , + 'DESCRIPTOR' : _GETIDENTITYKEYSRESPONSE, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetIdentityKeysResponse) + }) +_sym_db.RegisterMessage(GetIdentityKeysResponse) +_sym_db.RegisterMessage(GetIdentityKeysResponse.Keys) + +GetIdentitiesKeysRequest = _reflection.GeneratedProtocolMessageType('GetIdentitiesKeysRequest', (_message.Message,), { + + 'SecurityLevelMap' : _reflection.GeneratedProtocolMessageType('SecurityLevelMap', (_message.Message,), { + + 'SecurityLevelMapEntry' : _reflection.GeneratedProtocolMessageType('SecurityLevelMapEntry', (_message.Message,), { + 'DESCRIPTOR' : _GETIDENTITIESKEYSREQUEST_SECURITYLEVELMAP_SECURITYLEVELMAPENTRY, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap.SecurityLevelMapEntry) + }) + , + 'DESCRIPTOR' : _GETIDENTITIESKEYSREQUEST_SECURITYLEVELMAP, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap) + }) + , + 'DESCRIPTOR' : _GETIDENTITIESKEYSREQUEST, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetIdentitiesKeysRequest) + }) +_sym_db.RegisterMessage(GetIdentitiesKeysRequest) +_sym_db.RegisterMessage(GetIdentitiesKeysRequest.SecurityLevelMap) +_sym_db.RegisterMessage(GetIdentitiesKeysRequest.SecurityLevelMap.SecurityLevelMapEntry) + +GetIdentitiesKeysResponse = _reflection.GeneratedProtocolMessageType('GetIdentitiesKeysResponse', (_message.Message,), { + + 'PublicKey' : _reflection.GeneratedProtocolMessageType('PublicKey', (_message.Message,), { + 'DESCRIPTOR' : _GETIDENTITIESKEYSRESPONSE_PUBLICKEY, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey) + }) + , + + 'PublicKeyEntry' : _reflection.GeneratedProtocolMessageType('PublicKeyEntry', (_message.Message,), { + 'DESCRIPTOR' : _GETIDENTITIESKEYSRESPONSE_PUBLICKEYENTRY, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry) + }) + , + + 'PublicKeyEntries' : _reflection.GeneratedProtocolMessageType('PublicKeyEntries', (_message.Message,), { + 'DESCRIPTOR' : _GETIDENTITIESKEYSRESPONSE_PUBLICKEYENTRIES, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries) + }) + , + 'DESCRIPTOR' : _GETIDENTITIESKEYSRESPONSE, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetIdentitiesKeysResponse) + }) +_sym_db.RegisterMessage(GetIdentitiesKeysResponse) +_sym_db.RegisterMessage(GetIdentitiesKeysResponse.PublicKey) +_sym_db.RegisterMessage(GetIdentitiesKeysResponse.PublicKeyEntry) +_sym_db.RegisterMessage(GetIdentitiesKeysResponse.PublicKeyEntries) + GetDataContractRequest = _reflection.GeneratedProtocolMessageType('GetDataContractRequest', (_message.Message,), { 'DESCRIPTOR' : _GETDATACONTRACTREQUEST, '__module__' : 'platform_pb2' @@ -991,6 +2328,44 @@ }) _sym_db.RegisterMessage(GetDataContractResponse) +GetDataContractsRequest = _reflection.GeneratedProtocolMessageType('GetDataContractsRequest', (_message.Message,), { + 'DESCRIPTOR' : _GETDATACONTRACTSREQUEST, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetDataContractsRequest) + }) +_sym_db.RegisterMessage(GetDataContractsRequest) + +GetDataContractsResponse = _reflection.GeneratedProtocolMessageType('GetDataContractsResponse', (_message.Message,), { + + 'DataContractValue' : _reflection.GeneratedProtocolMessageType('DataContractValue', (_message.Message,), { + 'DESCRIPTOR' : _GETDATACONTRACTSRESPONSE_DATACONTRACTVALUE, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue) + }) + , + + 'DataContractEntry' : _reflection.GeneratedProtocolMessageType('DataContractEntry', (_message.Message,), { + 'DESCRIPTOR' : _GETDATACONTRACTSRESPONSE_DATACONTRACTENTRY, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry) + }) + , + + 'DataContracts' : _reflection.GeneratedProtocolMessageType('DataContracts', (_message.Message,), { + 'DESCRIPTOR' : _GETDATACONTRACTSRESPONSE_DATACONTRACTS, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts) + }) + , + 'DESCRIPTOR' : _GETDATACONTRACTSRESPONSE, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetDataContractsResponse) + }) +_sym_db.RegisterMessage(GetDataContractsResponse) +_sym_db.RegisterMessage(GetDataContractsResponse.DataContractValue) +_sym_db.RegisterMessage(GetDataContractsResponse.DataContractEntry) +_sym_db.RegisterMessage(GetDataContractsResponse.DataContracts) + GetDocumentsRequest = _reflection.GeneratedProtocolMessageType('GetDocumentsRequest', (_message.Message,), { 'DESCRIPTOR' : _GETDOCUMENTSREQUEST, '__module__' : 'platform_pb2' @@ -1019,6 +2394,20 @@ }) _sym_db.RegisterMessage(GetIdentitiesByPublicKeyHashesResponse) +GetIdentityByPublicKeyHashesRequest = _reflection.GeneratedProtocolMessageType('GetIdentityByPublicKeyHashesRequest', (_message.Message,), { + 'DESCRIPTOR' : _GETIDENTITYBYPUBLICKEYHASHESREQUEST, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest) + }) +_sym_db.RegisterMessage(GetIdentityByPublicKeyHashesRequest) + +GetIdentityByPublicKeyHashesResponse = _reflection.GeneratedProtocolMessageType('GetIdentityByPublicKeyHashesResponse', (_message.Message,), { + 'DESCRIPTOR' : _GETIDENTITYBYPUBLICKEYHASHESRESPONSE, + '__module__' : 'platform_pb2' + # @@protoc_insertion_point(class_scope:org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse) + }) +_sym_db.RegisterMessage(GetIdentityByPublicKeyHashesResponse) + WaitForStateTransitionResultRequest = _reflection.GeneratedProtocolMessageType('WaitForStateTransitionResultRequest', (_message.Message,), { 'DESCRIPTOR' : _WAITFORSTATETRANSITIONRESULTREQUEST, '__module__' : 'platform_pb2' @@ -1062,6 +2451,9 @@ _sym_db.RegisterMessage(GetConsensusParamsResponse) +_SEARCHKEY_PURPOSEMAPENTRY._options = None +_SECURITYLEVELMAP_SECURITYLEVELMAPENTRY._options = None +_GETIDENTITIESKEYSREQUEST_SECURITYLEVELMAP_SECURITYLEVELMAPENTRY._options = None _PLATFORM = _descriptor.ServiceDescriptor( name='Platform', @@ -1070,8 +2462,8 @@ index=0, serialized_options=None, create_key=_descriptor._internal_create_key, - serialized_start=2209, - serialized_end=3176, + serialized_start=5854, + serialized_end=7501, methods=[ _descriptor.MethodDescriptor( name='broadcastStateTransition', @@ -1093,20 +2485,60 @@ serialized_options=None, create_key=_descriptor._internal_create_key, ), + _descriptor.MethodDescriptor( + name='getIdentityKeys', + full_name='org.dash.platform.dapi.v0.Platform.getIdentityKeys', + index=2, + containing_service=None, + input_type=_GETIDENTITYKEYSREQUEST, + output_type=_GETIDENTITYKEYSRESPONSE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='getIdentityBalance', + full_name='org.dash.platform.dapi.v0.Platform.getIdentityBalance', + index=3, + containing_service=None, + input_type=_GETIDENTITYREQUEST, + output_type=_GETIDENTITYBALANCERESPONSE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), + _descriptor.MethodDescriptor( + name='getIdentityBalanceAndRevision', + full_name='org.dash.platform.dapi.v0.Platform.getIdentityBalanceAndRevision', + index=4, + containing_service=None, + input_type=_GETIDENTITYREQUEST, + output_type=_GETIDENTITYBALANCEANDREVISIONRESPONSE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), _descriptor.MethodDescriptor( name='getDataContract', full_name='org.dash.platform.dapi.v0.Platform.getDataContract', - index=2, + index=5, containing_service=None, input_type=_GETDATACONTRACTREQUEST, output_type=_GETDATACONTRACTRESPONSE, serialized_options=None, create_key=_descriptor._internal_create_key, ), + _descriptor.MethodDescriptor( + name='getDataContracts', + full_name='org.dash.platform.dapi.v0.Platform.getDataContracts', + index=6, + containing_service=None, + input_type=_GETDATACONTRACTSREQUEST, + output_type=_GETDATACONTRACTSRESPONSE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), _descriptor.MethodDescriptor( name='getDocuments', full_name='org.dash.platform.dapi.v0.Platform.getDocuments', - index=3, + index=7, containing_service=None, input_type=_GETDOCUMENTSREQUEST, output_type=_GETDOCUMENTSRESPONSE, @@ -1116,17 +2548,27 @@ _descriptor.MethodDescriptor( name='getIdentitiesByPublicKeyHashes', full_name='org.dash.platform.dapi.v0.Platform.getIdentitiesByPublicKeyHashes', - index=4, + index=8, containing_service=None, input_type=_GETIDENTITIESBYPUBLICKEYHASHESREQUEST, output_type=_GETIDENTITIESBYPUBLICKEYHASHESRESPONSE, serialized_options=None, create_key=_descriptor._internal_create_key, ), + _descriptor.MethodDescriptor( + name='getIdentityByPublicKeyHashes', + full_name='org.dash.platform.dapi.v0.Platform.getIdentityByPublicKeyHashes', + index=9, + containing_service=None, + input_type=_GETIDENTITYBYPUBLICKEYHASHESREQUEST, + output_type=_GETIDENTITYBYPUBLICKEYHASHESRESPONSE, + serialized_options=None, + create_key=_descriptor._internal_create_key, + ), _descriptor.MethodDescriptor( name='waitForStateTransitionResult', full_name='org.dash.platform.dapi.v0.Platform.waitForStateTransitionResult', - index=5, + index=10, containing_service=None, input_type=_WAITFORSTATETRANSITIONRESULTREQUEST, output_type=_WAITFORSTATETRANSITIONRESULTRESPONSE, @@ -1136,7 +2578,7 @@ _descriptor.MethodDescriptor( name='getConsensusParams', full_name='org.dash.platform.dapi.v0.Platform.getConsensusParams', - index=6, + index=11, containing_service=None, input_type=_GETCONSENSUSPARAMSREQUEST, output_type=_GETCONSENSUSPARAMSRESPONSE, diff --git a/packages/dapi-grpc/clients/platform/v0/python/platform_pb2_grpc.py b/packages/dapi-grpc/clients/platform/v0/python/platform_pb2_grpc.py index 152a69dc73..0de942ce7d 100644 --- a/packages/dapi-grpc/clients/platform/v0/python/platform_pb2_grpc.py +++ b/packages/dapi-grpc/clients/platform/v0/python/platform_pb2_grpc.py @@ -24,11 +24,31 @@ def __init__(self, channel): request_serializer=platform__pb2.GetIdentityRequest.SerializeToString, response_deserializer=platform__pb2.GetIdentityResponse.FromString, ) + self.getIdentityKeys = channel.unary_unary( + '/org.dash.platform.dapi.v0.Platform/getIdentityKeys', + request_serializer=platform__pb2.GetIdentityKeysRequest.SerializeToString, + response_deserializer=platform__pb2.GetIdentityKeysResponse.FromString, + ) + self.getIdentityBalance = channel.unary_unary( + '/org.dash.platform.dapi.v0.Platform/getIdentityBalance', + request_serializer=platform__pb2.GetIdentityRequest.SerializeToString, + response_deserializer=platform__pb2.GetIdentityBalanceResponse.FromString, + ) + self.getIdentityBalanceAndRevision = channel.unary_unary( + '/org.dash.platform.dapi.v0.Platform/getIdentityBalanceAndRevision', + request_serializer=platform__pb2.GetIdentityRequest.SerializeToString, + response_deserializer=platform__pb2.GetIdentityBalanceAndRevisionResponse.FromString, + ) self.getDataContract = channel.unary_unary( '/org.dash.platform.dapi.v0.Platform/getDataContract', request_serializer=platform__pb2.GetDataContractRequest.SerializeToString, response_deserializer=platform__pb2.GetDataContractResponse.FromString, ) + self.getDataContracts = channel.unary_unary( + '/org.dash.platform.dapi.v0.Platform/getDataContracts', + request_serializer=platform__pb2.GetDataContractsRequest.SerializeToString, + response_deserializer=platform__pb2.GetDataContractsResponse.FromString, + ) self.getDocuments = channel.unary_unary( '/org.dash.platform.dapi.v0.Platform/getDocuments', request_serializer=platform__pb2.GetDocumentsRequest.SerializeToString, @@ -39,6 +59,11 @@ def __init__(self, channel): request_serializer=platform__pb2.GetIdentitiesByPublicKeyHashesRequest.SerializeToString, response_deserializer=platform__pb2.GetIdentitiesByPublicKeyHashesResponse.FromString, ) + self.getIdentityByPublicKeyHashes = channel.unary_unary( + '/org.dash.platform.dapi.v0.Platform/getIdentityByPublicKeyHashes', + request_serializer=platform__pb2.GetIdentityByPublicKeyHashesRequest.SerializeToString, + response_deserializer=platform__pb2.GetIdentityByPublicKeyHashesResponse.FromString, + ) self.waitForStateTransitionResult = channel.unary_unary( '/org.dash.platform.dapi.v0.Platform/waitForStateTransitionResult', request_serializer=platform__pb2.WaitForStateTransitionResultRequest.SerializeToString, @@ -66,12 +91,37 @@ def getIdentity(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def getIdentityKeys(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def getIdentityBalance(self, request, context): + """rpc getIdentitiesKeys (GetIdentitiesKeysRequest) returns (GetIdentitiesKeysResponse); + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def getIdentityBalanceAndRevision(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def getDataContract(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def getDataContracts(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def getDocuments(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) @@ -84,6 +134,12 @@ def getIdentitiesByPublicKeyHashes(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def getIdentityByPublicKeyHashes(self, request, context): + """Missing associated documentation comment in .proto file.""" + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def waitForStateTransitionResult(self, request, context): """Missing associated documentation comment in .proto file.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) @@ -109,11 +165,31 @@ def add_PlatformServicer_to_server(servicer, server): request_deserializer=platform__pb2.GetIdentityRequest.FromString, response_serializer=platform__pb2.GetIdentityResponse.SerializeToString, ), + 'getIdentityKeys': grpc.unary_unary_rpc_method_handler( + servicer.getIdentityKeys, + request_deserializer=platform__pb2.GetIdentityKeysRequest.FromString, + response_serializer=platform__pb2.GetIdentityKeysResponse.SerializeToString, + ), + 'getIdentityBalance': grpc.unary_unary_rpc_method_handler( + servicer.getIdentityBalance, + request_deserializer=platform__pb2.GetIdentityRequest.FromString, + response_serializer=platform__pb2.GetIdentityBalanceResponse.SerializeToString, + ), + 'getIdentityBalanceAndRevision': grpc.unary_unary_rpc_method_handler( + servicer.getIdentityBalanceAndRevision, + request_deserializer=platform__pb2.GetIdentityRequest.FromString, + response_serializer=platform__pb2.GetIdentityBalanceAndRevisionResponse.SerializeToString, + ), 'getDataContract': grpc.unary_unary_rpc_method_handler( servicer.getDataContract, request_deserializer=platform__pb2.GetDataContractRequest.FromString, response_serializer=platform__pb2.GetDataContractResponse.SerializeToString, ), + 'getDataContracts': grpc.unary_unary_rpc_method_handler( + servicer.getDataContracts, + request_deserializer=platform__pb2.GetDataContractsRequest.FromString, + response_serializer=platform__pb2.GetDataContractsResponse.SerializeToString, + ), 'getDocuments': grpc.unary_unary_rpc_method_handler( servicer.getDocuments, request_deserializer=platform__pb2.GetDocumentsRequest.FromString, @@ -124,6 +200,11 @@ def add_PlatformServicer_to_server(servicer, server): request_deserializer=platform__pb2.GetIdentitiesByPublicKeyHashesRequest.FromString, response_serializer=platform__pb2.GetIdentitiesByPublicKeyHashesResponse.SerializeToString, ), + 'getIdentityByPublicKeyHashes': grpc.unary_unary_rpc_method_handler( + servicer.getIdentityByPublicKeyHashes, + request_deserializer=platform__pb2.GetIdentityByPublicKeyHashesRequest.FromString, + response_serializer=platform__pb2.GetIdentityByPublicKeyHashesResponse.SerializeToString, + ), 'waitForStateTransitionResult': grpc.unary_unary_rpc_method_handler( servicer.waitForStateTransitionResult, request_deserializer=platform__pb2.WaitForStateTransitionResultRequest.FromString, @@ -178,6 +259,57 @@ def getIdentity(request, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + @staticmethod + def getIdentityKeys(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/org.dash.platform.dapi.v0.Platform/getIdentityKeys', + platform__pb2.GetIdentityKeysRequest.SerializeToString, + platform__pb2.GetIdentityKeysResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def getIdentityBalance(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/org.dash.platform.dapi.v0.Platform/getIdentityBalance', + platform__pb2.GetIdentityRequest.SerializeToString, + platform__pb2.GetIdentityBalanceResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def getIdentityBalanceAndRevision(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/org.dash.platform.dapi.v0.Platform/getIdentityBalanceAndRevision', + platform__pb2.GetIdentityRequest.SerializeToString, + platform__pb2.GetIdentityBalanceAndRevisionResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + @staticmethod def getDataContract(request, target, @@ -195,6 +327,23 @@ def getDataContract(request, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + @staticmethod + def getDataContracts(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/org.dash.platform.dapi.v0.Platform/getDataContracts', + platform__pb2.GetDataContractsRequest.SerializeToString, + platform__pb2.GetDataContractsResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + @staticmethod def getDocuments(request, target, @@ -229,6 +378,23 @@ def getIdentitiesByPublicKeyHashes(request, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + @staticmethod + def getIdentityByPublicKeyHashes(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/org.dash.platform.dapi.v0.Platform/getIdentityByPublicKeyHashes', + platform__pb2.GetIdentityByPublicKeyHashesRequest.SerializeToString, + platform__pb2.GetIdentityByPublicKeyHashesResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + @staticmethod def waitForStateTransitionResult(request, target, diff --git a/packages/dapi-grpc/clients/platform/v0/web/platform_pb.d.ts b/packages/dapi-grpc/clients/platform/v0/web/platform_pb.d.ts index 697534c8b7..183a2a0f0d 100644 --- a/packages/dapi-grpc/clients/platform/v0/web/platform_pb.d.ts +++ b/packages/dapi-grpc/clients/platform/v0/web/platform_pb.d.ts @@ -2,13 +2,15 @@ // file: platform.proto import * as jspb from "google-protobuf"; +import * as google_protobuf_wrappers_pb from "google-protobuf/google/protobuf/wrappers_pb"; +import * as google_protobuf_struct_pb from "google-protobuf/google/protobuf/struct_pb"; import * as google_protobuf_timestamp_pb from "google-protobuf/google/protobuf/timestamp_pb"; export class Proof extends jspb.Message { - getMerkleProof(): Uint8Array | string; - getMerkleProof_asU8(): Uint8Array; - getMerkleProof_asB64(): string; - setMerkleProof(value: Uint8Array | string): void; + getGrovedbProof(): Uint8Array | string; + getGrovedbProof_asU8(): Uint8Array; + getGrovedbProof_asB64(): string; + setGrovedbProof(value: Uint8Array | string): void; getQuorumHash(): Uint8Array | string; getQuorumHash_asU8(): Uint8Array; @@ -35,7 +37,7 @@ export class Proof extends jspb.Message { export namespace Proof { export type AsObject = { - merkleProof: Uint8Array | string, + grovedbProof: Uint8Array | string, quorumHash: Uint8Array | string, signature: Uint8Array | string, round: number, @@ -202,6 +204,498 @@ export namespace GetIdentityResponse { } } +export class GetIdentityBalanceResponse extends jspb.Message { + hasBalance(): boolean; + clearBalance(): void; + getBalance(): google_protobuf_wrappers_pb.UInt64Value | undefined; + setBalance(value?: google_protobuf_wrappers_pb.UInt64Value): void; + + hasProof(): boolean; + clearProof(): void; + getProof(): Proof | undefined; + setProof(value?: Proof): void; + + hasMetadata(): boolean; + clearMetadata(): void; + getMetadata(): ResponseMetadata | undefined; + setMetadata(value?: ResponseMetadata): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetIdentityBalanceResponse.AsObject; + static toObject(includeInstance: boolean, msg: GetIdentityBalanceResponse): GetIdentityBalanceResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GetIdentityBalanceResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetIdentityBalanceResponse; + static deserializeBinaryFromReader(message: GetIdentityBalanceResponse, reader: jspb.BinaryReader): GetIdentityBalanceResponse; +} + +export namespace GetIdentityBalanceResponse { + export type AsObject = { + balance?: google_protobuf_wrappers_pb.UInt64Value.AsObject, + proof?: Proof.AsObject, + metadata?: ResponseMetadata.AsObject, + } +} + +export class GetIdentityBalanceAndRevisionResponse extends jspb.Message { + hasBalance(): boolean; + clearBalance(): void; + getBalance(): google_protobuf_wrappers_pb.UInt64Value | undefined; + setBalance(value?: google_protobuf_wrappers_pb.UInt64Value): void; + + hasRevision(): boolean; + clearRevision(): void; + getRevision(): google_protobuf_wrappers_pb.UInt64Value | undefined; + setRevision(value?: google_protobuf_wrappers_pb.UInt64Value): void; + + hasProof(): boolean; + clearProof(): void; + getProof(): Proof | undefined; + setProof(value?: Proof): void; + + hasMetadata(): boolean; + clearMetadata(): void; + getMetadata(): ResponseMetadata | undefined; + setMetadata(value?: ResponseMetadata): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetIdentityBalanceAndRevisionResponse.AsObject; + static toObject(includeInstance: boolean, msg: GetIdentityBalanceAndRevisionResponse): GetIdentityBalanceAndRevisionResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GetIdentityBalanceAndRevisionResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetIdentityBalanceAndRevisionResponse; + static deserializeBinaryFromReader(message: GetIdentityBalanceAndRevisionResponse, reader: jspb.BinaryReader): GetIdentityBalanceAndRevisionResponse; +} + +export namespace GetIdentityBalanceAndRevisionResponse { + export type AsObject = { + balance?: google_protobuf_wrappers_pb.UInt64Value.AsObject, + revision?: google_protobuf_wrappers_pb.UInt64Value.AsObject, + proof?: Proof.AsObject, + metadata?: ResponseMetadata.AsObject, + } +} + +export class KeyRequestType extends jspb.Message { + hasAllKeys(): boolean; + clearAllKeys(): void; + getAllKeys(): AllKeys | undefined; + setAllKeys(value?: AllKeys): void; + + hasSpecificKeys(): boolean; + clearSpecificKeys(): void; + getSpecificKeys(): SpecificKeys | undefined; + setSpecificKeys(value?: SpecificKeys): void; + + hasSearchKey(): boolean; + clearSearchKey(): void; + getSearchKey(): SearchKey | undefined; + setSearchKey(value?: SearchKey): void; + + getRequestCase(): KeyRequestType.RequestCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): KeyRequestType.AsObject; + static toObject(includeInstance: boolean, msg: KeyRequestType): KeyRequestType.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: KeyRequestType, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): KeyRequestType; + static deserializeBinaryFromReader(message: KeyRequestType, reader: jspb.BinaryReader): KeyRequestType; +} + +export namespace KeyRequestType { + export type AsObject = { + allKeys?: AllKeys.AsObject, + specificKeys?: SpecificKeys.AsObject, + searchKey?: SearchKey.AsObject, + } + + export enum RequestCase { + REQUEST_NOT_SET = 0, + ALL_KEYS = 1, + SPECIFIC_KEYS = 2, + SEARCH_KEY = 3, + } +} + +export class AllKeys extends jspb.Message { + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): AllKeys.AsObject; + static toObject(includeInstance: boolean, msg: AllKeys): AllKeys.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: AllKeys, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): AllKeys; + static deserializeBinaryFromReader(message: AllKeys, reader: jspb.BinaryReader): AllKeys; +} + +export namespace AllKeys { + export type AsObject = { + } +} + +export class SpecificKeys extends jspb.Message { + clearKeyIdsList(): void; + getKeyIdsList(): Array; + setKeyIdsList(value: Array): void; + addKeyIds(value: number, index?: number): number; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SpecificKeys.AsObject; + static toObject(includeInstance: boolean, msg: SpecificKeys): SpecificKeys.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SpecificKeys, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SpecificKeys; + static deserializeBinaryFromReader(message: SpecificKeys, reader: jspb.BinaryReader): SpecificKeys; +} + +export namespace SpecificKeys { + export type AsObject = { + keyIdsList: Array, + } +} + +export class SearchKey extends jspb.Message { + getPurposeMapMap(): jspb.Map; + clearPurposeMapMap(): void; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SearchKey.AsObject; + static toObject(includeInstance: boolean, msg: SearchKey): SearchKey.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SearchKey, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SearchKey; + static deserializeBinaryFromReader(message: SearchKey, reader: jspb.BinaryReader): SearchKey; +} + +export namespace SearchKey { + export type AsObject = { + purposeMapMap: Array<[number, SecurityLevelMap.AsObject]>, + } +} + +export class SecurityLevelMap extends jspb.Message { + getSecurityLevelMapMap(): jspb.Map; + clearSecurityLevelMapMap(): void; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SecurityLevelMap.AsObject; + static toObject(includeInstance: boolean, msg: SecurityLevelMap): SecurityLevelMap.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SecurityLevelMap, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SecurityLevelMap; + static deserializeBinaryFromReader(message: SecurityLevelMap, reader: jspb.BinaryReader): SecurityLevelMap; +} + +export namespace SecurityLevelMap { + export type AsObject = { + securityLevelMapMap: Array<[number, SecurityLevelMap.KeyKindRequestTypeMap[keyof SecurityLevelMap.KeyKindRequestTypeMap]]>, + } + + export interface KeyKindRequestTypeMap { + CURRENT_KEY_OF_KIND_REQUEST: 0; + ALL_KEYS_OF_KIND_REQUEST: 1; + } + + export const KeyKindRequestType: KeyKindRequestTypeMap; +} + +export class GetIdentityKeysRequest extends jspb.Message { + getIdentityId(): Uint8Array | string; + getIdentityId_asU8(): Uint8Array; + getIdentityId_asB64(): string; + setIdentityId(value: Uint8Array | string): void; + + hasRequestType(): boolean; + clearRequestType(): void; + getRequestType(): KeyRequestType | undefined; + setRequestType(value?: KeyRequestType): void; + + hasLimit(): boolean; + clearLimit(): void; + getLimit(): google_protobuf_wrappers_pb.UInt32Value | undefined; + setLimit(value?: google_protobuf_wrappers_pb.UInt32Value): void; + + hasOffset(): boolean; + clearOffset(): void; + getOffset(): google_protobuf_wrappers_pb.UInt32Value | undefined; + setOffset(value?: google_protobuf_wrappers_pb.UInt32Value): void; + + getProve(): boolean; + setProve(value: boolean): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetIdentityKeysRequest.AsObject; + static toObject(includeInstance: boolean, msg: GetIdentityKeysRequest): GetIdentityKeysRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GetIdentityKeysRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetIdentityKeysRequest; + static deserializeBinaryFromReader(message: GetIdentityKeysRequest, reader: jspb.BinaryReader): GetIdentityKeysRequest; +} + +export namespace GetIdentityKeysRequest { + export type AsObject = { + identityId: Uint8Array | string, + requestType?: KeyRequestType.AsObject, + limit?: google_protobuf_wrappers_pb.UInt32Value.AsObject, + offset?: google_protobuf_wrappers_pb.UInt32Value.AsObject, + prove: boolean, + } +} + +export class GetIdentityKeysResponse extends jspb.Message { + hasKeys(): boolean; + clearKeys(): void; + getKeys(): GetIdentityKeysResponse.Keys | undefined; + setKeys(value?: GetIdentityKeysResponse.Keys): void; + + hasProof(): boolean; + clearProof(): void; + getProof(): Proof | undefined; + setProof(value?: Proof): void; + + hasMetadata(): boolean; + clearMetadata(): void; + getMetadata(): ResponseMetadata | undefined; + setMetadata(value?: ResponseMetadata): void; + + getResultCase(): GetIdentityKeysResponse.ResultCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetIdentityKeysResponse.AsObject; + static toObject(includeInstance: boolean, msg: GetIdentityKeysResponse): GetIdentityKeysResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GetIdentityKeysResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetIdentityKeysResponse; + static deserializeBinaryFromReader(message: GetIdentityKeysResponse, reader: jspb.BinaryReader): GetIdentityKeysResponse; +} + +export namespace GetIdentityKeysResponse { + export type AsObject = { + keys?: GetIdentityKeysResponse.Keys.AsObject, + proof?: Proof.AsObject, + metadata?: ResponseMetadata.AsObject, + } + + export class Keys extends jspb.Message { + clearKeysBytesList(): void; + getKeysBytesList(): Array; + getKeysBytesList_asU8(): Array; + getKeysBytesList_asB64(): Array; + setKeysBytesList(value: Array): void; + addKeysBytes(value: Uint8Array | string, index?: number): Uint8Array | string; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): Keys.AsObject; + static toObject(includeInstance: boolean, msg: Keys): Keys.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: Keys, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): Keys; + static deserializeBinaryFromReader(message: Keys, reader: jspb.BinaryReader): Keys; + } + + export namespace Keys { + export type AsObject = { + keysBytesList: Array, + } + } + + export enum ResultCase { + RESULT_NOT_SET = 0, + KEYS = 1, + PROOF = 2, + } +} + +export class GetIdentitiesKeysRequest extends jspb.Message { + clearIdentityIdsList(): void; + getIdentityIdsList(): Array; + getIdentityIdsList_asU8(): Array; + getIdentityIdsList_asB64(): Array; + setIdentityIdsList(value: Array): void; + addIdentityIds(value: Uint8Array | string, index?: number): Uint8Array | string; + + hasRequestType(): boolean; + clearRequestType(): void; + getRequestType(): KeyRequestType | undefined; + setRequestType(value?: KeyRequestType): void; + + hasLimit(): boolean; + clearLimit(): void; + getLimit(): google_protobuf_wrappers_pb.UInt32Value | undefined; + setLimit(value?: google_protobuf_wrappers_pb.UInt32Value): void; + + hasOffset(): boolean; + clearOffset(): void; + getOffset(): google_protobuf_wrappers_pb.UInt32Value | undefined; + setOffset(value?: google_protobuf_wrappers_pb.UInt32Value): void; + + getProve(): boolean; + setProve(value: boolean): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetIdentitiesKeysRequest.AsObject; + static toObject(includeInstance: boolean, msg: GetIdentitiesKeysRequest): GetIdentitiesKeysRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GetIdentitiesKeysRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetIdentitiesKeysRequest; + static deserializeBinaryFromReader(message: GetIdentitiesKeysRequest, reader: jspb.BinaryReader): GetIdentitiesKeysRequest; +} + +export namespace GetIdentitiesKeysRequest { + export type AsObject = { + identityIdsList: Array, + requestType?: KeyRequestType.AsObject, + limit?: google_protobuf_wrappers_pb.UInt32Value.AsObject, + offset?: google_protobuf_wrappers_pb.UInt32Value.AsObject, + prove: boolean, + } + + export class SecurityLevelMap extends jspb.Message { + getSecurityLevelMapMap(): jspb.Map; + clearSecurityLevelMapMap(): void; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): SecurityLevelMap.AsObject; + static toObject(includeInstance: boolean, msg: SecurityLevelMap): SecurityLevelMap.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: SecurityLevelMap, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): SecurityLevelMap; + static deserializeBinaryFromReader(message: SecurityLevelMap, reader: jspb.BinaryReader): SecurityLevelMap; + } + + export namespace SecurityLevelMap { + export type AsObject = { + securityLevelMapMap: Array<[number, GetIdentitiesKeysRequest.SecurityLevelMap.KeyKindRequestTypeMap[keyof GetIdentitiesKeysRequest.SecurityLevelMap.KeyKindRequestTypeMap]]>, + } + + export interface KeyKindRequestTypeMap { + CURRENT_KEY_OF_KIND_REQUEST: 0; + } + + export const KeyKindRequestType: KeyKindRequestTypeMap; + } +} + +export class GetIdentitiesKeysResponse extends jspb.Message { + hasPublicKeys(): boolean; + clearPublicKeys(): void; + getPublicKeys(): GetIdentitiesKeysResponse.PublicKeyEntries | undefined; + setPublicKeys(value?: GetIdentitiesKeysResponse.PublicKeyEntries): void; + + hasProof(): boolean; + clearProof(): void; + getProof(): Proof | undefined; + setProof(value?: Proof): void; + + hasMetadata(): boolean; + clearMetadata(): void; + getMetadata(): ResponseMetadata | undefined; + setMetadata(value?: ResponseMetadata): void; + + getResultCase(): GetIdentitiesKeysResponse.ResultCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetIdentitiesKeysResponse.AsObject; + static toObject(includeInstance: boolean, msg: GetIdentitiesKeysResponse): GetIdentitiesKeysResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GetIdentitiesKeysResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetIdentitiesKeysResponse; + static deserializeBinaryFromReader(message: GetIdentitiesKeysResponse, reader: jspb.BinaryReader): GetIdentitiesKeysResponse; +} + +export namespace GetIdentitiesKeysResponse { + export type AsObject = { + publicKeys?: GetIdentitiesKeysResponse.PublicKeyEntries.AsObject, + proof?: Proof.AsObject, + metadata?: ResponseMetadata.AsObject, + } + + export class PublicKey extends jspb.Message { + getValue(): Uint8Array | string; + getValue_asU8(): Uint8Array; + getValue_asB64(): string; + setValue(value: Uint8Array | string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): PublicKey.AsObject; + static toObject(includeInstance: boolean, msg: PublicKey): PublicKey.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: PublicKey, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): PublicKey; + static deserializeBinaryFromReader(message: PublicKey, reader: jspb.BinaryReader): PublicKey; + } + + export namespace PublicKey { + export type AsObject = { + value: Uint8Array | string, + } + } + + export class PublicKeyEntry extends jspb.Message { + getKey(): Uint8Array | string; + getKey_asU8(): Uint8Array; + getKey_asB64(): string; + setKey(value: Uint8Array | string): void; + + hasValue(): boolean; + clearValue(): void; + getValue(): GetIdentitiesKeysResponse.PublicKey | undefined; + setValue(value?: GetIdentitiesKeysResponse.PublicKey): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): PublicKeyEntry.AsObject; + static toObject(includeInstance: boolean, msg: PublicKeyEntry): PublicKeyEntry.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: PublicKeyEntry, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): PublicKeyEntry; + static deserializeBinaryFromReader(message: PublicKeyEntry, reader: jspb.BinaryReader): PublicKeyEntry; + } + + export namespace PublicKeyEntry { + export type AsObject = { + key: Uint8Array | string, + value?: GetIdentitiesKeysResponse.PublicKey.AsObject, + } + } + + export class PublicKeyEntries extends jspb.Message { + clearPublicKeyEntriesList(): void; + getPublicKeyEntriesList(): Array; + setPublicKeyEntriesList(value: Array): void; + addPublicKeyEntries(value?: GetIdentitiesKeysResponse.PublicKeyEntry, index?: number): GetIdentitiesKeysResponse.PublicKeyEntry; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): PublicKeyEntries.AsObject; + static toObject(includeInstance: boolean, msg: PublicKeyEntries): PublicKeyEntries.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: PublicKeyEntries, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): PublicKeyEntries; + static deserializeBinaryFromReader(message: PublicKeyEntries, reader: jspb.BinaryReader): PublicKeyEntries; + } + + export namespace PublicKeyEntries { + export type AsObject = { + publicKeyEntriesList: Array, + } + } + + export enum ResultCase { + RESULT_NOT_SET = 0, + PUBLIC_KEYS = 1, + PROOF = 2, + } +} + export class GetDataContractRequest extends jspb.Message { getId(): Uint8Array | string; getId_asU8(): Uint8Array; @@ -262,6 +756,147 @@ export namespace GetDataContractResponse { } } +export class GetDataContractsRequest extends jspb.Message { + clearIdsList(): void; + getIdsList(): Array; + getIdsList_asU8(): Array; + getIdsList_asB64(): Array; + setIdsList(value: Array): void; + addIds(value: Uint8Array | string, index?: number): Uint8Array | string; + + getProve(): boolean; + setProve(value: boolean): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetDataContractsRequest.AsObject; + static toObject(includeInstance: boolean, msg: GetDataContractsRequest): GetDataContractsRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GetDataContractsRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetDataContractsRequest; + static deserializeBinaryFromReader(message: GetDataContractsRequest, reader: jspb.BinaryReader): GetDataContractsRequest; +} + +export namespace GetDataContractsRequest { + export type AsObject = { + idsList: Array, + prove: boolean, + } +} + +export class GetDataContractsResponse extends jspb.Message { + hasDataContracts(): boolean; + clearDataContracts(): void; + getDataContracts(): GetDataContractsResponse.DataContracts | undefined; + setDataContracts(value?: GetDataContractsResponse.DataContracts): void; + + hasProof(): boolean; + clearProof(): void; + getProof(): Proof | undefined; + setProof(value?: Proof): void; + + hasMetadata(): boolean; + clearMetadata(): void; + getMetadata(): ResponseMetadata | undefined; + setMetadata(value?: ResponseMetadata): void; + + getResultCase(): GetDataContractsResponse.ResultCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetDataContractsResponse.AsObject; + static toObject(includeInstance: boolean, msg: GetDataContractsResponse): GetDataContractsResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GetDataContractsResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetDataContractsResponse; + static deserializeBinaryFromReader(message: GetDataContractsResponse, reader: jspb.BinaryReader): GetDataContractsResponse; +} + +export namespace GetDataContractsResponse { + export type AsObject = { + dataContracts?: GetDataContractsResponse.DataContracts.AsObject, + proof?: Proof.AsObject, + metadata?: ResponseMetadata.AsObject, + } + + export class DataContractValue extends jspb.Message { + getValue(): Uint8Array | string; + getValue_asU8(): Uint8Array; + getValue_asB64(): string; + setValue(value: Uint8Array | string): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): DataContractValue.AsObject; + static toObject(includeInstance: boolean, msg: DataContractValue): DataContractValue.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: DataContractValue, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): DataContractValue; + static deserializeBinaryFromReader(message: DataContractValue, reader: jspb.BinaryReader): DataContractValue; + } + + export namespace DataContractValue { + export type AsObject = { + value: Uint8Array | string, + } + } + + export class DataContractEntry extends jspb.Message { + getKey(): Uint8Array | string; + getKey_asU8(): Uint8Array; + getKey_asB64(): string; + setKey(value: Uint8Array | string): void; + + hasValue(): boolean; + clearValue(): void; + getValue(): GetDataContractsResponse.DataContractValue | undefined; + setValue(value?: GetDataContractsResponse.DataContractValue): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): DataContractEntry.AsObject; + static toObject(includeInstance: boolean, msg: DataContractEntry): DataContractEntry.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: DataContractEntry, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): DataContractEntry; + static deserializeBinaryFromReader(message: DataContractEntry, reader: jspb.BinaryReader): DataContractEntry; + } + + export namespace DataContractEntry { + export type AsObject = { + key: Uint8Array | string, + value?: GetDataContractsResponse.DataContractValue.AsObject, + } + } + + export class DataContracts extends jspb.Message { + clearDataContractEntriesList(): void; + getDataContractEntriesList(): Array; + setDataContractEntriesList(value: Array): void; + addDataContractEntries(value?: GetDataContractsResponse.DataContractEntry, index?: number): GetDataContractsResponse.DataContractEntry; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): DataContracts.AsObject; + static toObject(includeInstance: boolean, msg: DataContracts): DataContracts.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: DataContracts, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): DataContracts; + static deserializeBinaryFromReader(message: DataContracts, reader: jspb.BinaryReader): DataContracts; + } + + export namespace DataContracts { + export type AsObject = { + dataContractEntriesList: Array, + } + } + + export enum ResultCase { + RESULT_NOT_SET = 0, + DATA_CONTRACTS = 1, + PROOF = 2, + } +} + export class GetDocumentsRequest extends jspb.Message { getDataContractId(): Uint8Array | string; getDataContractId_asU8(): Uint8Array; @@ -431,6 +1066,75 @@ export namespace GetIdentitiesByPublicKeyHashesResponse { } } +export class GetIdentityByPublicKeyHashesRequest extends jspb.Message { + getPublicKeyHash(): Uint8Array | string; + getPublicKeyHash_asU8(): Uint8Array; + getPublicKeyHash_asB64(): string; + setPublicKeyHash(value: Uint8Array | string): void; + + getProve(): boolean; + setProve(value: boolean): void; + + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetIdentityByPublicKeyHashesRequest.AsObject; + static toObject(includeInstance: boolean, msg: GetIdentityByPublicKeyHashesRequest): GetIdentityByPublicKeyHashesRequest.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GetIdentityByPublicKeyHashesRequest, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetIdentityByPublicKeyHashesRequest; + static deserializeBinaryFromReader(message: GetIdentityByPublicKeyHashesRequest, reader: jspb.BinaryReader): GetIdentityByPublicKeyHashesRequest; +} + +export namespace GetIdentityByPublicKeyHashesRequest { + export type AsObject = { + publicKeyHash: Uint8Array | string, + prove: boolean, + } +} + +export class GetIdentityByPublicKeyHashesResponse extends jspb.Message { + hasIdentity(): boolean; + clearIdentity(): void; + getIdentity(): Uint8Array | string; + getIdentity_asU8(): Uint8Array; + getIdentity_asB64(): string; + setIdentity(value: Uint8Array | string): void; + + hasProof(): boolean; + clearProof(): void; + getProof(): Proof | undefined; + setProof(value?: Proof): void; + + hasMetadata(): boolean; + clearMetadata(): void; + getMetadata(): ResponseMetadata | undefined; + setMetadata(value?: ResponseMetadata): void; + + getResultCase(): GetIdentityByPublicKeyHashesResponse.ResultCase; + serializeBinary(): Uint8Array; + toObject(includeInstance?: boolean): GetIdentityByPublicKeyHashesResponse.AsObject; + static toObject(includeInstance: boolean, msg: GetIdentityByPublicKeyHashesResponse): GetIdentityByPublicKeyHashesResponse.AsObject; + static extensions: {[key: number]: jspb.ExtensionFieldInfo}; + static extensionsBinary: {[key: number]: jspb.ExtensionFieldBinaryInfo}; + static serializeBinaryToWriter(message: GetIdentityByPublicKeyHashesResponse, writer: jspb.BinaryWriter): void; + static deserializeBinary(bytes: Uint8Array): GetIdentityByPublicKeyHashesResponse; + static deserializeBinaryFromReader(message: GetIdentityByPublicKeyHashesResponse, reader: jspb.BinaryReader): GetIdentityByPublicKeyHashesResponse; +} + +export namespace GetIdentityByPublicKeyHashesResponse { + export type AsObject = { + identity: Uint8Array | string, + proof?: Proof.AsObject, + metadata?: ResponseMetadata.AsObject, + } + + export enum ResultCase { + RESULT_NOT_SET = 0, + IDENTITY = 1, + PROOF = 2, + } +} + export class WaitForStateTransitionResultRequest extends jspb.Message { getStateTransitionHash(): Uint8Array | string; getStateTransitionHash_asU8(): Uint8Array; diff --git a/packages/dapi-grpc/clients/platform/v0/web/platform_pb.js b/packages/dapi-grpc/clients/platform/v0/web/platform_pb.js index 72718d320c..3684443165 100644 --- a/packages/dapi-grpc/clients/platform/v0/web/platform_pb.js +++ b/packages/dapi-grpc/clients/platform/v0/web/platform_pb.js @@ -15,8 +15,13 @@ var jspb = require('google-protobuf'); var goog = jspb; const proto = {}; +var google_protobuf_wrappers_pb = require('google-protobuf/google/protobuf/wrappers_pb.js'); +goog.object.extend(proto, google_protobuf_wrappers_pb); +var google_protobuf_struct_pb = require('google-protobuf/google/protobuf/struct_pb.js'); +goog.object.extend(proto, google_protobuf_struct_pb); var google_protobuf_timestamp_pb = require('google-protobuf/google/protobuf/timestamp_pb.js'); goog.object.extend(proto, google_protobuf_timestamp_pb); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.AllKeys', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.ConsensusParamsBlock', null, { proto }); @@ -25,15 +30,44 @@ goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetConsensusParamsRequest', n goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetConsensusParamsResponse', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractRequest', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractResponse', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractsRequest', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractsResponse', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDataContractsResponse.ResultCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsRequest', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsRequest.StartCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetDocumentsResponse', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap.KeyKindRequestType', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.ResultCase', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.ResultCase', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.ResultCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityRequest', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.GetIdentityResponse', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.KeyRequestType', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.KeyRequestType.RequestCase', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.Proof', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.ResponseMetadata', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.SearchKey', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.SecurityLevelMap', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.SecurityLevelMap.KeyKindRequestType', null, { proto }); +goog.exportSymbol('proto.org.dash.platform.dapi.v0.SpecificKeys', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest', null, { proto }); goog.exportSymbol('proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse', null, { proto }); @@ -195,16 +229,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetDataContractRequest = function(opt_data) { +proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetDataContractRequest, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetDataContractRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetDataContractRequest'; + proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse'; } /** * Generated by JsPbCodeGenerator. @@ -216,16 +250,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetDataContractResponse = function(opt_data) { +proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetDataContractResponse, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetDataContractResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetDataContractResponse'; + proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse'; } /** * Generated by JsPbCodeGenerator. @@ -237,16 +271,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.oneofGroups_); +proto.org.dash.platform.dapi.v0.KeyRequestType = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.KeyRequestType.oneofGroups_); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsRequest, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.KeyRequestType, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetDocumentsRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsRequest'; + proto.org.dash.platform.dapi.v0.KeyRequestType.displayName = 'proto.org.dash.platform.dapi.v0.KeyRequestType'; } /** * Generated by JsPbCodeGenerator. @@ -258,16 +292,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.repeatedFields_, null); +proto.org.dash.platform.dapi.v0.AllKeys = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsResponse, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.AllKeys, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetDocumentsResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsResponse'; + proto.org.dash.platform.dapi.v0.AllKeys.displayName = 'proto.org.dash.platform.dapi.v0.AllKeys'; } /** * Generated by JsPbCodeGenerator. @@ -279,16 +313,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.repeatedFields_, null); +proto.org.dash.platform.dapi.v0.SpecificKeys = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.SpecificKeys.repeatedFields_, null); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.SpecificKeys, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest'; + proto.org.dash.platform.dapi.v0.SpecificKeys.displayName = 'proto.org.dash.platform.dapi.v0.SpecificKeys'; } /** * Generated by JsPbCodeGenerator. @@ -300,16 +334,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.repeatedFields_, null); +proto.org.dash.platform.dapi.v0.SearchKey = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.SearchKey, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse'; + proto.org.dash.platform.dapi.v0.SearchKey.displayName = 'proto.org.dash.platform.dapi.v0.SearchKey'; } /** * Generated by JsPbCodeGenerator. @@ -321,16 +355,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest = function(opt_data) { +proto.org.dash.platform.dapi.v0.SecurityLevelMap = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.SecurityLevelMap, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.displayName = 'proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest'; + proto.org.dash.platform.dapi.v0.SecurityLevelMap.displayName = 'proto.org.dash.platform.dapi.v0.SecurityLevelMap'; } /** * Generated by JsPbCodeGenerator. @@ -342,16 +376,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.oneofGroups_); +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.displayName = 'proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse'; + proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest'; } /** * Generated by JsPbCodeGenerator. @@ -363,16 +397,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.ConsensusParamsBlock = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.oneofGroups_); }; -goog.inherits(proto.org.dash.platform.dapi.v0.ConsensusParamsBlock, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.ConsensusParamsBlock.displayName = 'proto.org.dash.platform.dapi.v0.ConsensusParamsBlock'; + proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse'; } /** * Generated by JsPbCodeGenerator. @@ -384,16 +418,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.ConsensusParamsEvidence = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.repeatedFields_, null); }; -goog.inherits(proto.org.dash.platform.dapi.v0.ConsensusParamsEvidence, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.ConsensusParamsEvidence.displayName = 'proto.org.dash.platform.dapi.v0.ConsensusParamsEvidence'; + proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.displayName = 'proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys'; } /** * Generated by JsPbCodeGenerator. @@ -405,16 +439,16 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetConsensusParamsRequest = function(opt_data) { - jspb.Message.initialize(this, opt_data, 0, -1, null, null); +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.repeatedFields_, null); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetConsensusParamsRequest, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetConsensusParamsRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetConsensusParamsRequest'; + proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest'; } /** * Generated by JsPbCodeGenerator. @@ -426,306 +460,5569 @@ if (goog.DEBUG && !COMPILED) { * @extends {jspb.Message} * @constructor */ -proto.org.dash.platform.dapi.v0.GetConsensusParamsResponse = function(opt_data) { +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap = function(opt_data) { jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; -goog.inherits(proto.org.dash.platform.dapi.v0.GetConsensusParamsResponse, jspb.Message); +goog.inherits(proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap, jspb.Message); if (goog.DEBUG && !COMPILED) { /** * @public * @override */ - proto.org.dash.platform.dapi.v0.GetConsensusParamsResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetConsensusParamsResponse'; + proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap.displayName = 'proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap'; } - - - -if (jspb.Message.GENERATE_TO_OBJECT) { /** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor */ -proto.org.dash.platform.dapi.v0.Proof.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.Proof.toObject(opt_includeInstance, this); +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.oneofGroups_); }; - - +goog.inherits(proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse'; +} /** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.Proof} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor */ -proto.org.dash.platform.dapi.v0.Proof.toObject = function(includeInstance, msg) { - var f, obj = { - merkleProof: msg.getMerkleProof_asB64(), - quorumHash: msg.getQuorumHash_asB64(), - signature: msg.getSignature_asB64(), - round: jspb.Message.getFieldWithDefault(msg, 4, 0) - }; - - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; +goog.inherits(proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey.displayName = 'proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey'; } - - /** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.Proof} + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor */ -proto.org.dash.platform.dapi.v0.Proof.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.Proof; - return proto.org.dash.platform.dapi.v0.Proof.deserializeBinaryFromReader(msg, reader); +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; - - +goog.inherits(proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.displayName = 'proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry'; +} /** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.Proof} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.Proof} + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor */ -proto.org.dash.platform.dapi.v0.Proof.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setMerkleProof(value); - break; - case 2: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setQuorumHash(value); - break; - case 3: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setSignature(value); - break; - case 4: - var value = /** @type {number} */ (reader.readUint32()); - msg.setRound(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.repeatedFields_, null); }; - - +goog.inherits(proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.displayName = 'proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries'; +} /** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor */ -proto.org.dash.platform.dapi.v0.Proof.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.Proof.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); +proto.org.dash.platform.dapi.v0.GetDataContractRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; - - +goog.inherits(proto.org.dash.platform.dapi.v0.GetDataContractRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetDataContractRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetDataContractRequest'; +} /** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.Proof} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor */ -proto.org.dash.platform.dapi.v0.Proof.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getMerkleProof_asU8(); - if (f.length > 0) { - writer.writeBytes( - 1, - f - ); - } - f = message.getQuorumHash_asU8(); - if (f.length > 0) { - writer.writeBytes( - 2, - f - ); - } - f = message.getSignature_asU8(); - if (f.length > 0) { - writer.writeBytes( - 3, - f - ); - } - f = message.getRound(); - if (f !== 0) { - writer.writeUint32( - 4, - f - ); - } +proto.org.dash.platform.dapi.v0.GetDataContractResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); }; +goog.inherits(proto.org.dash.platform.dapi.v0.GetDataContractResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetDataContractResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetDataContractResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetDataContractsRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetDataContractsRequest.repeatedFields_, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetDataContractsRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetDataContractsRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetDataContractsRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetDataContractsResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetDataContractsResponse.oneofGroups_); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetDataContractsResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetDataContractsResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetDataContractsResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue.displayName = 'proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.displayName = 'proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.repeatedFields_, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.displayName = 'proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.oneofGroups_); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetDocumentsRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetDocumentsResponse.repeatedFields_, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetDocumentsResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetDocumentsResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.repeatedFields_, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.repeatedFields_, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.oneofGroups_); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest.displayName = 'proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.oneofGroups_); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse.displayName = 'proto.org.dash.platform.dapi.v0.WaitForStateTransitionResultResponse'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.ConsensusParamsBlock = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.ConsensusParamsBlock, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.ConsensusParamsBlock.displayName = 'proto.org.dash.platform.dapi.v0.ConsensusParamsBlock'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.ConsensusParamsEvidence = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.ConsensusParamsEvidence, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.ConsensusParamsEvidence.displayName = 'proto.org.dash.platform.dapi.v0.ConsensusParamsEvidence'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetConsensusParamsRequest = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetConsensusParamsRequest, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetConsensusParamsRequest.displayName = 'proto.org.dash.platform.dapi.v0.GetConsensusParamsRequest'; +} +/** + * Generated by JsPbCodeGenerator. + * @param {Array=} opt_data Optional initial data array, typically from a + * server response, or constructed directly in Javascript. The array is used + * in place and becomes part of the constructed object. It is not cloned. + * If no data is provided, the constructed object will be empty, but still + * valid. + * @extends {jspb.Message} + * @constructor + */ +proto.org.dash.platform.dapi.v0.GetConsensusParamsResponse = function(opt_data) { + jspb.Message.initialize(this, opt_data, 0, -1, null, null); +}; +goog.inherits(proto.org.dash.platform.dapi.v0.GetConsensusParamsResponse, jspb.Message); +if (goog.DEBUG && !COMPILED) { + /** + * @public + * @override + */ + proto.org.dash.platform.dapi.v0.GetConsensusParamsResponse.displayName = 'proto.org.dash.platform.dapi.v0.GetConsensusParamsResponse'; +} + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.Proof.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.Proof.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.Proof} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.Proof.toObject = function(includeInstance, msg) { + var f, obj = { + grovedbProof: msg.getGrovedbProof_asB64(), + quorumHash: msg.getQuorumHash_asB64(), + signature: msg.getSignature_asB64(), + round: jspb.Message.getFieldWithDefault(msg, 4, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.Proof} + */ +proto.org.dash.platform.dapi.v0.Proof.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.Proof; + return proto.org.dash.platform.dapi.v0.Proof.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.Proof} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.Proof} + */ +proto.org.dash.platform.dapi.v0.Proof.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setGrovedbProof(value); + break; + case 2: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setQuorumHash(value); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setSignature(value); + break; + case 4: + var value = /** @type {number} */ (reader.readUint32()); + msg.setRound(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.Proof.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.Proof.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.Proof} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.Proof.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getGrovedbProof_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getQuorumHash_asU8(); + if (f.length > 0) { + writer.writeBytes( + 2, + f + ); + } + f = message.getSignature_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } + f = message.getRound(); + if (f !== 0) { + writer.writeUint32( + 4, + f + ); + } +}; + + +/** + * optional bytes grovedb_proof = 1; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.Proof.prototype.getGrovedbProof = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes grovedb_proof = 1; + * This is a type-conversion wrapper around `getGrovedbProof()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.Proof.prototype.getGrovedbProof_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getGrovedbProof())); +}; + + +/** + * optional bytes grovedb_proof = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getGrovedbProof()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.Proof.prototype.getGrovedbProof_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getGrovedbProof())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.Proof} returns this + */ +proto.org.dash.platform.dapi.v0.Proof.prototype.setGrovedbProof = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional bytes quorum_hash = 2; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.Proof.prototype.getQuorumHash = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * optional bytes quorum_hash = 2; + * This is a type-conversion wrapper around `getQuorumHash()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.Proof.prototype.getQuorumHash_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getQuorumHash())); +}; + + +/** + * optional bytes quorum_hash = 2; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getQuorumHash()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.Proof.prototype.getQuorumHash_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getQuorumHash())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.Proof} returns this + */ +proto.org.dash.platform.dapi.v0.Proof.prototype.setQuorumHash = function(value) { + return jspb.Message.setProto3BytesField(this, 2, value); +}; + + +/** + * optional bytes signature = 3; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.Proof.prototype.getSignature = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * optional bytes signature = 3; + * This is a type-conversion wrapper around `getSignature()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.Proof.prototype.getSignature_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getSignature())); +}; + + +/** + * optional bytes signature = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getSignature()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.Proof.prototype.getSignature_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getSignature())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.Proof} returns this + */ +proto.org.dash.platform.dapi.v0.Proof.prototype.setSignature = function(value) { + return jspb.Message.setProto3BytesField(this, 3, value); +}; + + +/** + * optional uint32 round = 4; + * @return {number} + */ +proto.org.dash.platform.dapi.v0.Proof.prototype.getRound = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.org.dash.platform.dapi.v0.Proof} returns this + */ +proto.org.dash.platform.dapi.v0.Proof.prototype.setRound = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.ResponseMetadata.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.ResponseMetadata} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.ResponseMetadata.toObject = function(includeInstance, msg) { + var f, obj = { + height: jspb.Message.getFieldWithDefault(msg, 1, 0), + coreChainLockedHeight: jspb.Message.getFieldWithDefault(msg, 2, 0), + timeMs: jspb.Message.getFieldWithDefault(msg, 3, 0), + protocolVersion: jspb.Message.getFieldWithDefault(msg, 4, 0) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.ResponseMetadata} + */ +proto.org.dash.platform.dapi.v0.ResponseMetadata.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.ResponseMetadata; + return proto.org.dash.platform.dapi.v0.ResponseMetadata.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.ResponseMetadata} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.ResponseMetadata} + */ +proto.org.dash.platform.dapi.v0.ResponseMetadata.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readUint64()); + msg.setHeight(value); + break; + case 2: + var value = /** @type {number} */ (reader.readUint32()); + msg.setCoreChainLockedHeight(value); + break; + case 3: + var value = /** @type {number} */ (reader.readUint64()); + msg.setTimeMs(value); + break; + case 4: + var value = /** @type {number} */ (reader.readUint32()); + msg.setProtocolVersion(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.ResponseMetadata.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.ResponseMetadata} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.ResponseMetadata.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getHeight(); + if (f !== 0) { + writer.writeUint64( + 1, + f + ); + } + f = message.getCoreChainLockedHeight(); + if (f !== 0) { + writer.writeUint32( + 2, + f + ); + } + f = message.getTimeMs(); + if (f !== 0) { + writer.writeUint64( + 3, + f + ); + } + f = message.getProtocolVersion(); + if (f !== 0) { + writer.writeUint32( + 4, + f + ); + } +}; + + +/** + * optional uint64 height = 1; + * @return {number} + */ +proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.getHeight = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.org.dash.platform.dapi.v0.ResponseMetadata} returns this + */ +proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.setHeight = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional uint32 core_chain_locked_height = 2; + * @return {number} + */ +proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.getCoreChainLockedHeight = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.org.dash.platform.dapi.v0.ResponseMetadata} returns this + */ +proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.setCoreChainLockedHeight = function(value) { + return jspb.Message.setProto3IntField(this, 2, value); +}; + + +/** + * optional uint64 time_ms = 3; + * @return {number} + */ +proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.getTimeMs = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.org.dash.platform.dapi.v0.ResponseMetadata} returns this + */ +proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.setTimeMs = function(value) { + return jspb.Message.setProto3IntField(this, 3, value); +}; + + +/** + * optional uint32 protocol_version = 4; + * @return {number} + */ +proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.getProtocolVersion = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.org.dash.platform.dapi.v0.ResponseMetadata} returns this + */ +proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.setProtocolVersion = function(value) { + return jspb.Message.setProto3IntField(this, 4, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.toObject = function(includeInstance, msg) { + var f, obj = { + code: jspb.Message.getFieldWithDefault(msg, 1, 0), + message: jspb.Message.getFieldWithDefault(msg, 2, ""), + data: msg.getData_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError} + */ +proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError; + return proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError} + */ +proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {number} */ (reader.readUint32()); + msg.setCode(value); + break; + case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setMessage(value); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setData(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getCode(); + if (f !== 0) { + writer.writeUint32( + 1, + f + ); + } + f = message.getMessage(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getData_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } +}; + + +/** + * optional uint32 code = 1; + * @return {number} + */ +proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.prototype.getCode = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +}; + + +/** + * @param {number} value + * @return {!proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError} returns this + */ +proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.prototype.setCode = function(value) { + return jspb.Message.setProto3IntField(this, 1, value); +}; + + +/** + * optional string message = 2; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.prototype.getMessage = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +}; + + +/** + * @param {string} value + * @return {!proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError} returns this + */ +proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.prototype.setMessage = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); +}; + + +/** + * optional bytes data = 3; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.prototype.getData = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + + +/** + * optional bytes data = 3; + * This is a type-conversion wrapper around `getData()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.prototype.getData_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getData())); +}; + + +/** + * optional bytes data = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getData()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.prototype.getData_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getData())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError} returns this + */ +proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.prototype.setData = function(value) { + return jspb.Message.setProto3BytesField(this, 3, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.toObject = function(includeInstance, msg) { + var f, obj = { + stateTransition: msg.getStateTransition_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} + */ +proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest; + return proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} + */ +proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setStateTransition(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getStateTransition_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } +}; + + +/** + * optional bytes state_transition = 1; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.prototype.getStateTransition = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes state_transition = 1; + * This is a type-conversion wrapper around `getStateTransition()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.prototype.getStateTransition_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getStateTransition())); +}; + + +/** + * optional bytes state_transition = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getStateTransition()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.prototype.getStateTransition_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getStateTransition())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} returns this + */ +proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.prototype.setStateTransition = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} + */ +proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse; + return proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} + */ +proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetIdentityRequest.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetIdentityRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentityRequest.toObject = function(includeInstance, msg) { + var f, obj = { + id: msg.getId_asB64(), + prove: jspb.Message.getBooleanFieldWithDefault(msg, 2, false) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityRequest} + */ +proto.org.dash.platform.dapi.v0.GetIdentityRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetIdentityRequest; + return proto.org.dash.platform.dapi.v0.GetIdentityRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityRequest} + */ +proto.org.dash.platform.dapi.v0.GetIdentityRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setId(value); + break; + case 2: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setProve(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetIdentityRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetIdentityRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentityRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getProve(); + if (f) { + writer.writeBool( + 2, + f + ); + } +}; + + +/** + * optional bytes id = 1; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetIdentityRequest.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes id = 1; + * This is a type-conversion wrapper around `getId()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetIdentityRequest.prototype.getId_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getId())); +}; + + +/** + * optional bytes id = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getId()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetIdentityRequest.prototype.getId_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getId())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityRequest} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentityRequest.prototype.setId = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional bool prove = 2; + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentityRequest.prototype.getProve = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityRequest} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentityRequest.prototype.setProve = function(value) { + return jspb.Message.setProto3BooleanField(this, 2, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetIdentityResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentityResponse.toObject = function(includeInstance, msg) { + var f, obj = { + identity: msg.getIdentity_asB64(), + proof: (f = msg.getProof()) && proto.org.dash.platform.dapi.v0.Proof.toObject(includeInstance, f), + metadata: (f = msg.getMetadata()) && proto.org.dash.platform.dapi.v0.ResponseMetadata.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityResponse} + */ +proto.org.dash.platform.dapi.v0.GetIdentityResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetIdentityResponse; + return proto.org.dash.platform.dapi.v0.GetIdentityResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityResponse} + */ +proto.org.dash.platform.dapi.v0.GetIdentityResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setIdentity(value); + break; + case 2: + var value = new proto.org.dash.platform.dapi.v0.Proof; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.Proof.deserializeBinaryFromReader); + msg.setProof(value); + break; + case 3: + var value = new proto.org.dash.platform.dapi.v0.ResponseMetadata; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.ResponseMetadata.deserializeBinaryFromReader); + msg.setMetadata(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetIdentityResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentityResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getIdentity_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getProof(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.org.dash.platform.dapi.v0.Proof.serializeBinaryToWriter + ); + } + f = message.getMetadata(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.org.dash.platform.dapi.v0.ResponseMetadata.serializeBinaryToWriter + ); + } +}; + + +/** + * optional bytes identity = 1; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.getIdentity = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes identity = 1; + * This is a type-conversion wrapper around `getIdentity()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.getIdentity_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getIdentity())); +}; + + +/** + * optional bytes identity = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getIdentity()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.getIdentity_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getIdentity())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityResponse} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.setIdentity = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional Proof proof = 2; + * @return {?proto.org.dash.platform.dapi.v0.Proof} + */ +proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.getProof = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.Proof} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.Proof, 2)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.Proof|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.setProof = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityResponse} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.clearProof = function() { + return this.setProof(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.hasProof = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional ResponseMetadata metadata = 3; + * @return {?proto.org.dash.platform.dapi.v0.ResponseMetadata} + */ +proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.getMetadata = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.ResponseMetadata, 3)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.ResponseMetadata|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.setMetadata = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityResponse} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.clearMetadata = function() { + return this.setMetadata(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.hasMetadata = function() { + return jspb.Message.getField(this, 3) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.toObject = function(includeInstance, msg) { + var f, obj = { + balance: (f = msg.getBalance()) && google_protobuf_wrappers_pb.UInt64Value.toObject(includeInstance, f), + proof: (f = msg.getProof()) && proto.org.dash.platform.dapi.v0.Proof.toObject(includeInstance, f), + metadata: (f = msg.getMetadata()) && proto.org.dash.platform.dapi.v0.ResponseMetadata.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse} + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse; + return proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse} + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new google_protobuf_wrappers_pb.UInt64Value; + reader.readMessage(value,google_protobuf_wrappers_pb.UInt64Value.deserializeBinaryFromReader); + msg.setBalance(value); + break; + case 2: + var value = new proto.org.dash.platform.dapi.v0.Proof; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.Proof.deserializeBinaryFromReader); + msg.setProof(value); + break; + case 3: + var value = new proto.org.dash.platform.dapi.v0.ResponseMetadata; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.ResponseMetadata.deserializeBinaryFromReader); + msg.setMetadata(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getBalance(); + if (f != null) { + writer.writeMessage( + 1, + f, + google_protobuf_wrappers_pb.UInt64Value.serializeBinaryToWriter + ); + } + f = message.getProof(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.org.dash.platform.dapi.v0.Proof.serializeBinaryToWriter + ); + } + f = message.getMetadata(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.org.dash.platform.dapi.v0.ResponseMetadata.serializeBinaryToWriter + ); + } +}; + + +/** + * optional google.protobuf.UInt64Value balance = 1; + * @return {?proto.google.protobuf.UInt64Value} + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.prototype.getBalance = function() { + return /** @type{?proto.google.protobuf.UInt64Value} */ ( + jspb.Message.getWrapperField(this, google_protobuf_wrappers_pb.UInt64Value, 1)); +}; + + +/** + * @param {?proto.google.protobuf.UInt64Value|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.prototype.setBalance = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.prototype.clearBalance = function() { + return this.setBalance(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.prototype.hasBalance = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional Proof proof = 2; + * @return {?proto.org.dash.platform.dapi.v0.Proof} + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.prototype.getProof = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.Proof} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.Proof, 2)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.Proof|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.prototype.setProof = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.prototype.clearProof = function() { + return this.setProof(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.prototype.hasProof = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional ResponseMetadata metadata = 3; + * @return {?proto.org.dash.platform.dapi.v0.ResponseMetadata} + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.prototype.getMetadata = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.ResponseMetadata, 3)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.ResponseMetadata|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.prototype.setMetadata = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.prototype.clearMetadata = function() { + return this.setMetadata(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceResponse.prototype.hasMetadata = function() { + return jspb.Message.getField(this, 3) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.toObject = function(includeInstance, msg) { + var f, obj = { + balance: (f = msg.getBalance()) && google_protobuf_wrappers_pb.UInt64Value.toObject(includeInstance, f), + revision: (f = msg.getRevision()) && google_protobuf_wrappers_pb.UInt64Value.toObject(includeInstance, f), + proof: (f = msg.getProof()) && proto.org.dash.platform.dapi.v0.Proof.toObject(includeInstance, f), + metadata: (f = msg.getMetadata()) && proto.org.dash.platform.dapi.v0.ResponseMetadata.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse; + return proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new google_protobuf_wrappers_pb.UInt64Value; + reader.readMessage(value,google_protobuf_wrappers_pb.UInt64Value.deserializeBinaryFromReader); + msg.setBalance(value); + break; + case 2: + var value = new google_protobuf_wrappers_pb.UInt64Value; + reader.readMessage(value,google_protobuf_wrappers_pb.UInt64Value.deserializeBinaryFromReader); + msg.setRevision(value); + break; + case 3: + var value = new proto.org.dash.platform.dapi.v0.Proof; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.Proof.deserializeBinaryFromReader); + msg.setProof(value); + break; + case 4: + var value = new proto.org.dash.platform.dapi.v0.ResponseMetadata; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.ResponseMetadata.deserializeBinaryFromReader); + msg.setMetadata(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getBalance(); + if (f != null) { + writer.writeMessage( + 1, + f, + google_protobuf_wrappers_pb.UInt64Value.serializeBinaryToWriter + ); + } + f = message.getRevision(); + if (f != null) { + writer.writeMessage( + 2, + f, + google_protobuf_wrappers_pb.UInt64Value.serializeBinaryToWriter + ); + } + f = message.getProof(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.org.dash.platform.dapi.v0.Proof.serializeBinaryToWriter + ); + } + f = message.getMetadata(); + if (f != null) { + writer.writeMessage( + 4, + f, + proto.org.dash.platform.dapi.v0.ResponseMetadata.serializeBinaryToWriter + ); + } +}; + + +/** + * optional google.protobuf.UInt64Value balance = 1; + * @return {?proto.google.protobuf.UInt64Value} + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.prototype.getBalance = function() { + return /** @type{?proto.google.protobuf.UInt64Value} */ ( + jspb.Message.getWrapperField(this, google_protobuf_wrappers_pb.UInt64Value, 1)); +}; + + +/** + * @param {?proto.google.protobuf.UInt64Value|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.prototype.setBalance = function(value) { + return jspb.Message.setWrapperField(this, 1, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.prototype.clearBalance = function() { + return this.setBalance(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.prototype.hasBalance = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional google.protobuf.UInt64Value revision = 2; + * @return {?proto.google.protobuf.UInt64Value} + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.prototype.getRevision = function() { + return /** @type{?proto.google.protobuf.UInt64Value} */ ( + jspb.Message.getWrapperField(this, google_protobuf_wrappers_pb.UInt64Value, 2)); +}; + + +/** + * @param {?proto.google.protobuf.UInt64Value|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.prototype.setRevision = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.prototype.clearRevision = function() { + return this.setRevision(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.prototype.hasRevision = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional Proof proof = 3; + * @return {?proto.org.dash.platform.dapi.v0.Proof} + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.prototype.getProof = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.Proof} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.Proof, 3)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.Proof|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.prototype.setProof = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.prototype.clearProof = function() { + return this.setProof(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.prototype.hasProof = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional ResponseMetadata metadata = 4; + * @return {?proto.org.dash.platform.dapi.v0.ResponseMetadata} + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.prototype.getMetadata = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.ResponseMetadata, 4)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.ResponseMetadata|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.prototype.setMetadata = function(value) { + return jspb.Message.setWrapperField(this, 4, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.prototype.clearMetadata = function() { + return this.setMetadata(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentityBalanceAndRevisionResponse.prototype.hasMetadata = function() { + return jspb.Message.getField(this, 4) != null; +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.org.dash.platform.dapi.v0.KeyRequestType.oneofGroups_ = [[1,2,3]]; + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.KeyRequestType.RequestCase = { + REQUEST_NOT_SET: 0, + ALL_KEYS: 1, + SPECIFIC_KEYS: 2, + SEARCH_KEY: 3 +}; + +/** + * @return {proto.org.dash.platform.dapi.v0.KeyRequestType.RequestCase} + */ +proto.org.dash.platform.dapi.v0.KeyRequestType.prototype.getRequestCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.KeyRequestType.RequestCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.KeyRequestType.oneofGroups_[0])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.KeyRequestType.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.KeyRequestType.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.KeyRequestType} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.KeyRequestType.toObject = function(includeInstance, msg) { + var f, obj = { + allKeys: (f = msg.getAllKeys()) && proto.org.dash.platform.dapi.v0.AllKeys.toObject(includeInstance, f), + specificKeys: (f = msg.getSpecificKeys()) && proto.org.dash.platform.dapi.v0.SpecificKeys.toObject(includeInstance, f), + searchKey: (f = msg.getSearchKey()) && proto.org.dash.platform.dapi.v0.SearchKey.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.KeyRequestType} + */ +proto.org.dash.platform.dapi.v0.KeyRequestType.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.KeyRequestType; + return proto.org.dash.platform.dapi.v0.KeyRequestType.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.KeyRequestType} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.KeyRequestType} + */ +proto.org.dash.platform.dapi.v0.KeyRequestType.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.org.dash.platform.dapi.v0.AllKeys; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.AllKeys.deserializeBinaryFromReader); + msg.setAllKeys(value); + break; + case 2: + var value = new proto.org.dash.platform.dapi.v0.SpecificKeys; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.SpecificKeys.deserializeBinaryFromReader); + msg.setSpecificKeys(value); + break; + case 3: + var value = new proto.org.dash.platform.dapi.v0.SearchKey; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.SearchKey.deserializeBinaryFromReader); + msg.setSearchKey(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.KeyRequestType.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.KeyRequestType.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.KeyRequestType} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.KeyRequestType.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getAllKeys(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.AllKeys.serializeBinaryToWriter + ); + } + f = message.getSpecificKeys(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.org.dash.platform.dapi.v0.SpecificKeys.serializeBinaryToWriter + ); + } + f = message.getSearchKey(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.org.dash.platform.dapi.v0.SearchKey.serializeBinaryToWriter + ); + } +}; + + +/** + * optional AllKeys all_keys = 1; + * @return {?proto.org.dash.platform.dapi.v0.AllKeys} + */ +proto.org.dash.platform.dapi.v0.KeyRequestType.prototype.getAllKeys = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.AllKeys} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.AllKeys, 1)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.AllKeys|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.KeyRequestType} returns this +*/ +proto.org.dash.platform.dapi.v0.KeyRequestType.prototype.setAllKeys = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.KeyRequestType.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.KeyRequestType} returns this + */ +proto.org.dash.platform.dapi.v0.KeyRequestType.prototype.clearAllKeys = function() { + return this.setAllKeys(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.KeyRequestType.prototype.hasAllKeys = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional SpecificKeys specific_keys = 2; + * @return {?proto.org.dash.platform.dapi.v0.SpecificKeys} + */ +proto.org.dash.platform.dapi.v0.KeyRequestType.prototype.getSpecificKeys = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.SpecificKeys} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.SpecificKeys, 2)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.SpecificKeys|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.KeyRequestType} returns this +*/ +proto.org.dash.platform.dapi.v0.KeyRequestType.prototype.setSpecificKeys = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.org.dash.platform.dapi.v0.KeyRequestType.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.KeyRequestType} returns this + */ +proto.org.dash.platform.dapi.v0.KeyRequestType.prototype.clearSpecificKeys = function() { + return this.setSpecificKeys(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.KeyRequestType.prototype.hasSpecificKeys = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional SearchKey search_key = 3; + * @return {?proto.org.dash.platform.dapi.v0.SearchKey} + */ +proto.org.dash.platform.dapi.v0.KeyRequestType.prototype.getSearchKey = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.SearchKey} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.SearchKey, 3)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.SearchKey|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.KeyRequestType} returns this +*/ +proto.org.dash.platform.dapi.v0.KeyRequestType.prototype.setSearchKey = function(value) { + return jspb.Message.setOneofWrapperField(this, 3, proto.org.dash.platform.dapi.v0.KeyRequestType.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.KeyRequestType} returns this + */ +proto.org.dash.platform.dapi.v0.KeyRequestType.prototype.clearSearchKey = function() { + return this.setSearchKey(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.KeyRequestType.prototype.hasSearchKey = function() { + return jspb.Message.getField(this, 3) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.AllKeys.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.AllKeys.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.AllKeys} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.AllKeys.toObject = function(includeInstance, msg) { + var f, obj = { + + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.AllKeys} + */ +proto.org.dash.platform.dapi.v0.AllKeys.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.AllKeys; + return proto.org.dash.platform.dapi.v0.AllKeys.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.AllKeys} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.AllKeys} + */ +proto.org.dash.platform.dapi.v0.AllKeys.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.AllKeys.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.AllKeys.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.AllKeys} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.AllKeys.serializeBinaryToWriter = function(message, writer) { + var f = undefined; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.org.dash.platform.dapi.v0.SpecificKeys.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.SpecificKeys.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.SpecificKeys.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.SpecificKeys} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SpecificKeys.toObject = function(includeInstance, msg) { + var f, obj = { + keyIdsList: (f = jspb.Message.getRepeatedField(msg, 1)) == null ? undefined : f + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.SpecificKeys} + */ +proto.org.dash.platform.dapi.v0.SpecificKeys.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.SpecificKeys; + return proto.org.dash.platform.dapi.v0.SpecificKeys.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.SpecificKeys} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.SpecificKeys} + */ +proto.org.dash.platform.dapi.v0.SpecificKeys.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var values = /** @type {!Array} */ (reader.isDelimited() ? reader.readPackedUint32() : [reader.readUint32()]); + for (var i = 0; i < values.length; i++) { + msg.addKeyIds(values[i]); + } + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.SpecificKeys.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.SpecificKeys.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.SpecificKeys} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SpecificKeys.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getKeyIdsList(); + if (f.length > 0) { + writer.writePackedUint32( + 1, + f + ); + } +}; + + +/** + * repeated uint32 key_ids = 1; + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.SpecificKeys.prototype.getKeyIdsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.org.dash.platform.dapi.v0.SpecificKeys} returns this + */ +proto.org.dash.platform.dapi.v0.SpecificKeys.prototype.setKeyIdsList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {number} value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.SpecificKeys} returns this + */ +proto.org.dash.platform.dapi.v0.SpecificKeys.prototype.addKeyIds = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.SpecificKeys} returns this + */ +proto.org.dash.platform.dapi.v0.SpecificKeys.prototype.clearKeyIdsList = function() { + return this.setKeyIdsList([]); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.SearchKey.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.SearchKey.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.SearchKey} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SearchKey.toObject = function(includeInstance, msg) { + var f, obj = { + purposeMapMap: (f = msg.getPurposeMapMap()) ? f.toObject(includeInstance, proto.org.dash.platform.dapi.v0.SecurityLevelMap.toObject) : [] + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.SearchKey} + */ +proto.org.dash.platform.dapi.v0.SearchKey.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.SearchKey; + return proto.org.dash.platform.dapi.v0.SearchKey.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.SearchKey} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.SearchKey} + */ +proto.org.dash.platform.dapi.v0.SearchKey.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = msg.getPurposeMapMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readUint32, jspb.BinaryReader.prototype.readMessage, proto.org.dash.platform.dapi.v0.SecurityLevelMap.deserializeBinaryFromReader, 0, new proto.org.dash.platform.dapi.v0.SecurityLevelMap()); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.SearchKey.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.SearchKey.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.SearchKey} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SearchKey.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getPurposeMapMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(1, writer, jspb.BinaryWriter.prototype.writeUint32, jspb.BinaryWriter.prototype.writeMessage, proto.org.dash.platform.dapi.v0.SecurityLevelMap.serializeBinaryToWriter); + } +}; + + +/** + * map purpose_map = 1; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.org.dash.platform.dapi.v0.SearchKey.prototype.getPurposeMapMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 1, opt_noLazyCreate, + proto.org.dash.platform.dapi.v0.SecurityLevelMap)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.org.dash.platform.dapi.v0.SearchKey} returns this + */ +proto.org.dash.platform.dapi.v0.SearchKey.prototype.clearPurposeMapMap = function() { + this.getPurposeMapMap().clear(); + return this;}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.SecurityLevelMap.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.SecurityLevelMap.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.SecurityLevelMap} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SecurityLevelMap.toObject = function(includeInstance, msg) { + var f, obj = { + securityLevelMapMap: (f = msg.getSecurityLevelMapMap()) ? f.toObject(includeInstance, undefined) : [] + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.SecurityLevelMap} + */ +proto.org.dash.platform.dapi.v0.SecurityLevelMap.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.SecurityLevelMap; + return proto.org.dash.platform.dapi.v0.SecurityLevelMap.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.SecurityLevelMap} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.SecurityLevelMap} + */ +proto.org.dash.platform.dapi.v0.SecurityLevelMap.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = msg.getSecurityLevelMapMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readUint32, jspb.BinaryReader.prototype.readEnum, null, 0, 0); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.SecurityLevelMap.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.SecurityLevelMap.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.SecurityLevelMap} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.SecurityLevelMap.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSecurityLevelMapMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(1, writer, jspb.BinaryWriter.prototype.writeUint32, jspb.BinaryWriter.prototype.writeEnum); + } +}; + + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.SecurityLevelMap.KeyKindRequestType = { + CURRENT_KEY_OF_KIND_REQUEST: 0, + ALL_KEYS_OF_KIND_REQUEST: 1 +}; + +/** + * map security_level_map = 1; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.org.dash.platform.dapi.v0.SecurityLevelMap.prototype.getSecurityLevelMapMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 1, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.org.dash.platform.dapi.v0.SecurityLevelMap} returns this + */ +proto.org.dash.platform.dapi.v0.SecurityLevelMap.prototype.clearSecurityLevelMapMap = function() { + this.getSecurityLevelMapMap().clear(); + return this;}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.toObject = function(includeInstance, msg) { + var f, obj = { + identityId: msg.getIdentityId_asB64(), + requestType: (f = msg.getRequestType()) && proto.org.dash.platform.dapi.v0.KeyRequestType.toObject(includeInstance, f), + limit: (f = msg.getLimit()) && google_protobuf_wrappers_pb.UInt32Value.toObject(includeInstance, f), + offset: (f = msg.getOffset()) && google_protobuf_wrappers_pb.UInt32Value.toObject(includeInstance, f), + prove: jspb.Message.getBooleanFieldWithDefault(msg, 5, false) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest; + return proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setIdentityId(value); + break; + case 2: + var value = new proto.org.dash.platform.dapi.v0.KeyRequestType; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.KeyRequestType.deserializeBinaryFromReader); + msg.setRequestType(value); + break; + case 3: + var value = new google_protobuf_wrappers_pb.UInt32Value; + reader.readMessage(value,google_protobuf_wrappers_pb.UInt32Value.deserializeBinaryFromReader); + msg.setLimit(value); + break; + case 4: + var value = new google_protobuf_wrappers_pb.UInt32Value; + reader.readMessage(value,google_protobuf_wrappers_pb.UInt32Value.deserializeBinaryFromReader); + msg.setOffset(value); + break; + case 5: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setProve(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getIdentityId_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getRequestType(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.org.dash.platform.dapi.v0.KeyRequestType.serializeBinaryToWriter + ); + } + f = message.getLimit(); + if (f != null) { + writer.writeMessage( + 3, + f, + google_protobuf_wrappers_pb.UInt32Value.serializeBinaryToWriter + ); + } + f = message.getOffset(); + if (f != null) { + writer.writeMessage( + 4, + f, + google_protobuf_wrappers_pb.UInt32Value.serializeBinaryToWriter + ); + } + f = message.getProve(); + if (f) { + writer.writeBool( + 5, + f + ); + } +}; + + +/** + * optional bytes identity_id = 1; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.prototype.getIdentityId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes identity_id = 1; + * This is a type-conversion wrapper around `getIdentityId()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.prototype.getIdentityId_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getIdentityId())); +}; + + +/** + * optional bytes identity_id = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getIdentityId()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.prototype.getIdentityId_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getIdentityId())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.prototype.setIdentityId = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional KeyRequestType request_type = 2; + * @return {?proto.org.dash.platform.dapi.v0.KeyRequestType} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.prototype.getRequestType = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.KeyRequestType} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.KeyRequestType, 2)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.KeyRequestType|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest} returns this +*/ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.prototype.setRequestType = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.prototype.clearRequestType = function() { + return this.setRequestType(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.prototype.hasRequestType = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional google.protobuf.UInt32Value limit = 3; + * @return {?proto.google.protobuf.UInt32Value} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.prototype.getLimit = function() { + return /** @type{?proto.google.protobuf.UInt32Value} */ ( + jspb.Message.getWrapperField(this, google_protobuf_wrappers_pb.UInt32Value, 3)); +}; + + +/** + * @param {?proto.google.protobuf.UInt32Value|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest} returns this +*/ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.prototype.setLimit = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.prototype.clearLimit = function() { + return this.setLimit(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.prototype.hasLimit = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional google.protobuf.UInt32Value offset = 4; + * @return {?proto.google.protobuf.UInt32Value} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.prototype.getOffset = function() { + return /** @type{?proto.google.protobuf.UInt32Value} */ ( + jspb.Message.getWrapperField(this, google_protobuf_wrappers_pb.UInt32Value, 4)); +}; + + +/** + * @param {?proto.google.protobuf.UInt32Value|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest} returns this +*/ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.prototype.setOffset = function(value) { + return jspb.Message.setWrapperField(this, 4, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.prototype.clearOffset = function() { + return this.setOffset(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.prototype.hasOffset = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * optional bool prove = 5; + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.prototype.getProve = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 5, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysRequest.prototype.setProve = function(value) { + return jspb.Message.setProto3BooleanField(this, 5, value); +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.oneofGroups_ = [[1,2]]; + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.ResultCase = { + RESULT_NOT_SET: 0, + KEYS: 1, + PROOF: 2 +}; + +/** + * @return {proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.ResultCase} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.prototype.getResultCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.ResultCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.oneofGroups_[0])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.toObject = function(includeInstance, msg) { + var f, obj = { + keys: (f = msg.getKeys()) && proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.toObject(includeInstance, f), + proof: (f = msg.getProof()) && proto.org.dash.platform.dapi.v0.Proof.toObject(includeInstance, f), + metadata: (f = msg.getMetadata()) && proto.org.dash.platform.dapi.v0.ResponseMetadata.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse; + return proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.deserializeBinaryFromReader); + msg.setKeys(value); + break; + case 2: + var value = new proto.org.dash.platform.dapi.v0.Proof; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.Proof.deserializeBinaryFromReader); + msg.setProof(value); + break; + case 3: + var value = new proto.org.dash.platform.dapi.v0.ResponseMetadata; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.ResponseMetadata.deserializeBinaryFromReader); + msg.setMetadata(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getKeys(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.serializeBinaryToWriter + ); + } + f = message.getProof(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.org.dash.platform.dapi.v0.Proof.serializeBinaryToWriter + ); + } + f = message.getMetadata(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.org.dash.platform.dapi.v0.ResponseMetadata.serializeBinaryToWriter + ); + } +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.toObject = function(includeInstance, msg) { + var f, obj = { + keysBytesList: msg.getKeysBytesList_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys; + return proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.addKeysBytes(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getKeysBytesList_asU8(); + if (f.length > 0) { + writer.writeRepeatedBytes( + 1, + f + ); + } +}; + + +/** + * repeated bytes keys_bytes = 1; + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.prototype.getKeysBytesList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * repeated bytes keys_bytes = 1; + * This is a type-conversion wrapper around `getKeysBytesList()` + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.prototype.getKeysBytesList_asB64 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsB64( + this.getKeysBytesList())); +}; + + +/** + * repeated bytes keys_bytes = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getKeysBytesList()` + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.prototype.getKeysBytesList_asU8 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsU8( + this.getKeysBytesList())); +}; + + +/** + * @param {!(Array|Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.prototype.setKeysBytesList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.prototype.addKeysBytes = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys.prototype.clearKeysBytesList = function() { + return this.setKeysBytesList([]); +}; + + +/** + * optional Keys keys = 1; + * @return {?proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.prototype.getKeys = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys, 1)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.Keys|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.prototype.setKeys = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.prototype.clearKeys = function() { + return this.setKeys(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.prototype.hasKeys = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional Proof proof = 2; + * @return {?proto.org.dash.platform.dapi.v0.Proof} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.prototype.getProof = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.Proof} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.Proof, 2)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.Proof|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.prototype.setProof = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.prototype.clearProof = function() { + return this.setProof(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.prototype.hasProof = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional ResponseMetadata metadata = 3; + * @return {?proto.org.dash.platform.dapi.v0.ResponseMetadata} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.prototype.getMetadata = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.ResponseMetadata, 3)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.ResponseMetadata|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.prototype.setMetadata = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.prototype.clearMetadata = function() { + return this.setMetadata(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentityKeysResponse.prototype.hasMetadata = function() { + return jspb.Message.getField(this, 3) != null; +}; + + + +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.toObject = function(includeInstance, msg) { + var f, obj = { + identityIdsList: msg.getIdentityIdsList_asB64(), + requestType: (f = msg.getRequestType()) && proto.org.dash.platform.dapi.v0.KeyRequestType.toObject(includeInstance, f), + limit: (f = msg.getLimit()) && google_protobuf_wrappers_pb.UInt32Value.toObject(includeInstance, f), + offset: (f = msg.getOffset()) && google_protobuf_wrappers_pb.UInt32Value.toObject(includeInstance, f), + prove: jspb.Message.getBooleanFieldWithDefault(msg, 5, false) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest; + return proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.addIdentityIds(value); + break; + case 2: + var value = new proto.org.dash.platform.dapi.v0.KeyRequestType; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.KeyRequestType.deserializeBinaryFromReader); + msg.setRequestType(value); + break; + case 3: + var value = new google_protobuf_wrappers_pb.UInt32Value; + reader.readMessage(value,google_protobuf_wrappers_pb.UInt32Value.deserializeBinaryFromReader); + msg.setLimit(value); + break; + case 4: + var value = new google_protobuf_wrappers_pb.UInt32Value; + reader.readMessage(value,google_protobuf_wrappers_pb.UInt32Value.deserializeBinaryFromReader); + msg.setOffset(value); + break; + case 5: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setProve(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getIdentityIdsList_asU8(); + if (f.length > 0) { + writer.writeRepeatedBytes( + 1, + f + ); + } + f = message.getRequestType(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.org.dash.platform.dapi.v0.KeyRequestType.serializeBinaryToWriter + ); + } + f = message.getLimit(); + if (f != null) { + writer.writeMessage( + 3, + f, + google_protobuf_wrappers_pb.UInt32Value.serializeBinaryToWriter + ); + } + f = message.getOffset(); + if (f != null) { + writer.writeMessage( + 4, + f, + google_protobuf_wrappers_pb.UInt32Value.serializeBinaryToWriter + ); + } + f = message.getProve(); + if (f) { + writer.writeBool( + 5, + f + ); + } +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap.toObject = function(includeInstance, msg) { + var f, obj = { + securityLevelMapMap: (f = msg.getSecurityLevelMapMap()) ? f.toObject(includeInstance, undefined) : [] + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap; + return proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = msg.getSecurityLevelMapMap(); + reader.readMessage(value, function(message, reader) { + jspb.Map.deserializeBinary(message, reader, jspb.BinaryReader.prototype.readUint32, jspb.BinaryReader.prototype.readEnum, null, 0, 0); + }); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getSecurityLevelMapMap(true); + if (f && f.getLength() > 0) { + f.serializeBinary(1, writer, jspb.BinaryWriter.prototype.writeUint32, jspb.BinaryWriter.prototype.writeEnum); + } +}; + + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap.KeyKindRequestType = { + CURRENT_KEY_OF_KIND_REQUEST: 0 +}; + +/** + * map security_level_map = 1; + * @param {boolean=} opt_noLazyCreate Do not create the map if + * empty, instead returning `undefined` + * @return {!jspb.Map} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap.prototype.getSecurityLevelMapMap = function(opt_noLazyCreate) { + return /** @type {!jspb.Map} */ ( + jspb.Message.getMapField(this, 1, opt_noLazyCreate, + null)); +}; + + +/** + * Clears values from the map. The map will be non-null. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.SecurityLevelMap.prototype.clearSecurityLevelMapMap = function() { + this.getSecurityLevelMapMap().clear(); + return this;}; + + +/** + * repeated bytes identity_ids = 1; + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.prototype.getIdentityIdsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +}; + + +/** + * repeated bytes identity_ids = 1; + * This is a type-conversion wrapper around `getIdentityIdsList()` + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.prototype.getIdentityIdsList_asB64 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsB64( + this.getIdentityIdsList())); +}; + + +/** + * repeated bytes identity_ids = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getIdentityIdsList()` + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.prototype.getIdentityIdsList_asU8 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsU8( + this.getIdentityIdsList())); +}; + + +/** + * @param {!(Array|Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.prototype.setIdentityIdsList = function(value) { + return jspb.Message.setField(this, 1, value || []); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.prototype.addIdentityIds = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.prototype.clearIdentityIdsList = function() { + return this.setIdentityIdsList([]); +}; + + +/** + * optional KeyRequestType request_type = 2; + * @return {?proto.org.dash.platform.dapi.v0.KeyRequestType} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.prototype.getRequestType = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.KeyRequestType} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.KeyRequestType, 2)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.KeyRequestType|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest} returns this +*/ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.prototype.setRequestType = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.prototype.clearRequestType = function() { + return this.setRequestType(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.prototype.hasRequestType = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional google.protobuf.UInt32Value limit = 3; + * @return {?proto.google.protobuf.UInt32Value} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.prototype.getLimit = function() { + return /** @type{?proto.google.protobuf.UInt32Value} */ ( + jspb.Message.getWrapperField(this, google_protobuf_wrappers_pb.UInt32Value, 3)); +}; + + +/** + * @param {?proto.google.protobuf.UInt32Value|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest} returns this +*/ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.prototype.setLimit = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.prototype.clearLimit = function() { + return this.setLimit(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.prototype.hasLimit = function() { + return jspb.Message.getField(this, 3) != null; +}; + + +/** + * optional google.protobuf.UInt32Value offset = 4; + * @return {?proto.google.protobuf.UInt32Value} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.prototype.getOffset = function() { + return /** @type{?proto.google.protobuf.UInt32Value} */ ( + jspb.Message.getWrapperField(this, google_protobuf_wrappers_pb.UInt32Value, 4)); +}; + + +/** + * @param {?proto.google.protobuf.UInt32Value|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest} returns this +*/ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.prototype.setOffset = function(value) { + return jspb.Message.setWrapperField(this, 4, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.prototype.clearOffset = function() { + return this.setOffset(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.prototype.hasOffset = function() { + return jspb.Message.getField(this, 4) != null; +}; + + +/** + * optional bool prove = 5; + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.prototype.getProve = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 5, false)); +}; + + +/** + * @param {boolean} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysRequest.prototype.setProve = function(value) { + return jspb.Message.setProto3BooleanField(this, 5, value); +}; + + + +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.oneofGroups_ = [[1,2]]; + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.ResultCase = { + RESULT_NOT_SET: 0, + PUBLIC_KEYS: 1, + PROOF: 2 +}; + +/** + * @return {proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.ResultCase} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.prototype.getResultCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.ResultCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.oneofGroups_[0])); +}; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.toObject = function(includeInstance, msg) { + var f, obj = { + publicKeys: (f = msg.getPublicKeys()) && proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.toObject(includeInstance, f), + proof: (f = msg.getProof()) && proto.org.dash.platform.dapi.v0.Proof.toObject(includeInstance, f), + metadata: (f = msg.getMetadata()) && proto.org.dash.platform.dapi.v0.ResponseMetadata.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse; + return proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.deserializeBinaryFromReader); + msg.setPublicKeys(value); + break; + case 2: + var value = new proto.org.dash.platform.dapi.v0.Proof; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.Proof.deserializeBinaryFromReader); + msg.setProof(value); + break; + case 3: + var value = new proto.org.dash.platform.dapi.v0.ResponseMetadata; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.ResponseMetadata.deserializeBinaryFromReader); + msg.setMetadata(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getPublicKeys(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.serializeBinaryToWriter + ); + } + f = message.getProof(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.org.dash.platform.dapi.v0.Proof.serializeBinaryToWriter + ); + } + f = message.getMetadata(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.org.dash.platform.dapi.v0.ResponseMetadata.serializeBinaryToWriter + ); + } +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey.toObject = function(includeInstance, msg) { + var f, obj = { + value: msg.getValue_asB64() + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey; + return proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setValue(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getValue_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } +}; + + +/** + * optional bytes value = 1; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey.prototype.getValue = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes value = 1; + * This is a type-conversion wrapper around `getValue()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey.prototype.getValue_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getValue())); +}; + + +/** + * optional bytes value = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getValue()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey.prototype.getValue_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getValue())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey.prototype.setValue = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.toObject = function(includeInstance, msg) { + var f, obj = { + key: msg.getKey_asB64(), + value: (f = msg.getValue()) && proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey.toObject(includeInstance, f) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry; + return proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setKey(value); + break; + case 2: + var value = new proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey.deserializeBinaryFromReader); + msg.setValue(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); +}; + + +/** + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getKey_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getValue(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey.serializeBinaryToWriter + ); + } +}; + + +/** + * optional bytes key = 1; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.prototype.getKey = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes key = 1; + * This is a type-conversion wrapper around `getKey()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.prototype.getKey_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getKey())); +}; + + +/** + * optional bytes key = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getKey()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.prototype.getKey_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getKey())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.prototype.setKey = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional PublicKey value = 2; + * @return {?proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.prototype.getValue = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey, 2)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKey|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry} returns this +*/ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.prototype.setValue = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.prototype.clearValue = function() { + return this.setValue(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.prototype.hasValue = function() { + return jspb.Message.getField(this, 2) != null; +}; + /** - * optional bytes merkle_proof = 1; - * @return {string} + * List of repeated fields within this message type. + * @private {!Array} + * @const */ -proto.org.dash.platform.dapi.v0.Proof.prototype.getMerkleProof = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.repeatedFields_ = [1]; + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.toObject(opt_includeInstance, this); }; /** - * optional bytes merkle_proof = 1; - * This is a type-conversion wrapper around `getMerkleProof()` - * @return {string} + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.Proof.prototype.getMerkleProof_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getMerkleProof())); +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.toObject = function(includeInstance, msg) { + var f, obj = { + publicKeyEntriesList: jspb.Message.toObjectList(msg.getPublicKeyEntriesList(), + proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.toObject, includeInstance) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; }; +} /** - * optional bytes merkle_proof = 1; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getMerkleProof()` + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries; + return proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = new proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.deserializeBinaryFromReader); + msg.addPublicKeyEntries(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; +}; + + +/** + * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.Proof.prototype.getMerkleProof_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getMerkleProof())); +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); }; /** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.Proof} returns this + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.Proof.prototype.setMerkleProof = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getPublicKeyEntriesList(); + if (f.length > 0) { + writer.writeRepeatedMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry.serializeBinaryToWriter + ); + } }; /** - * optional bytes quorum_hash = 2; - * @return {string} + * repeated PublicKeyEntry public_key_entries = 1; + * @return {!Array} */ -proto.org.dash.platform.dapi.v0.Proof.prototype.getQuorumHash = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.prototype.getPublicKeyEntriesList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry, 1)); }; /** - * optional bytes quorum_hash = 2; - * This is a type-conversion wrapper around `getQuorumHash()` - * @return {string} + * @param {!Array} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries} returns this +*/ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.prototype.setPublicKeyEntriesList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry=} opt_value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.prototype.addPublicKeyEntries = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntry, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries.prototype.clearPublicKeyEntriesList = function() { + return this.setPublicKeyEntriesList([]); +}; + + +/** + * optional PublicKeyEntries public_keys = 1; + * @return {?proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.prototype.getPublicKeys = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries, 1)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.PublicKeyEntries|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.prototype.setPublicKeys = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.prototype.clearPublicKeys = function() { + return this.setPublicKeys(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.prototype.hasPublicKeys = function() { + return jspb.Message.getField(this, 1) != null; +}; + + +/** + * optional Proof proof = 2; + * @return {?proto.org.dash.platform.dapi.v0.Proof} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.prototype.getProof = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.Proof} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.Proof, 2)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.Proof|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.prototype.setProof = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.oneofGroups_[0], value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.prototype.clearProof = function() { + return this.setProof(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.prototype.hasProof = function() { + return jspb.Message.getField(this, 2) != null; +}; + + +/** + * optional ResponseMetadata metadata = 3; + * @return {?proto.org.dash.platform.dapi.v0.ResponseMetadata} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.prototype.getMetadata = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.ResponseMetadata, 3)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.ResponseMetadata|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.prototype.setMetadata = function(value) { + return jspb.Message.setWrapperField(this, 3, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse} returns this + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.prototype.clearMetadata = function() { + return this.setMetadata(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetIdentitiesKeysResponse.prototype.hasMetadata = function() { + return jspb.Message.getField(this, 3) != null; +}; + + + + + +if (jspb.Message.GENERATE_TO_OBJECT) { +/** + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} + */ +proto.org.dash.platform.dapi.v0.GetDataContractRequest.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetDataContractRequest.toObject(opt_includeInstance, this); +}; + + +/** + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetDataContractRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages + */ +proto.org.dash.platform.dapi.v0.GetDataContractRequest.toObject = function(includeInstance, msg) { + var f, obj = { + id: msg.getId_asB64(), + prove: jspb.Message.getBooleanFieldWithDefault(msg, 2, false) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; +}; +} + + +/** + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractRequest} + */ +proto.org.dash.platform.dapi.v0.GetDataContractRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetDataContractRequest; + return proto.org.dash.platform.dapi.v0.GetDataContractRequest.deserializeBinaryFromReader(msg, reader); +}; + + +/** + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetDataContractRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractRequest} */ -proto.org.dash.platform.dapi.v0.Proof.prototype.getQuorumHash_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getQuorumHash())); +proto.org.dash.platform.dapi.v0.GetDataContractRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setId(value); + break; + case 2: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setProve(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; }; /** - * optional bytes quorum_hash = 2; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getQuorumHash()` + * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.Proof.prototype.getQuorumHash_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getQuorumHash())); +proto.org.dash.platform.dapi.v0.GetDataContractRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetDataContractRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); }; /** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.Proof} returns this + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetDataContractRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.Proof.prototype.setQuorumHash = function(value) { - return jspb.Message.setProto3BytesField(this, 2, value); +proto.org.dash.platform.dapi.v0.GetDataContractRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getId_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } + f = message.getProve(); + if (f) { + writer.writeBool( + 2, + f + ); + } }; /** - * optional bytes signature = 3; + * optional bytes id = 1; * @return {string} */ -proto.org.dash.platform.dapi.v0.Proof.prototype.getSignature = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +proto.org.dash.platform.dapi.v0.GetDataContractRequest.prototype.getId = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** - * optional bytes signature = 3; - * This is a type-conversion wrapper around `getSignature()` + * optional bytes id = 1; + * This is a type-conversion wrapper around `getId()` * @return {string} */ -proto.org.dash.platform.dapi.v0.Proof.prototype.getSignature_asB64 = function() { +proto.org.dash.platform.dapi.v0.GetDataContractRequest.prototype.getId_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getSignature())); + this.getId())); }; /** - * optional bytes signature = 3; + * optional bytes id = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getSignature()` + * This is a type-conversion wrapper around `getId()` * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.Proof.prototype.getSignature_asU8 = function() { +proto.org.dash.platform.dapi.v0.GetDataContractRequest.prototype.getId_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getSignature())); + this.getId())); }; /** * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.Proof} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractRequest} returns this */ -proto.org.dash.platform.dapi.v0.Proof.prototype.setSignature = function(value) { - return jspb.Message.setProto3BytesField(this, 3, value); +proto.org.dash.platform.dapi.v0.GetDataContractRequest.prototype.setId = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); }; /** - * optional uint32 round = 4; - * @return {number} + * optional bool prove = 2; + * @return {boolean} */ -proto.org.dash.platform.dapi.v0.Proof.prototype.getRound = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +proto.org.dash.platform.dapi.v0.GetDataContractRequest.prototype.getProve = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); }; /** - * @param {number} value - * @return {!proto.org.dash.platform.dapi.v0.Proof} returns this + * @param {boolean} value + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractRequest} returns this */ -proto.org.dash.platform.dapi.v0.Proof.prototype.setRound = function(value) { - return jspb.Message.setProto3IntField(this, 4, value); +proto.org.dash.platform.dapi.v0.GetDataContractRequest.prototype.setProve = function(value) { + return jspb.Message.setProto3BooleanField(this, 2, value); }; @@ -745,8 +6042,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.ResponseMetadata.toObject(opt_includeInstance, this); +proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetDataContractResponse.toObject(opt_includeInstance, this); }; @@ -755,16 +6052,15 @@ proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.toObject = function(o * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.ResponseMetadata} msg The msg instance to transform. + * @param {!proto.org.dash.platform.dapi.v0.GetDataContractResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.ResponseMetadata.toObject = function(includeInstance, msg) { +proto.org.dash.platform.dapi.v0.GetDataContractResponse.toObject = function(includeInstance, msg) { var f, obj = { - height: jspb.Message.getFieldWithDefault(msg, 1, 0), - coreChainLockedHeight: jspb.Message.getFieldWithDefault(msg, 2, 0), - timeMs: jspb.Message.getFieldWithDefault(msg, 3, 0), - protocolVersion: jspb.Message.getFieldWithDefault(msg, 4, 0) + dataContract: msg.getDataContract_asB64(), + proof: (f = msg.getProof()) && proto.org.dash.platform.dapi.v0.Proof.toObject(includeInstance, f), + metadata: (f = msg.getMetadata()) && proto.org.dash.platform.dapi.v0.ResponseMetadata.toObject(includeInstance, f) }; if (includeInstance) { @@ -778,23 +6074,23 @@ proto.org.dash.platform.dapi.v0.ResponseMetadata.toObject = function(includeInst /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.ResponseMetadata} + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractResponse} */ -proto.org.dash.platform.dapi.v0.ResponseMetadata.deserializeBinary = function(bytes) { +proto.org.dash.platform.dapi.v0.GetDataContractResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.ResponseMetadata; - return proto.org.dash.platform.dapi.v0.ResponseMetadata.deserializeBinaryFromReader(msg, reader); + var msg = new proto.org.dash.platform.dapi.v0.GetDataContractResponse; + return proto.org.dash.platform.dapi.v0.GetDataContractResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.ResponseMetadata} msg The message object to deserialize into. + * @param {!proto.org.dash.platform.dapi.v0.GetDataContractResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.ResponseMetadata} + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractResponse} */ -proto.org.dash.platform.dapi.v0.ResponseMetadata.deserializeBinaryFromReader = function(msg, reader) { +proto.org.dash.platform.dapi.v0.GetDataContractResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -802,20 +6098,18 @@ proto.org.dash.platform.dapi.v0.ResponseMetadata.deserializeBinaryFromReader = f var field = reader.getFieldNumber(); switch (field) { case 1: - var value = /** @type {number} */ (reader.readInt64()); - msg.setHeight(value); + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setDataContract(value); break; case 2: - var value = /** @type {number} */ (reader.readUint32()); - msg.setCoreChainLockedHeight(value); + var value = new proto.org.dash.platform.dapi.v0.Proof; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.Proof.deserializeBinaryFromReader); + msg.setProof(value); break; case 3: - var value = /** @type {number} */ (reader.readUint64()); - msg.setTimeMs(value); - break; - case 4: - var value = /** @type {number} */ (reader.readUint32()); - msg.setProtocolVersion(value); + var value = new proto.org.dash.platform.dapi.v0.ResponseMetadata; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.ResponseMetadata.deserializeBinaryFromReader); + msg.setMetadata(value); break; default: reader.skipField(); @@ -830,9 +6124,9 @@ proto.org.dash.platform.dapi.v0.ResponseMetadata.deserializeBinaryFromReader = f * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.serializeBinary = function() { +proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.ResponseMetadata.serializeBinaryToWriter(this, writer); + proto.org.dash.platform.dapi.v0.GetDataContractResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -840,116 +6134,162 @@ proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.serializeBinary = fun /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.ResponseMetadata} message + * @param {!proto.org.dash.platform.dapi.v0.GetDataContractResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.ResponseMetadata.serializeBinaryToWriter = function(message, writer) { +proto.org.dash.platform.dapi.v0.GetDataContractResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getHeight(); - if (f !== 0) { - writer.writeInt64( + f = message.getDataContract_asU8(); + if (f.length > 0) { + writer.writeBytes( 1, f ); } - f = message.getCoreChainLockedHeight(); - if (f !== 0) { - writer.writeUint32( + f = message.getProof(); + if (f != null) { + writer.writeMessage( 2, - f + f, + proto.org.dash.platform.dapi.v0.Proof.serializeBinaryToWriter ); } - f = message.getTimeMs(); - if (f !== 0) { - writer.writeUint64( + f = message.getMetadata(); + if (f != null) { + writer.writeMessage( 3, - f - ); - } - f = message.getProtocolVersion(); - if (f !== 0) { - writer.writeUint32( - 4, - f + f, + proto.org.dash.platform.dapi.v0.ResponseMetadata.serializeBinaryToWriter ); } }; /** - * optional int64 height = 1; - * @return {number} + * optional bytes data_contract = 1; + * @return {string} */ -proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.getHeight = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.getDataContract = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** - * @param {number} value - * @return {!proto.org.dash.platform.dapi.v0.ResponseMetadata} returns this + * optional bytes data_contract = 1; + * This is a type-conversion wrapper around `getDataContract()` + * @return {string} */ -proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.setHeight = function(value) { - return jspb.Message.setProto3IntField(this, 1, value); +proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.getDataContract_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getDataContract())); +}; + + +/** + * optional bytes data_contract = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getDataContract()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.getDataContract_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getDataContract())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractResponse} returns this + */ +proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.setDataContract = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); +}; + + +/** + * optional Proof proof = 2; + * @return {?proto.org.dash.platform.dapi.v0.Proof} + */ +proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.getProof = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.Proof} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.Proof, 2)); +}; + + +/** + * @param {?proto.org.dash.platform.dapi.v0.Proof|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.setProof = function(value) { + return jspb.Message.setWrapperField(this, 2, value); }; /** - * optional uint32 core_chain_locked_height = 2; - * @return {number} + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractResponse} returns this */ -proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.getCoreChainLockedHeight = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0)); +proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.clearProof = function() { + return this.setProof(undefined); }; /** - * @param {number} value - * @return {!proto.org.dash.platform.dapi.v0.ResponseMetadata} returns this + * Returns whether this field is set. + * @return {boolean} */ -proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.setCoreChainLockedHeight = function(value) { - return jspb.Message.setProto3IntField(this, 2, value); +proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.hasProof = function() { + return jspb.Message.getField(this, 2) != null; }; /** - * optional uint64 time_ms = 3; - * @return {number} + * optional ResponseMetadata metadata = 3; + * @return {?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ -proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.getTimeMs = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 3, 0)); +proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.getMetadata = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.ResponseMetadata, 3)); }; /** - * @param {number} value - * @return {!proto.org.dash.platform.dapi.v0.ResponseMetadata} returns this - */ -proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.setTimeMs = function(value) { - return jspb.Message.setProto3IntField(this, 3, value); + * @param {?proto.org.dash.platform.dapi.v0.ResponseMetadata|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.setMetadata = function(value) { + return jspb.Message.setWrapperField(this, 3, value); }; /** - * optional uint32 protocol_version = 4; - * @return {number} + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractResponse} returns this */ -proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.getProtocolVersion = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 4, 0)); +proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.clearMetadata = function() { + return this.setMetadata(undefined); }; /** - * @param {number} value - * @return {!proto.org.dash.platform.dapi.v0.ResponseMetadata} returns this + * Returns whether this field is set. + * @return {boolean} */ -proto.org.dash.platform.dapi.v0.ResponseMetadata.prototype.setProtocolVersion = function(value) { - return jspb.Message.setProto3IntField(this, 4, value); +proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.hasMetadata = function() { + return jspb.Message.getField(this, 3) != null; }; +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.org.dash.platform.dapi.v0.GetDataContractsRequest.repeatedFields_ = [1]; + if (jspb.Message.GENERATE_TO_OBJECT) { @@ -965,8 +6305,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.toObject(opt_includeInstance, this); +proto.org.dash.platform.dapi.v0.GetDataContractsRequest.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetDataContractsRequest.toObject(opt_includeInstance, this); }; @@ -975,15 +6315,14 @@ proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.prototype.toObject * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError} msg The msg instance to transform. + * @param {!proto.org.dash.platform.dapi.v0.GetDataContractsRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.toObject = function(includeInstance, msg) { +proto.org.dash.platform.dapi.v0.GetDataContractsRequest.toObject = function(includeInstance, msg) { var f, obj = { - code: jspb.Message.getFieldWithDefault(msg, 1, 0), - message: jspb.Message.getFieldWithDefault(msg, 2, ""), - data: msg.getData_asB64() + idsList: msg.getIdsList_asB64(), + prove: jspb.Message.getBooleanFieldWithDefault(msg, 2, false) }; if (includeInstance) { @@ -997,23 +6336,23 @@ proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.toObject = functio /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError} + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsRequest} */ -proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.deserializeBinary = function(bytes) { +proto.org.dash.platform.dapi.v0.GetDataContractsRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError; - return proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.deserializeBinaryFromReader(msg, reader); + var msg = new proto.org.dash.platform.dapi.v0.GetDataContractsRequest; + return proto.org.dash.platform.dapi.v0.GetDataContractsRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError} msg The message object to deserialize into. + * @param {!proto.org.dash.platform.dapi.v0.GetDataContractsRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError} + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsRequest} */ -proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.deserializeBinaryFromReader = function(msg, reader) { +proto.org.dash.platform.dapi.v0.GetDataContractsRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -1021,16 +6360,12 @@ proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.deserializeBinaryF var field = reader.getFieldNumber(); switch (field) { case 1: - var value = /** @type {number} */ (reader.readUint32()); - msg.setCode(value); + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.addIds(value); break; case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setMessage(value); - break; - case 3: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setData(value); + var value = /** @type {boolean} */ (reader.readBool()); + msg.setProve(value); break; default: reader.skipField(); @@ -1045,9 +6380,9 @@ proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.deserializeBinaryF * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.prototype.serializeBinary = function() { +proto.org.dash.platform.dapi.v0.GetDataContractsRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.serializeBinaryToWriter(this, writer); + proto.org.dash.platform.dapi.v0.GetDataContractsRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -1055,115 +6390,135 @@ proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.prototype.serializ /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError} message + * @param {!proto.org.dash.platform.dapi.v0.GetDataContractsRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.serializeBinaryToWriter = function(message, writer) { +proto.org.dash.platform.dapi.v0.GetDataContractsRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getCode(); - if (f !== 0) { - writer.writeUint32( + f = message.getIdsList_asU8(); + if (f.length > 0) { + writer.writeRepeatedBytes( 1, f ); } - f = message.getMessage(); - if (f.length > 0) { - writer.writeString( + f = message.getProve(); + if (f) { + writer.writeBool( 2, f ); } - f = message.getData_asU8(); - if (f.length > 0) { - writer.writeBytes( - 3, - f - ); - } }; /** - * optional uint32 code = 1; - * @return {number} + * repeated bytes ids = 1; + * @return {!Array} */ -proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.prototype.getCode = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 1, 0)); +proto.org.dash.platform.dapi.v0.GetDataContractsRequest.prototype.getIdsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); }; /** - * @param {number} value - * @return {!proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError} returns this + * repeated bytes ids = 1; + * This is a type-conversion wrapper around `getIdsList()` + * @return {!Array} */ -proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.prototype.setCode = function(value) { - return jspb.Message.setProto3IntField(this, 1, value); +proto.org.dash.platform.dapi.v0.GetDataContractsRequest.prototype.getIdsList_asB64 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsB64( + this.getIdsList())); }; /** - * optional string message = 2; - * @return {string} + * repeated bytes ids = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getIdsList()` + * @return {!Array} */ -proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.prototype.getMessage = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +proto.org.dash.platform.dapi.v0.GetDataContractsRequest.prototype.getIdsList_asU8 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsU8( + this.getIdsList())); }; /** - * @param {string} value - * @return {!proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError} returns this + * @param {!(Array|Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsRequest} returns this */ -proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.prototype.setMessage = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); +proto.org.dash.platform.dapi.v0.GetDataContractsRequest.prototype.setIdsList = function(value) { + return jspb.Message.setField(this, 1, value || []); }; /** - * optional bytes data = 3; - * @return {string} + * @param {!(string|Uint8Array)} value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsRequest} returns this */ -proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.prototype.getData = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +proto.org.dash.platform.dapi.v0.GetDataContractsRequest.prototype.addIds = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); }; /** - * optional bytes data = 3; - * This is a type-conversion wrapper around `getData()` - * @return {string} + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsRequest} returns this */ -proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.prototype.getData_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getData())); +proto.org.dash.platform.dapi.v0.GetDataContractsRequest.prototype.clearIdsList = function() { + return this.setIdsList([]); }; /** - * optional bytes data = 3; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getData()` - * @return {!Uint8Array} + * optional bool prove = 2; + * @return {boolean} */ -proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.prototype.getData_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getData())); +proto.org.dash.platform.dapi.v0.GetDataContractsRequest.prototype.getProve = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); }; /** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError} returns this + * @param {boolean} value + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsRequest} returns this */ -proto.org.dash.platform.dapi.v0.StateTransitionBroadcastError.prototype.setData = function(value) { - return jspb.Message.setProto3BytesField(this, 3, value); +proto.org.dash.platform.dapi.v0.GetDataContractsRequest.prototype.setProve = function(value) { + return jspb.Message.setProto3BooleanField(this, 2, value); }; +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.oneofGroups_ = [[1,2]]; + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.ResultCase = { + RESULT_NOT_SET: 0, + DATA_CONTRACTS: 1, + PROOF: 2 +}; + +/** + * @return {proto.org.dash.platform.dapi.v0.GetDataContractsResponse.ResultCase} + */ +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.prototype.getResultCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetDataContractsResponse.ResultCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetDataContractsResponse.oneofGroups_[0])); +}; + if (jspb.Message.GENERATE_TO_OBJECT) { @@ -1179,8 +6534,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.toObject(opt_includeInstance, this); +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetDataContractsResponse.toObject(opt_includeInstance, this); }; @@ -1189,13 +6544,15 @@ proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.prototype.toObje * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} msg The msg instance to transform. + * @param {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.toObject = function(includeInstance, msg) { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.toObject = function(includeInstance, msg) { var f, obj = { - stateTransition: msg.getStateTransition_asB64() + dataContracts: (f = msg.getDataContracts()) && proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.toObject(includeInstance, f), + proof: (f = msg.getProof()) && proto.org.dash.platform.dapi.v0.Proof.toObject(includeInstance, f), + metadata: (f = msg.getMetadata()) && proto.org.dash.platform.dapi.v0.ResponseMetadata.toObject(includeInstance, f) }; if (includeInstance) { @@ -1209,111 +6566,97 @@ proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.toObject = funct /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse} */ -proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.deserializeBinary = function(bytes) { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest; - return proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.org.dash.platform.dapi.v0.GetDataContractsResponse; + return proto.org.dash.platform.dapi.v0.GetDataContractsResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} msg The message object to deserialize into. + * @param {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse} */ -proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setStateTransition(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; -}; - - -/** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); -}; - - -/** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages - */ -proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getStateTransition_asU8(); - if (f.length > 0) { - writer.writeBytes( - 1, - f - ); - } -}; - - -/** - * optional bytes state_transition = 1; - * @return {string} - */ -proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.prototype.getStateTransition = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); -}; - - -/** - * optional bytes state_transition = 1; - * This is a type-conversion wrapper around `getStateTransition()` - * @return {string} - */ -proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.prototype.getStateTransition_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getStateTransition())); + switch (field) { + case 1: + var value = new proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.deserializeBinaryFromReader); + msg.setDataContracts(value); + break; + case 2: + var value = new proto.org.dash.platform.dapi.v0.Proof; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.Proof.deserializeBinaryFromReader); + msg.setProof(value); + break; + case 3: + var value = new proto.org.dash.platform.dapi.v0.ResponseMetadata; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.ResponseMetadata.deserializeBinaryFromReader); + msg.setMetadata(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; }; /** - * optional bytes state_transition = 1; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getStateTransition()` + * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.prototype.getStateTransition_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getStateTransition())); +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetDataContractsResponse.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); }; /** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest} returns this + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.BroadcastStateTransitionRequest.prototype.setStateTransition = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getDataContracts(); + if (f != null) { + writer.writeMessage( + 1, + f, + proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.serializeBinaryToWriter + ); + } + f = message.getProof(); + if (f != null) { + writer.writeMessage( + 2, + f, + proto.org.dash.platform.dapi.v0.Proof.serializeBinaryToWriter + ); + } + f = message.getMetadata(); + if (f != null) { + writer.writeMessage( + 3, + f, + proto.org.dash.platform.dapi.v0.ResponseMetadata.serializeBinaryToWriter + ); + } }; @@ -1333,8 +6676,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.toObject(opt_includeInstance, this); +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue.toObject(opt_includeInstance, this); }; @@ -1343,13 +6686,13 @@ proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.prototype.toObj * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} msg The msg instance to transform. + * @param {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.toObject = function(includeInstance, msg) { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue.toObject = function(includeInstance, msg) { var f, obj = { - + value: msg.getValue_asB64() }; if (includeInstance) { @@ -1363,29 +6706,33 @@ proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.toObject = func /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue} */ -proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.deserializeBinary = function(bytes) { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse; - return proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.deserializeBinaryFromReader(msg, reader); + var msg = new proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue; + return proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} msg The message object to deserialize into. + * @param {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue} */ -proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.deserializeBinaryFromReader = function(msg, reader) { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; } var field = reader.getFieldNumber(); switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setValue(value); + break; default: reader.skipField(); break; @@ -1399,9 +6746,9 @@ proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.deserializeBina * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.prototype.serializeBinary = function() { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.serializeBinaryToWriter(this, writer); + proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -1409,12 +6756,61 @@ proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.prototype.seria /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse} message + * @param {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.BroadcastStateTransitionResponse.serializeBinaryToWriter = function(message, writer) { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue.serializeBinaryToWriter = function(message, writer) { var f = undefined; + f = message.getValue_asU8(); + if (f.length > 0) { + writer.writeBytes( + 1, + f + ); + } +}; + + +/** + * optional bytes value = 1; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue.prototype.getValue = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +}; + + +/** + * optional bytes value = 1; + * This is a type-conversion wrapper around `getValue()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue.prototype.getValue_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getValue())); +}; + + +/** + * optional bytes value = 1; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getValue()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue.prototype.getValue_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getValue())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue} returns this + */ +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue.prototype.setValue = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); }; @@ -1434,8 +6830,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.org.dash.platform.dapi.v0.GetIdentityRequest.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetIdentityRequest.toObject(opt_includeInstance, this); +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.toObject(opt_includeInstance, this); }; @@ -1444,14 +6840,14 @@ proto.org.dash.platform.dapi.v0.GetIdentityRequest.prototype.toObject = function * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetIdentityRequest} msg The msg instance to transform. + * @param {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetIdentityRequest.toObject = function(includeInstance, msg) { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.toObject = function(includeInstance, msg) { var f, obj = { - id: msg.getId_asB64(), - prove: jspb.Message.getBooleanFieldWithDefault(msg, 2, false) + key: msg.getKey_asB64(), + value: (f = msg.getValue()) && proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue.toObject(includeInstance, f) }; if (includeInstance) { @@ -1465,23 +6861,23 @@ proto.org.dash.platform.dapi.v0.GetIdentityRequest.toObject = function(includeIn /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetIdentityRequest} + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} */ -proto.org.dash.platform.dapi.v0.GetIdentityRequest.deserializeBinary = function(bytes) { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetIdentityRequest; - return proto.org.dash.platform.dapi.v0.GetIdentityRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry; + return proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetIdentityRequest} msg The message object to deserialize into. + * @param {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetIdentityRequest} + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} */ -proto.org.dash.platform.dapi.v0.GetIdentityRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -1490,11 +6886,12 @@ proto.org.dash.platform.dapi.v0.GetIdentityRequest.deserializeBinaryFromReader = switch (field) { case 1: var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setId(value); + msg.setKey(value); break; case 2: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setProve(value); + var value = new proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue.deserializeBinaryFromReader); + msg.setValue(value); break; default: reader.skipField(); @@ -1509,9 +6906,9 @@ proto.org.dash.platform.dapi.v0.GetIdentityRequest.deserializeBinaryFromReader = * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetIdentityRequest.prototype.serializeBinary = function() { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetIdentityRequest.serializeBinaryToWriter(this, writer); + proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -1519,90 +6916,117 @@ proto.org.dash.platform.dapi.v0.GetIdentityRequest.prototype.serializeBinary = f /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetIdentityRequest} message + * @param {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetIdentityRequest.serializeBinaryToWriter = function(message, writer) { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getId_asU8(); + f = message.getKey_asU8(); if (f.length > 0) { writer.writeBytes( 1, f ); } - f = message.getProve(); - if (f) { - writer.writeBool( + f = message.getValue(); + if (f != null) { + writer.writeMessage( 2, - f + f, + proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue.serializeBinaryToWriter ); } }; /** - * optional bytes id = 1; + * optional bytes key = 1; * @return {string} */ -proto.org.dash.platform.dapi.v0.GetIdentityRequest.prototype.getId = function() { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.prototype.getKey = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** - * optional bytes id = 1; - * This is a type-conversion wrapper around `getId()` + * optional bytes key = 1; + * This is a type-conversion wrapper around `getKey()` * @return {string} */ -proto.org.dash.platform.dapi.v0.GetIdentityRequest.prototype.getId_asB64 = function() { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.prototype.getKey_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getId())); + this.getKey())); }; /** - * optional bytes id = 1; + * optional bytes key = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getId()` + * This is a type-conversion wrapper around `getKey()` * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetIdentityRequest.prototype.getId_asU8 = function() { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.prototype.getKey_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getId())); + this.getKey())); }; /** * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetIdentityRequest} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} returns this */ -proto.org.dash.platform.dapi.v0.GetIdentityRequest.prototype.setId = function(value) { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.prototype.setKey = function(value) { return jspb.Message.setProto3BytesField(this, 1, value); }; /** - * optional bool prove = 2; - * @return {boolean} + * optional DataContractValue value = 2; + * @return {?proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue} */ -proto.org.dash.platform.dapi.v0.GetIdentityRequest.prototype.getProve = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.prototype.getValue = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue, 2)); }; /** - * @param {boolean} value - * @return {!proto.org.dash.platform.dapi.v0.GetIdentityRequest} returns this + * @param {?proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractValue|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} returns this +*/ +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.prototype.setValue = function(value) { + return jspb.Message.setWrapperField(this, 2, value); +}; + + +/** + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} returns this */ -proto.org.dash.platform.dapi.v0.GetIdentityRequest.prototype.setProve = function(value) { - return jspb.Message.setProto3BooleanField(this, 2, value); +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.prototype.clearValue = function() { + return this.setValue(undefined); +}; + + +/** + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.prototype.hasValue = function() { + return jspb.Message.getField(this, 2) != null; }; +/** + * List of repeated fields within this message type. + * @private {!Array} + * @const + */ +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.repeatedFields_ = [1]; + if (jspb.Message.GENERATE_TO_OBJECT) { @@ -1618,8 +7042,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetIdentityResponse.toObject(opt_includeInstance, this); +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.toObject(opt_includeInstance, this); }; @@ -1628,15 +7052,14 @@ proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.toObject = functio * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetIdentityResponse} msg The msg instance to transform. + * @param {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetIdentityResponse.toObject = function(includeInstance, msg) { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.toObject = function(includeInstance, msg) { var f, obj = { - identity: msg.getIdentity_asB64(), - proof: (f = msg.getProof()) && proto.org.dash.platform.dapi.v0.Proof.toObject(includeInstance, f), - metadata: (f = msg.getMetadata()) && proto.org.dash.platform.dapi.v0.ResponseMetadata.toObject(includeInstance, f) + dataContractEntriesList: jspb.Message.toObjectList(msg.getDataContractEntriesList(), + proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.toObject, includeInstance) }; if (includeInstance) { @@ -1650,23 +7073,23 @@ proto.org.dash.platform.dapi.v0.GetIdentityResponse.toObject = function(includeI /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetIdentityResponse} + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} */ -proto.org.dash.platform.dapi.v0.GetIdentityResponse.deserializeBinary = function(bytes) { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetIdentityResponse; - return proto.org.dash.platform.dapi.v0.GetIdentityResponse.deserializeBinaryFromReader(msg, reader); + var msg = new proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts; + return proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetIdentityResponse} msg The message object to deserialize into. + * @param {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetIdentityResponse} + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} */ -proto.org.dash.platform.dapi.v0.GetIdentityResponse.deserializeBinaryFromReader = function(msg, reader) { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -1674,18 +7097,9 @@ proto.org.dash.platform.dapi.v0.GetIdentityResponse.deserializeBinaryFromReader var field = reader.getFieldNumber(); switch (field) { case 1: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setIdentity(value); - break; - case 2: - var value = new proto.org.dash.platform.dapi.v0.Proof; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.Proof.deserializeBinaryFromReader); - msg.setProof(value); - break; - case 3: - var value = new proto.org.dash.platform.dapi.v0.ResponseMetadata; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.ResponseMetadata.deserializeBinaryFromReader); - msg.setMetadata(value); + var value = new proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.deserializeBinaryFromReader); + msg.addDataContractEntries(value); break; default: reader.skipField(); @@ -1700,9 +7114,9 @@ proto.org.dash.platform.dapi.v0.GetIdentityResponse.deserializeBinaryFromReader * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.serializeBinary = function() { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetIdentityResponse.serializeBinaryToWriter(this, writer); + proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -1710,77 +7124,95 @@ proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.serializeBinary = /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetIdentityResponse} message + * @param {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetIdentityResponse.serializeBinaryToWriter = function(message, writer) { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getIdentity_asU8(); + f = message.getDataContractEntriesList(); if (f.length > 0) { - writer.writeBytes( + writer.writeRepeatedMessage( 1, - f - ); - } - f = message.getProof(); - if (f != null) { - writer.writeMessage( - 2, - f, - proto.org.dash.platform.dapi.v0.Proof.serializeBinaryToWriter - ); - } - f = message.getMetadata(); - if (f != null) { - writer.writeMessage( - 3, f, - proto.org.dash.platform.dapi.v0.ResponseMetadata.serializeBinaryToWriter + proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry.serializeBinaryToWriter ); } }; /** - * optional bytes identity = 1; - * @return {string} + * repeated DataContractEntry data_contract_entries = 1; + * @return {!Array} + */ +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.prototype.getDataContractEntriesList = function() { + return /** @type{!Array} */ ( + jspb.Message.getRepeatedWrapperField(this, proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry, 1)); +}; + + +/** + * @param {!Array} value + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} returns this +*/ +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.prototype.setDataContractEntriesList = function(value) { + return jspb.Message.setRepeatedWrapperField(this, 1, value); +}; + + +/** + * @param {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry=} opt_value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry} + */ +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.prototype.addDataContractEntries = function(opt_value, opt_index) { + return jspb.Message.addToRepeatedWrapperField(this, 1, opt_value, proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContractEntry, opt_index); +}; + + +/** + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} returns this + */ +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts.prototype.clearDataContractEntriesList = function() { + return this.setDataContractEntriesList([]); +}; + + +/** + * optional DataContracts data_contracts = 1; + * @return {?proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} */ -proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.getIdentity = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.prototype.getDataContracts = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts, 1)); }; /** - * optional bytes identity = 1; - * This is a type-conversion wrapper around `getIdentity()` - * @return {string} - */ -proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.getIdentity_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getIdentity())); + * @param {?proto.org.dash.platform.dapi.v0.GetDataContractsResponse.DataContracts|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.prototype.setDataContracts = function(value) { + return jspb.Message.setOneofWrapperField(this, 1, proto.org.dash.platform.dapi.v0.GetDataContractsResponse.oneofGroups_[0], value); }; /** - * optional bytes identity = 1; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getIdentity()` - * @return {!Uint8Array} + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.getIdentity_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getIdentity())); +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.prototype.clearDataContracts = function() { + return this.setDataContracts(undefined); }; /** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetIdentityResponse} returns this + * Returns whether this field is set. + * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.setIdentity = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.prototype.hasDataContracts = function() { + return jspb.Message.getField(this, 1) != null; }; @@ -1788,7 +7220,7 @@ proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.setIdentity = func * optional Proof proof = 2; * @return {?proto.org.dash.platform.dapi.v0.Proof} */ -proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.getProof = function() { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.prototype.getProof = function() { return /** @type{?proto.org.dash.platform.dapi.v0.Proof} */ ( jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.Proof, 2)); }; @@ -1796,18 +7228,18 @@ proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.getProof = functio /** * @param {?proto.org.dash.platform.dapi.v0.Proof|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetIdentityResponse} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.setProof = function(value) { - return jspb.Message.setWrapperField(this, 2, value); +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.prototype.setProof = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.org.dash.platform.dapi.v0.GetDataContractsResponse.oneofGroups_[0], value); }; /** * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetIdentityResponse} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.clearProof = function() { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.prototype.clearProof = function() { return this.setProof(undefined); }; @@ -1816,7 +7248,7 @@ proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.clearProof = funct * Returns whether this field is set. * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.hasProof = function() { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.prototype.hasProof = function() { return jspb.Message.getField(this, 2) != null; }; @@ -1825,7 +7257,7 @@ proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.hasProof = functio * optional ResponseMetadata metadata = 3; * @return {?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ -proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.getMetadata = function() { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.prototype.getMetadata = function() { return /** @type{?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ ( jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.ResponseMetadata, 3)); }; @@ -1833,18 +7265,18 @@ proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.getMetadata = func /** * @param {?proto.org.dash.platform.dapi.v0.ResponseMetadata|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetIdentityResponse} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.setMetadata = function(value) { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.prototype.setMetadata = function(value) { return jspb.Message.setWrapperField(this, 3, value); }; /** * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetIdentityResponse} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDataContractsResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.clearMetadata = function() { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.prototype.clearMetadata = function() { return this.setMetadata(undefined); }; @@ -1853,12 +7285,38 @@ proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.clearMetadata = fu * Returns whether this field is set. * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetIdentityResponse.prototype.hasMetadata = function() { +proto.org.dash.platform.dapi.v0.GetDataContractsResponse.prototype.hasMetadata = function() { return jspb.Message.getField(this, 3) != null; }; +/** + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} + * @const + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.oneofGroups_ = [[6,7]]; + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.StartCase = { + START_NOT_SET: 0, + START_AFTER: 6, + START_AT: 7 +}; + +/** + * @return {proto.org.dash.platform.dapi.v0.GetDocumentsRequest.StartCase} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getStartCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetDocumentsRequest.StartCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.oneofGroups_[0])); +}; + if (jspb.Message.GENERATE_TO_OBJECT) { @@ -1874,8 +7332,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.org.dash.platform.dapi.v0.GetDataContractRequest.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetDataContractRequest.toObject(opt_includeInstance, this); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetDocumentsRequest.toObject(opt_includeInstance, this); }; @@ -1884,14 +7342,20 @@ proto.org.dash.platform.dapi.v0.GetDataContractRequest.prototype.toObject = func * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetDataContractRequest} msg The msg instance to transform. + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDataContractRequest.toObject = function(includeInstance, msg) { +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.toObject = function(includeInstance, msg) { var f, obj = { - id: msg.getId_asB64(), - prove: jspb.Message.getBooleanFieldWithDefault(msg, 2, false) + dataContractId: msg.getDataContractId_asB64(), + documentType: jspb.Message.getFieldWithDefault(msg, 2, ""), + where: msg.getWhere_asB64(), + orderBy: msg.getOrderBy_asB64(), + limit: jspb.Message.getFieldWithDefault(msg, 5, 0), + startAfter: msg.getStartAfter_asB64(), + startAt: msg.getStartAt_asB64(), + prove: jspb.Message.getBooleanFieldWithDefault(msg, 8, false) }; if (includeInstance) { @@ -1905,23 +7369,23 @@ proto.org.dash.platform.dapi.v0.GetDataContractRequest.toObject = function(inclu /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetDataContractRequest} + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} */ -proto.org.dash.platform.dapi.v0.GetDataContractRequest.deserializeBinary = function(bytes) { +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetDataContractRequest; - return proto.org.dash.platform.dapi.v0.GetDataContractRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsRequest; + return proto.org.dash.platform.dapi.v0.GetDocumentsRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetDataContractRequest} msg The message object to deserialize into. + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetDataContractRequest} + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} */ -proto.org.dash.platform.dapi.v0.GetDataContractRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -1930,9 +7394,33 @@ proto.org.dash.platform.dapi.v0.GetDataContractRequest.deserializeBinaryFromRead switch (field) { case 1: var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setId(value); + msg.setDataContractId(value); break; case 2: + var value = /** @type {string} */ (reader.readString()); + msg.setDocumentType(value); + break; + case 3: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setWhere(value); + break; + case 4: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setOrderBy(value); + break; + case 5: + var value = /** @type {number} */ (reader.readUint32()); + msg.setLimit(value); + break; + case 6: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setStartAfter(value); + break; + case 7: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.setStartAt(value); + break; + case 8: var value = /** @type {boolean} */ (reader.readBool()); msg.setProve(value); break; @@ -1949,9 +7437,9 @@ proto.org.dash.platform.dapi.v0.GetDataContractRequest.deserializeBinaryFromRead * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetDataContractRequest.prototype.serializeBinary = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetDataContractRequest.serializeBinaryToWriter(this, writer); + proto.org.dash.platform.dapi.v0.GetDocumentsRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -1959,23 +7447,65 @@ proto.org.dash.platform.dapi.v0.GetDataContractRequest.prototype.serializeBinary /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetDataContractRequest} message + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDataContractRequest.serializeBinaryToWriter = function(message, writer) { +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getId_asU8(); + f = message.getDataContractId_asU8(); if (f.length > 0) { writer.writeBytes( 1, f ); } + f = message.getDocumentType(); + if (f.length > 0) { + writer.writeString( + 2, + f + ); + } + f = message.getWhere_asU8(); + if (f.length > 0) { + writer.writeBytes( + 3, + f + ); + } + f = message.getOrderBy_asU8(); + if (f.length > 0) { + writer.writeBytes( + 4, + f + ); + } + f = message.getLimit(); + if (f !== 0) { + writer.writeUint32( + 5, + f + ); + } + f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 6)); + if (f != null) { + writer.writeBytes( + 6, + f + ); + } + f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 7)); + if (f != null) { + writer.writeBytes( + 7, + f + ); + } f = message.getProve(); if (f) { writer.writeBool( - 2, + 8, f ); } @@ -1983,309 +7513,275 @@ proto.org.dash.platform.dapi.v0.GetDataContractRequest.serializeBinaryToWriter = /** - * optional bytes id = 1; + * optional bytes data_contract_id = 1; * @return {string} */ -proto.org.dash.platform.dapi.v0.GetDataContractRequest.prototype.getId = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getDataContractId = function() { return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** - * optional bytes id = 1; - * This is a type-conversion wrapper around `getId()` + * optional bytes data_contract_id = 1; + * This is a type-conversion wrapper around `getDataContractId()` * @return {string} */ -proto.org.dash.platform.dapi.v0.GetDataContractRequest.prototype.getId_asB64 = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getDataContractId_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getId())); + this.getDataContractId())); }; /** - * optional bytes id = 1; + * optional bytes data_contract_id = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getId()` + * This is a type-conversion wrapper around `getDataContractId()` * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetDataContractRequest.prototype.getId_asU8 = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getDataContractId_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getId())); + this.getDataContractId())); }; /** * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetDataContractRequest} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this */ -proto.org.dash.platform.dapi.v0.GetDataContractRequest.prototype.setId = function(value) { +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.setDataContractId = function(value) { return jspb.Message.setProto3BytesField(this, 1, value); }; /** - * optional bool prove = 2; - * @return {boolean} + * optional string document_type = 2; + * @return {string} */ -proto.org.dash.platform.dapi.v0.GetDataContractRequest.prototype.getProve = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getDocumentType = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); }; /** - * @param {boolean} value - * @return {!proto.org.dash.platform.dapi.v0.GetDataContractRequest} returns this + * @param {string} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this */ -proto.org.dash.platform.dapi.v0.GetDataContractRequest.prototype.setProve = function(value) { - return jspb.Message.setProto3BooleanField(this, 2, value); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.setDocumentType = function(value) { + return jspb.Message.setProto3StringField(this, 2, value); }; +/** + * optional bytes where = 3; + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getWhere = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +}; + +/** + * optional bytes where = 3; + * This is a type-conversion wrapper around `getWhere()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getWhere_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getWhere())); +}; -if (jspb.Message.GENERATE_TO_OBJECT) { /** - * Creates an object representation of this proto. - * Field names that are reserved in JavaScript and will be renamed to pb_name. - * Optional fields that are not set will be set to undefined. - * To access a reserved field use, foo.pb_, eg, foo.pb_default. - * For the list of reserved names please see: - * net/proto2/compiler/js/internal/generator.cc#kKeyword. - * @param {boolean=} opt_includeInstance Deprecated. whether to include the - * JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @return {!Object} + * optional bytes where = 3; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getWhere()` + * @return {!Uint8Array} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getWhere_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getWhere())); +}; + + +/** + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this */ -proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetDataContractResponse.toObject(opt_includeInstance, this); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.setWhere = function(value) { + return jspb.Message.setProto3BytesField(this, 3, value); }; /** - * Static version of the {@see toObject} method. - * @param {boolean|undefined} includeInstance Deprecated. Whether to include - * the JSPB instance for transitional soy proto support: - * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetDataContractResponse} msg The msg instance to transform. - * @return {!Object} - * @suppress {unusedLocalVariables} f is only used for nested messages + * optional bytes order_by = 4; + * @return {string} */ -proto.org.dash.platform.dapi.v0.GetDataContractResponse.toObject = function(includeInstance, msg) { - var f, obj = { - dataContract: msg.getDataContract_asB64(), - proof: (f = msg.getProof()) && proto.org.dash.platform.dapi.v0.Proof.toObject(includeInstance, f), - metadata: (f = msg.getMetadata()) && proto.org.dash.platform.dapi.v0.ResponseMetadata.toObject(includeInstance, f) - }; +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getOrderBy = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +}; - if (includeInstance) { - obj.$jspbMessageInstance = msg; - } - return obj; + +/** + * optional bytes order_by = 4; + * This is a type-conversion wrapper around `getOrderBy()` + * @return {string} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getOrderBy_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getOrderBy())); }; -} /** - * Deserializes binary data (in protobuf wire format). - * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetDataContractResponse} + * optional bytes order_by = 4; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getOrderBy()` + * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetDataContractResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetDataContractResponse; - return proto.org.dash.platform.dapi.v0.GetDataContractResponse.deserializeBinaryFromReader(msg, reader); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getOrderBy_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getOrderBy())); }; /** - * Deserializes binary data (in protobuf wire format) from the - * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetDataContractResponse} msg The message object to deserialize into. - * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetDataContractResponse} + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this */ -proto.org.dash.platform.dapi.v0.GetDataContractResponse.deserializeBinaryFromReader = function(msg, reader) { - while (reader.nextField()) { - if (reader.isEndGroup()) { - break; - } - var field = reader.getFieldNumber(); - switch (field) { - case 1: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setDataContract(value); - break; - case 2: - var value = new proto.org.dash.platform.dapi.v0.Proof; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.Proof.deserializeBinaryFromReader); - msg.setProof(value); - break; - case 3: - var value = new proto.org.dash.platform.dapi.v0.ResponseMetadata; - reader.readMessage(value,proto.org.dash.platform.dapi.v0.ResponseMetadata.deserializeBinaryFromReader); - msg.setMetadata(value); - break; - default: - reader.skipField(); - break; - } - } - return msg; +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.setOrderBy = function(value) { + return jspb.Message.setProto3BytesField(this, 4, value); }; /** - * Serializes the message to binary data (in protobuf wire format). - * @return {!Uint8Array} + * optional uint32 limit = 5; + * @return {number} */ -proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.serializeBinary = function() { - var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetDataContractResponse.serializeBinaryToWriter(this, writer); - return writer.getResultBuffer(); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getLimit = function() { + return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); }; /** - * Serializes the given message to binary data (in protobuf wire - * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetDataContractResponse} message - * @param {!jspb.BinaryWriter} writer - * @suppress {unusedLocalVariables} f is only used for nested messages + * @param {number} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this */ -proto.org.dash.platform.dapi.v0.GetDataContractResponse.serializeBinaryToWriter = function(message, writer) { - var f = undefined; - f = message.getDataContract_asU8(); - if (f.length > 0) { - writer.writeBytes( - 1, - f - ); - } - f = message.getProof(); - if (f != null) { - writer.writeMessage( - 2, - f, - proto.org.dash.platform.dapi.v0.Proof.serializeBinaryToWriter - ); - } - f = message.getMetadata(); - if (f != null) { - writer.writeMessage( - 3, - f, - proto.org.dash.platform.dapi.v0.ResponseMetadata.serializeBinaryToWriter - ); - } +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.setLimit = function(value) { + return jspb.Message.setProto3IntField(this, 5, value); }; /** - * optional bytes data_contract = 1; + * optional bytes start_after = 6; * @return {string} */ -proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.getDataContract = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getStartAfter = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); }; /** - * optional bytes data_contract = 1; - * This is a type-conversion wrapper around `getDataContract()` + * optional bytes start_after = 6; + * This is a type-conversion wrapper around `getStartAfter()` * @return {string} */ -proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.getDataContract_asB64 = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getStartAfter_asB64 = function() { return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getDataContract())); + this.getStartAfter())); }; /** - * optional bytes data_contract = 1; + * optional bytes start_after = 6; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getDataContract()` + * This is a type-conversion wrapper around `getStartAfter()` * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.getDataContract_asU8 = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getStartAfter_asU8 = function() { return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getDataContract())); + this.getStartAfter())); }; /** * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetDataContractResponse} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this */ -proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.setDataContract = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.setStartAfter = function(value) { + return jspb.Message.setOneofField(this, 6, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.oneofGroups_[0], value); }; /** - * optional Proof proof = 2; - * @return {?proto.org.dash.platform.dapi.v0.Proof} + * Clears the field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this */ -proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.getProof = function() { - return /** @type{?proto.org.dash.platform.dapi.v0.Proof} */ ( - jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.Proof, 2)); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.clearStartAfter = function() { + return jspb.Message.setOneofField(this, 6, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.oneofGroups_[0], undefined); }; /** - * @param {?proto.org.dash.platform.dapi.v0.Proof|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetDataContractResponse} returns this -*/ -proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.setProof = function(value) { - return jspb.Message.setWrapperField(this, 2, value); + * Returns whether this field is set. + * @return {boolean} + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.hasStartAfter = function() { + return jspb.Message.getField(this, 6) != null; }; /** - * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetDataContractResponse} returns this + * optional bytes start_at = 7; + * @return {string} */ -proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.clearProof = function() { - return this.setProof(undefined); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getStartAt = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "")); }; /** - * Returns whether this field is set. - * @return {boolean} + * optional bytes start_at = 7; + * This is a type-conversion wrapper around `getStartAt()` + * @return {string} */ -proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.hasProof = function() { - return jspb.Message.getField(this, 2) != null; +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getStartAt_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getStartAt())); }; /** - * optional ResponseMetadata metadata = 3; - * @return {?proto.org.dash.platform.dapi.v0.ResponseMetadata} + * optional bytes start_at = 7; + * Note that Uint8Array is not supported on all browsers. + * @see http://caniuse.com/Uint8Array + * This is a type-conversion wrapper around `getStartAt()` + * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.getMetadata = function() { - return /** @type{?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ ( - jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.ResponseMetadata, 3)); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getStartAt_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getStartAt())); }; /** - * @param {?proto.org.dash.platform.dapi.v0.ResponseMetadata|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetDataContractResponse} returns this -*/ -proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.setMetadata = function(value) { - return jspb.Message.setWrapperField(this, 3, value); + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.setStartAt = function(value) { + return jspb.Message.setOneofField(this, 7, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.oneofGroups_[0], value); }; /** - * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetDataContractResponse} returns this + * Clears the field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this */ -proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.clearMetadata = function() { - return this.setMetadata(undefined); +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.clearStartAt = function() { + return jspb.Message.setOneofField(this, 7, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.oneofGroups_[0], undefined); }; @@ -2293,37 +7789,36 @@ proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.clearMetadata * Returns whether this field is set. * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetDataContractResponse.prototype.hasMetadata = function() { - return jspb.Message.getField(this, 3) != null; +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.hasStartAt = function() { + return jspb.Message.getField(this, 7) != null; }; - /** - * Oneof group definitions for this message. Each group defines the field - * numbers belonging to that group. When of these fields' value is set, all - * other fields in the group are cleared. During deserialization, if multiple - * fields are encountered for a group, only the last value seen will be kept. - * @private {!Array>} - * @const + * optional bool prove = 8; + * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.oneofGroups_ = [[6,7]]; +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getProve = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 8, false)); +}; + /** - * @enum {number} - */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.StartCase = { - START_NOT_SET: 0, - START_AFTER: 6, - START_AT: 7 + * @param {boolean} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this + */ +proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.setProve = function(value) { + return jspb.Message.setProto3BooleanField(this, 8, value); }; + + /** - * @return {proto.org.dash.platform.dapi.v0.GetDocumentsRequest.StartCase} + * List of repeated fields within this message type. + * @private {!Array} + * @const */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getStartCase = function() { - return /** @type {proto.org.dash.platform.dapi.v0.GetDocumentsRequest.StartCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.oneofGroups_[0])); -}; +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.repeatedFields_ = [1]; @@ -2340,8 +7835,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetDocumentsRequest.toObject(opt_includeInstance, this); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.toObject(opt_includeInstance, this); }; @@ -2350,20 +7845,15 @@ proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.toObject = functio * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} msg The msg instance to transform. + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.toObject = function(includeInstance, msg) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.toObject = function(includeInstance, msg) { var f, obj = { - dataContractId: msg.getDataContractId_asB64(), - documentType: jspb.Message.getFieldWithDefault(msg, 2, ""), - where: msg.getWhere_asB64(), - orderBy: msg.getOrderBy_asB64(), - limit: jspb.Message.getFieldWithDefault(msg, 5, 0), - startAfter: msg.getStartAfter_asB64(), - startAt: msg.getStartAt_asB64(), - prove: jspb.Message.getBooleanFieldWithDefault(msg, 8, false) + documentsList: msg.getDocumentsList_asB64(), + proof: (f = msg.getProof()) && proto.org.dash.platform.dapi.v0.Proof.toObject(includeInstance, f), + metadata: (f = msg.getMetadata()) && proto.org.dash.platform.dapi.v0.ResponseMetadata.toObject(includeInstance, f) }; if (includeInstance) { @@ -2377,23 +7867,23 @@ proto.org.dash.platform.dapi.v0.GetDocumentsRequest.toObject = function(includeI /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.deserializeBinary = function(bytes) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsRequest; - return proto.org.dash.platform.dapi.v0.GetDocumentsRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsResponse; + return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} msg The message object to deserialize into. + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -2402,35 +7892,17 @@ proto.org.dash.platform.dapi.v0.GetDocumentsRequest.deserializeBinaryFromReader switch (field) { case 1: var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setDataContractId(value); + msg.addDocuments(value); break; case 2: - var value = /** @type {string} */ (reader.readString()); - msg.setDocumentType(value); + var value = new proto.org.dash.platform.dapi.v0.Proof; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.Proof.deserializeBinaryFromReader); + msg.setProof(value); break; case 3: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setWhere(value); - break; - case 4: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setOrderBy(value); - break; - case 5: - var value = /** @type {number} */ (reader.readUint32()); - msg.setLimit(value); - break; - case 6: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setStartAfter(value); - break; - case 7: - var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.setStartAt(value); - break; - case 8: - var value = /** @type {boolean} */ (reader.readBool()); - msg.setProve(value); + var value = new proto.org.dash.platform.dapi.v0.ResponseMetadata; + reader.readMessage(value,proto.org.dash.platform.dapi.v0.ResponseMetadata.deserializeBinaryFromReader); + msg.setMetadata(value); break; default: reader.skipField(); @@ -2445,9 +7917,9 @@ proto.org.dash.platform.dapi.v0.GetDocumentsRequest.deserializeBinaryFromReader * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.serializeBinary = function() { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetDocumentsRequest.serializeBinaryToWriter(this, writer); + proto.org.dash.platform.dapi.v0.GetDocumentsResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -2455,368 +7927,380 @@ proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.serializeBinary = /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} message + * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.serializeBinaryToWriter = function(message, writer) { +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getDataContractId_asU8(); + f = message.getDocumentsList_asU8(); if (f.length > 0) { - writer.writeBytes( + writer.writeRepeatedBytes( 1, f ); } - f = message.getDocumentType(); - if (f.length > 0) { - writer.writeString( - 2, - f - ); - } - f = message.getWhere_asU8(); - if (f.length > 0) { - writer.writeBytes( - 3, - f - ); - } - f = message.getOrderBy_asU8(); - if (f.length > 0) { - writer.writeBytes( - 4, - f - ); - } - f = message.getLimit(); - if (f !== 0) { - writer.writeUint32( - 5, - f - ); - } - f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 6)); + f = message.getProof(); if (f != null) { - writer.writeBytes( - 6, - f + writer.writeMessage( + 2, + f, + proto.org.dash.platform.dapi.v0.Proof.serializeBinaryToWriter ); } - f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 7)); + f = message.getMetadata(); if (f != null) { - writer.writeBytes( - 7, - f - ); - } - f = message.getProve(); - if (f) { - writer.writeBool( - 8, - f + writer.writeMessage( + 3, + f, + proto.org.dash.platform.dapi.v0.ResponseMetadata.serializeBinaryToWriter ); } }; /** - * optional bytes data_contract_id = 1; - * @return {string} + * repeated bytes documents = 1; + * @return {!Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getDataContractId = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.getDocumentsList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); }; /** - * optional bytes data_contract_id = 1; - * This is a type-conversion wrapper around `getDataContractId()` - * @return {string} + * repeated bytes documents = 1; + * This is a type-conversion wrapper around `getDocumentsList()` + * @return {!Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getDataContractId_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getDataContractId())); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.getDocumentsList_asB64 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsB64( + this.getDocumentsList())); }; /** - * optional bytes data_contract_id = 1; + * repeated bytes documents = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getDataContractId()` - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getDataContractId_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getDataContractId())); -}; - - -/** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this + * This is a type-conversion wrapper around `getDocumentsList()` + * @return {!Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.setDataContractId = function(value) { - return jspb.Message.setProto3BytesField(this, 1, value); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.getDocumentsList_asU8 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsU8( + this.getDocumentsList())); }; /** - * optional string document_type = 2; - * @return {string} + * @param {!(Array|Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getDocumentType = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 2, "")); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.setDocumentsList = function(value) { + return jspb.Message.setField(this, 1, value || []); }; /** - * @param {string} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this + * @param {!(string|Uint8Array)} value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.setDocumentType = function(value) { - return jspb.Message.setProto3StringField(this, 2, value); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.addDocuments = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); }; /** - * optional bytes where = 3; - * @return {string} + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getWhere = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 3, "")); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.clearDocumentsList = function() { + return this.setDocumentsList([]); }; /** - * optional bytes where = 3; - * This is a type-conversion wrapper around `getWhere()` - * @return {string} + * optional Proof proof = 2; + * @return {?proto.org.dash.platform.dapi.v0.Proof} */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getWhere_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getWhere())); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.getProof = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.Proof} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.Proof, 2)); }; /** - * optional bytes where = 3; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getWhere()` - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getWhere_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getWhere())); + * @param {?proto.org.dash.platform.dapi.v0.Proof|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.setProof = function(value) { + return jspb.Message.setWrapperField(this, 2, value); }; /** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.setWhere = function(value) { - return jspb.Message.setProto3BytesField(this, 3, value); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.clearProof = function() { + return this.setProof(undefined); }; /** - * optional bytes order_by = 4; - * @return {string} + * Returns whether this field is set. + * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getOrderBy = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 4, "")); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.hasProof = function() { + return jspb.Message.getField(this, 2) != null; }; /** - * optional bytes order_by = 4; - * This is a type-conversion wrapper around `getOrderBy()` - * @return {string} + * optional ResponseMetadata metadata = 3; + * @return {?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getOrderBy_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getOrderBy())); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.getMetadata = function() { + return /** @type{?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ ( + jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.ResponseMetadata, 3)); }; /** - * optional bytes order_by = 4; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getOrderBy()` - * @return {!Uint8Array} - */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getOrderBy_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getOrderBy())); + * @param {?proto.org.dash.platform.dapi.v0.ResponseMetadata|undefined} value + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} returns this +*/ +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.setMetadata = function(value) { + return jspb.Message.setWrapperField(this, 3, value); }; /** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this + * Clears the message field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.setOrderBy = function(value) { - return jspb.Message.setProto3BytesField(this, 4, value); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.clearMetadata = function() { + return this.setMetadata(undefined); }; /** - * optional uint32 limit = 5; - * @return {number} + * Returns whether this field is set. + * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getLimit = function() { - return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 5, 0)); +proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.hasMetadata = function() { + return jspb.Message.getField(this, 3) != null; }; + /** - * @param {number} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this + * List of repeated fields within this message type. + * @private {!Array} + * @const */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.setLimit = function(value) { - return jspb.Message.setProto3IntField(this, 5, value); -}; +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.repeatedFields_ = [1]; + +if (jspb.Message.GENERATE_TO_OBJECT) { /** - * optional bytes start_after = 6; - * @return {string} + * Creates an object representation of this proto. + * Field names that are reserved in JavaScript and will be renamed to pb_name. + * Optional fields that are not set will be set to undefined. + * To access a reserved field use, foo.pb_, eg, foo.pb_default. + * For the list of reserved names please see: + * net/proto2/compiler/js/internal/generator.cc#kKeyword. + * @param {boolean=} opt_includeInstance Deprecated. whether to include the + * JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @return {!Object} */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getStartAfter = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 6, "")); +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.toObject(opt_includeInstance, this); }; /** - * optional bytes start_after = 6; - * This is a type-conversion wrapper around `getStartAfter()` - * @return {string} + * Static version of the {@see toObject} method. + * @param {boolean|undefined} includeInstance Deprecated. Whether to include + * the JSPB instance for transitional soy proto support: + * http://goto/soy-param-migration + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest} msg The msg instance to transform. + * @return {!Object} + * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getStartAfter_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getStartAfter())); +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.toObject = function(includeInstance, msg) { + var f, obj = { + publicKeyHashesList: msg.getPublicKeyHashesList_asB64(), + prove: jspb.Message.getBooleanFieldWithDefault(msg, 2, false) + }; + + if (includeInstance) { + obj.$jspbMessageInstance = msg; + } + return obj; }; +} /** - * optional bytes start_after = 6; - * Note that Uint8Array is not supported on all browsers. - * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getStartAfter()` - * @return {!Uint8Array} + * Deserializes binary data (in protobuf wire format). + * @param {jspb.ByteSource} bytes The bytes to deserialize. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest} */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getStartAfter_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getStartAfter())); +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest; + return proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.deserializeBinaryFromReader(msg, reader); }; /** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this + * Deserializes binary data (in protobuf wire format) from the + * given reader into the given message object. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest} msg The message object to deserialize into. + * @param {!jspb.BinaryReader} reader The BinaryReader to use. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest} */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.setStartAfter = function(value) { - return jspb.Message.setOneofField(this, 6, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.oneofGroups_[0], value); +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.deserializeBinaryFromReader = function(msg, reader) { + while (reader.nextField()) { + if (reader.isEndGroup()) { + break; + } + var field = reader.getFieldNumber(); + switch (field) { + case 1: + var value = /** @type {!Uint8Array} */ (reader.readBytes()); + msg.addPublicKeyHashes(value); + break; + case 2: + var value = /** @type {boolean} */ (reader.readBool()); + msg.setProve(value); + break; + default: + reader.skipField(); + break; + } + } + return msg; }; /** - * Clears the field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this + * Serializes the message to binary data (in protobuf wire format). + * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.clearStartAfter = function() { - return jspb.Message.setOneofField(this, 6, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.oneofGroups_[0], undefined); +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.prototype.serializeBinary = function() { + var writer = new jspb.BinaryWriter(); + proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.serializeBinaryToWriter(this, writer); + return writer.getResultBuffer(); }; /** - * Returns whether this field is set. - * @return {boolean} + * Serializes the given message to binary data (in protobuf wire + * format), writing to the given BinaryWriter. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest} message + * @param {!jspb.BinaryWriter} writer + * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.hasStartAfter = function() { - return jspb.Message.getField(this, 6) != null; +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.serializeBinaryToWriter = function(message, writer) { + var f = undefined; + f = message.getPublicKeyHashesList_asU8(); + if (f.length > 0) { + writer.writeRepeatedBytes( + 1, + f + ); + } + f = message.getProve(); + if (f) { + writer.writeBool( + 2, + f + ); + } }; /** - * optional bytes start_at = 7; - * @return {string} + * repeated bytes public_key_hashes = 1; + * @return {!Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getStartAt = function() { - return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 7, "")); +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.prototype.getPublicKeyHashesList = function() { + return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); }; /** - * optional bytes start_at = 7; - * This is a type-conversion wrapper around `getStartAt()` - * @return {string} + * repeated bytes public_key_hashes = 1; + * This is a type-conversion wrapper around `getPublicKeyHashesList()` + * @return {!Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getStartAt_asB64 = function() { - return /** @type {string} */ (jspb.Message.bytesAsB64( - this.getStartAt())); +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.prototype.getPublicKeyHashesList_asB64 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsB64( + this.getPublicKeyHashesList())); }; /** - * optional bytes start_at = 7; + * repeated bytes public_key_hashes = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getStartAt()` - * @return {!Uint8Array} + * This is a type-conversion wrapper around `getPublicKeyHashesList()` + * @return {!Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getStartAt_asU8 = function() { - return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( - this.getStartAt())); +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.prototype.getPublicKeyHashesList_asU8 = function() { + return /** @type {!Array} */ (jspb.Message.bytesListAsU8( + this.getPublicKeyHashesList())); }; /** - * @param {!(string|Uint8Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this + * @param {!(Array|Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.setStartAt = function(value) { - return jspb.Message.setOneofField(this, 7, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.oneofGroups_[0], value); +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.prototype.setPublicKeyHashesList = function(value) { + return jspb.Message.setField(this, 1, value || []); }; /** - * Clears the field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this + * @param {!(string|Uint8Array)} value + * @param {number=} opt_index + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.clearStartAt = function() { - return jspb.Message.setOneofField(this, 7, proto.org.dash.platform.dapi.v0.GetDocumentsRequest.oneofGroups_[0], undefined); +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.prototype.addPublicKeyHashes = function(value, opt_index) { + return jspb.Message.addToRepeatedField(this, 1, value, opt_index); }; /** - * Returns whether this field is set. - * @return {boolean} + * Clears the list making it empty but non-null. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.hasStartAt = function() { - return jspb.Message.getField(this, 7) != null; +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.prototype.clearPublicKeyHashesList = function() { + return this.setPublicKeyHashesList([]); }; /** - * optional bool prove = 8; + * optional bool prove = 2; * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.getProve = function() { - return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 8, false)); +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.prototype.getProve = function() { + return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); }; /** * @param {boolean} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsRequest} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.setProve = function(value) { - return jspb.Message.setProto3BooleanField(this, 8, value); +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.prototype.setProve = function(value) { + return jspb.Message.setProto3BooleanField(this, 2, value); }; @@ -2826,7 +8310,7 @@ proto.org.dash.platform.dapi.v0.GetDocumentsRequest.prototype.setProve = functio * @private {!Array} * @const */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.repeatedFields_ = [1]; +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.repeatedFields_ = [1]; @@ -2843,8 +8327,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.toObject(opt_includeInstance, this); +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.toObject(opt_includeInstance, this); }; @@ -2853,13 +8337,13 @@ proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.toObject = functi * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} msg The msg instance to transform. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.toObject = function(includeInstance, msg) { +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.toObject = function(includeInstance, msg) { var f, obj = { - documentsList: msg.getDocumentsList_asB64(), + identitiesList: msg.getIdentitiesList_asB64(), proof: (f = msg.getProof()) && proto.org.dash.platform.dapi.v0.Proof.toObject(includeInstance, f), metadata: (f = msg.getMetadata()) && proto.org.dash.platform.dapi.v0.ResponseMetadata.toObject(includeInstance, f) }; @@ -2875,23 +8359,23 @@ proto.org.dash.platform.dapi.v0.GetDocumentsResponse.toObject = function(include /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.deserializeBinary = function(bytes) { - var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetDocumentsResponse; - return proto.org.dash.platform.dapi.v0.GetDocumentsResponse.deserializeBinaryFromReader(msg, reader); +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.deserializeBinary = function(bytes) { + var reader = new jspb.BinaryReader(bytes); + var msg = new proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse; + return proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} msg The message object to deserialize into. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.deserializeBinaryFromReader = function(msg, reader) { +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -2900,7 +8384,7 @@ proto.org.dash.platform.dapi.v0.GetDocumentsResponse.deserializeBinaryFromReader switch (field) { case 1: var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.addDocuments(value); + msg.addIdentities(value); break; case 2: var value = new proto.org.dash.platform.dapi.v0.Proof; @@ -2925,9 +8409,9 @@ proto.org.dash.platform.dapi.v0.GetDocumentsResponse.deserializeBinaryFromReader * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.serializeBinary = function() { +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetDocumentsResponse.serializeBinaryToWriter(this, writer); + proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -2935,13 +8419,13 @@ proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.serializeBinary = /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} message + * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.serializeBinaryToWriter = function(message, writer) { +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getDocumentsList_asU8(); + f = message.getIdentitiesList_asU8(); if (f.length > 0) { writer.writeRepeatedBytes( 1, @@ -2968,43 +8452,43 @@ proto.org.dash.platform.dapi.v0.GetDocumentsResponse.serializeBinaryToWriter = f /** - * repeated bytes documents = 1; + * repeated bytes identities = 1; * @return {!Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.getDocumentsList = function() { +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.getIdentitiesList = function() { return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); }; /** - * repeated bytes documents = 1; - * This is a type-conversion wrapper around `getDocumentsList()` + * repeated bytes identities = 1; + * This is a type-conversion wrapper around `getIdentitiesList()` * @return {!Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.getDocumentsList_asB64 = function() { +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.getIdentitiesList_asB64 = function() { return /** @type {!Array} */ (jspb.Message.bytesListAsB64( - this.getDocumentsList())); + this.getIdentitiesList())); }; /** - * repeated bytes documents = 1; + * repeated bytes identities = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getDocumentsList()` + * This is a type-conversion wrapper around `getIdentitiesList()` * @return {!Array} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.getDocumentsList_asU8 = function() { +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.getIdentitiesList_asU8 = function() { return /** @type {!Array} */ (jspb.Message.bytesListAsU8( - this.getDocumentsList())); + this.getIdentitiesList())); }; /** * @param {!(Array|Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.setDocumentsList = function(value) { +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.setIdentitiesList = function(value) { return jspb.Message.setField(this, 1, value || []); }; @@ -3012,19 +8496,19 @@ proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.setDocumentsList /** * @param {!(string|Uint8Array)} value * @param {number=} opt_index - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.addDocuments = function(value, opt_index) { +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.addIdentities = function(value, opt_index) { return jspb.Message.addToRepeatedField(this, 1, value, opt_index); }; /** * Clears the list making it empty but non-null. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.clearDocumentsList = function() { - return this.setDocumentsList([]); +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.clearIdentitiesList = function() { + return this.setIdentitiesList([]); }; @@ -3032,7 +8516,7 @@ proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.clearDocumentsLis * optional Proof proof = 2; * @return {?proto.org.dash.platform.dapi.v0.Proof} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.getProof = function() { +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.getProof = function() { return /** @type{?proto.org.dash.platform.dapi.v0.Proof} */ ( jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.Proof, 2)); }; @@ -3040,18 +8524,18 @@ proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.getProof = functi /** * @param {?proto.org.dash.platform.dapi.v0.Proof|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.setProof = function(value) { +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.setProof = function(value) { return jspb.Message.setWrapperField(this, 2, value); }; /** * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.clearProof = function() { +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.clearProof = function() { return this.setProof(undefined); }; @@ -3060,7 +8544,7 @@ proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.clearProof = func * Returns whether this field is set. * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.hasProof = function() { +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.hasProof = function() { return jspb.Message.getField(this, 2) != null; }; @@ -3069,7 +8553,7 @@ proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.hasProof = functi * optional ResponseMetadata metadata = 3; * @return {?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.getMetadata = function() { +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.getMetadata = function() { return /** @type{?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ ( jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.ResponseMetadata, 3)); }; @@ -3077,18 +8561,18 @@ proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.getMetadata = fun /** * @param {?proto.org.dash.platform.dapi.v0.ResponseMetadata|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.setMetadata = function(value) { +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.setMetadata = function(value) { return jspb.Message.setWrapperField(this, 3, value); }; /** * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetDocumentsResponse} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.clearMetadata = function() { +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.clearMetadata = function() { return this.setMetadata(undefined); }; @@ -3097,19 +8581,12 @@ proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.clearMetadata = f * Returns whether this field is set. * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetDocumentsResponse.prototype.hasMetadata = function() { +proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.hasMetadata = function() { return jspb.Message.getField(this, 3) != null; }; -/** - * List of repeated fields within this message type. - * @private {!Array} - * @const - */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.repeatedFields_ = [1]; - if (jspb.Message.GENERATE_TO_OBJECT) { @@ -3125,8 +8602,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.toObject(opt_includeInstance, this); +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest.toObject(opt_includeInstance, this); }; @@ -3135,13 +8612,13 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.prototype. * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest} msg The msg instance to transform. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.toObject = function(includeInstance, msg) { +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest.toObject = function(includeInstance, msg) { var f, obj = { - publicKeyHashesList: msg.getPublicKeyHashesList_asB64(), + publicKeyHash: msg.getPublicKeyHash_asB64(), prove: jspb.Message.getBooleanFieldWithDefault(msg, 2, false) }; @@ -3156,23 +8633,23 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.toObject = /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest} + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest} */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.deserializeBinary = function(bytes) { +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest; - return proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.deserializeBinaryFromReader(msg, reader); + var msg = new proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest; + return proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest} msg The message object to deserialize into. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest} + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest} */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.deserializeBinaryFromReader = function(msg, reader) { +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -3181,7 +8658,7 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.deserializ switch (field) { case 1: var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.addPublicKeyHashes(value); + msg.setPublicKeyHash(value); break; case 2: var value = /** @type {boolean} */ (reader.readBool()); @@ -3200,9 +8677,9 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.deserializ * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.prototype.serializeBinary = function() { +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.serializeBinaryToWriter(this, writer); + proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -3210,15 +8687,15 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.prototype. /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest} message + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.serializeBinaryToWriter = function(message, writer) { +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getPublicKeyHashesList_asU8(); + f = message.getPublicKeyHash_asU8(); if (f.length > 0) { - writer.writeRepeatedBytes( + writer.writeBytes( 1, f ); @@ -3234,63 +8711,44 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.serializeB /** - * repeated bytes public_key_hashes = 1; - * @return {!Array} + * optional bytes public_key_hash = 1; + * @return {string} */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.prototype.getPublicKeyHashesList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest.prototype.getPublicKeyHash = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** - * repeated bytes public_key_hashes = 1; - * This is a type-conversion wrapper around `getPublicKeyHashesList()` - * @return {!Array} + * optional bytes public_key_hash = 1; + * This is a type-conversion wrapper around `getPublicKeyHash()` + * @return {string} */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.prototype.getPublicKeyHashesList_asB64 = function() { - return /** @type {!Array} */ (jspb.Message.bytesListAsB64( - this.getPublicKeyHashesList())); +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest.prototype.getPublicKeyHash_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getPublicKeyHash())); }; /** - * repeated bytes public_key_hashes = 1; + * optional bytes public_key_hash = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getPublicKeyHashesList()` - * @return {!Array} - */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.prototype.getPublicKeyHashesList_asU8 = function() { - return /** @type {!Array} */ (jspb.Message.bytesListAsU8( - this.getPublicKeyHashesList())); -}; - - -/** - * @param {!(Array|Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest} returns this + * This is a type-conversion wrapper around `getPublicKeyHash()` + * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.prototype.setPublicKeyHashesList = function(value) { - return jspb.Message.setField(this, 1, value || []); +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest.prototype.getPublicKeyHash_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getPublicKeyHash())); }; /** * @param {!(string|Uint8Array)} value - * @param {number=} opt_index - * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest} returns this - */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.prototype.addPublicKeyHashes = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 1, value, opt_index); -}; - - -/** - * Clears the list making it empty but non-null. - * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest} returns this */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.prototype.clearPublicKeyHashesList = function() { - return this.setPublicKeyHashesList([]); +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest.prototype.setPublicKeyHash = function(value) { + return jspb.Message.setProto3BytesField(this, 1, value); }; @@ -3298,27 +8756,46 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.prototype. * optional bool prove = 2; * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.prototype.getProve = function() { +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest.prototype.getProve = function() { return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 2, false)); }; /** * @param {boolean} value - * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest} returns this */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesRequest.prototype.setProve = function(value) { +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesRequest.prototype.setProve = function(value) { return jspb.Message.setProto3BooleanField(this, 2, value); }; /** - * List of repeated fields within this message type. - * @private {!Array} + * Oneof group definitions for this message. Each group defines the field + * numbers belonging to that group. When of these fields' value is set, all + * other fields in the group are cleared. During deserialization, if multiple + * fields are encountered for a group, only the last value seen will be kept. + * @private {!Array>} * @const */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.repeatedFields_ = [1]; +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.oneofGroups_ = [[1,2]]; + +/** + * @enum {number} + */ +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.ResultCase = { + RESULT_NOT_SET: 0, + IDENTITY: 1, + PROOF: 2 +}; + +/** + * @return {proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.ResultCase} + */ +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.prototype.getResultCase = function() { + return /** @type {proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.ResultCase} */(jspb.Message.computeOneofCase(this, proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.oneofGroups_[0])); +}; @@ -3335,8 +8812,8 @@ if (jspb.Message.GENERATE_TO_OBJECT) { * http://goto/soy-param-migration * @return {!Object} */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.toObject = function(opt_includeInstance) { - return proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.toObject(opt_includeInstance, this); +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.prototype.toObject = function(opt_includeInstance) { + return proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.toObject(opt_includeInstance, this); }; @@ -3345,13 +8822,13 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype * @param {boolean|undefined} includeInstance Deprecated. Whether to include * the JSPB instance for transitional soy proto support: * http://goto/soy-param-migration - * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} msg The msg instance to transform. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse} msg The msg instance to transform. * @return {!Object} * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.toObject = function(includeInstance, msg) { +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.toObject = function(includeInstance, msg) { var f, obj = { - identitiesList: msg.getIdentitiesList_asB64(), + identity: msg.getIdentity_asB64(), proof: (f = msg.getProof()) && proto.org.dash.platform.dapi.v0.Proof.toObject(includeInstance, f), metadata: (f = msg.getMetadata()) && proto.org.dash.platform.dapi.v0.ResponseMetadata.toObject(includeInstance, f) }; @@ -3367,23 +8844,23 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.toObject /** * Deserializes binary data (in protobuf wire format). * @param {jspb.ByteSource} bytes The bytes to deserialize. - * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse} */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.deserializeBinary = function(bytes) { +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.deserializeBinary = function(bytes) { var reader = new jspb.BinaryReader(bytes); - var msg = new proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse; - return proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.deserializeBinaryFromReader(msg, reader); + var msg = new proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse; + return proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.deserializeBinaryFromReader(msg, reader); }; /** * Deserializes binary data (in protobuf wire format) from the * given reader into the given message object. - * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} msg The message object to deserialize into. + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse} msg The message object to deserialize into. * @param {!jspb.BinaryReader} reader The BinaryReader to use. - * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse} */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.deserializeBinaryFromReader = function(msg, reader) { +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.deserializeBinaryFromReader = function(msg, reader) { while (reader.nextField()) { if (reader.isEndGroup()) { break; @@ -3392,7 +8869,7 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.deseriali switch (field) { case 1: var value = /** @type {!Uint8Array} */ (reader.readBytes()); - msg.addIdentities(value); + msg.setIdentity(value); break; case 2: var value = new proto.org.dash.platform.dapi.v0.Proof; @@ -3417,9 +8894,9 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.deseriali * Serializes the message to binary data (in protobuf wire format). * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.serializeBinary = function() { +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.prototype.serializeBinary = function() { var writer = new jspb.BinaryWriter(); - proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.serializeBinaryToWriter(this, writer); + proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.serializeBinaryToWriter(this, writer); return writer.getResultBuffer(); }; @@ -3427,15 +8904,15 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype /** * Serializes the given message to binary data (in protobuf wire * format), writing to the given BinaryWriter. - * @param {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} message + * @param {!proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse} message * @param {!jspb.BinaryWriter} writer * @suppress {unusedLocalVariables} f is only used for nested messages */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.serializeBinaryToWriter = function(message, writer) { +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.serializeBinaryToWriter = function(message, writer) { var f = undefined; - f = message.getIdentitiesList_asU8(); - if (f.length > 0) { - writer.writeRepeatedBytes( + f = /** @type {!(string|Uint8Array)} */ (jspb.Message.getField(message, 1)); + if (f != null) { + writer.writeBytes( 1, f ); @@ -3460,63 +8937,62 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.serialize /** - * repeated bytes identities = 1; - * @return {!Array} + * optional bytes identity = 1; + * @return {string} */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.getIdentitiesList = function() { - return /** @type {!Array} */ (jspb.Message.getRepeatedField(this, 1)); +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.prototype.getIdentity = function() { + return /** @type {string} */ (jspb.Message.getFieldWithDefault(this, 1, "")); }; /** - * repeated bytes identities = 1; - * This is a type-conversion wrapper around `getIdentitiesList()` - * @return {!Array} + * optional bytes identity = 1; + * This is a type-conversion wrapper around `getIdentity()` + * @return {string} */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.getIdentitiesList_asB64 = function() { - return /** @type {!Array} */ (jspb.Message.bytesListAsB64( - this.getIdentitiesList())); +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.prototype.getIdentity_asB64 = function() { + return /** @type {string} */ (jspb.Message.bytesAsB64( + this.getIdentity())); }; /** - * repeated bytes identities = 1; + * optional bytes identity = 1; * Note that Uint8Array is not supported on all browsers. * @see http://caniuse.com/Uint8Array - * This is a type-conversion wrapper around `getIdentitiesList()` - * @return {!Array} + * This is a type-conversion wrapper around `getIdentity()` + * @return {!Uint8Array} */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.getIdentitiesList_asU8 = function() { - return /** @type {!Array} */ (jspb.Message.bytesListAsU8( - this.getIdentitiesList())); +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.prototype.getIdentity_asU8 = function() { + return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8( + this.getIdentity())); }; /** - * @param {!(Array|Array)} value - * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} returns this + * @param {!(string|Uint8Array)} value + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.setIdentitiesList = function(value) { - return jspb.Message.setField(this, 1, value || []); +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.prototype.setIdentity = function(value) { + return jspb.Message.setOneofField(this, 1, proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.oneofGroups_[0], value); }; /** - * @param {!(string|Uint8Array)} value - * @param {number=} opt_index - * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} returns this + * Clears the field making it undefined. + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.addIdentities = function(value, opt_index) { - return jspb.Message.addToRepeatedField(this, 1, value, opt_index); +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.prototype.clearIdentity = function() { + return jspb.Message.setOneofField(this, 1, proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.oneofGroups_[0], undefined); }; /** - * Clears the list making it empty but non-null. - * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} returns this + * Returns whether this field is set. + * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.clearIdentitiesList = function() { - return this.setIdentitiesList([]); +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.prototype.hasIdentity = function() { + return jspb.Message.getField(this, 1) != null; }; @@ -3524,7 +9000,7 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype * optional Proof proof = 2; * @return {?proto.org.dash.platform.dapi.v0.Proof} */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.getProof = function() { +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.prototype.getProof = function() { return /** @type{?proto.org.dash.platform.dapi.v0.Proof} */ ( jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.Proof, 2)); }; @@ -3532,18 +9008,18 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype /** * @param {?proto.org.dash.platform.dapi.v0.Proof|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.setProof = function(value) { - return jspb.Message.setWrapperField(this, 2, value); +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.prototype.setProof = function(value) { + return jspb.Message.setOneofWrapperField(this, 2, proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.oneofGroups_[0], value); }; /** * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.clearProof = function() { +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.prototype.clearProof = function() { return this.setProof(undefined); }; @@ -3552,7 +9028,7 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype * Returns whether this field is set. * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.hasProof = function() { +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.prototype.hasProof = function() { return jspb.Message.getField(this, 2) != null; }; @@ -3561,7 +9037,7 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype * optional ResponseMetadata metadata = 3; * @return {?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.getMetadata = function() { +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.prototype.getMetadata = function() { return /** @type{?proto.org.dash.platform.dapi.v0.ResponseMetadata} */ ( jspb.Message.getWrapperField(this, proto.org.dash.platform.dapi.v0.ResponseMetadata, 3)); }; @@ -3569,18 +9045,18 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype /** * @param {?proto.org.dash.platform.dapi.v0.ResponseMetadata|undefined} value - * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.setMetadata = function(value) { +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.prototype.setMetadata = function(value) { return jspb.Message.setWrapperField(this, 3, value); }; /** * Clears the message field making it undefined. - * @return {!proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse} returns this + * @return {!proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse} returns this */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.clearMetadata = function() { +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.prototype.clearMetadata = function() { return this.setMetadata(undefined); }; @@ -3589,7 +9065,7 @@ proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype * Returns whether this field is set. * @return {boolean} */ -proto.org.dash.platform.dapi.v0.GetIdentitiesByPublicKeyHashesResponse.prototype.hasMetadata = function() { +proto.org.dash.platform.dapi.v0.GetIdentityByPublicKeyHashesResponse.prototype.hasMetadata = function() { return jspb.Message.getField(this, 3) != null; }; diff --git a/packages/dapi-grpc/clients/platform/v0/web/platform_pb_service.d.ts b/packages/dapi-grpc/clients/platform/v0/web/platform_pb_service.d.ts index 6998a7dbdb..2f38edfc3b 100644 --- a/packages/dapi-grpc/clients/platform/v0/web/platform_pb_service.d.ts +++ b/packages/dapi-grpc/clients/platform/v0/web/platform_pb_service.d.ts @@ -22,6 +22,33 @@ type PlatformgetIdentity = { readonly responseType: typeof platform_pb.GetIdentityResponse; }; +type PlatformgetIdentityKeys = { + readonly methodName: string; + readonly service: typeof Platform; + readonly requestStream: false; + readonly responseStream: false; + readonly requestType: typeof platform_pb.GetIdentityKeysRequest; + readonly responseType: typeof platform_pb.GetIdentityKeysResponse; +}; + +type PlatformgetIdentityBalance = { + readonly methodName: string; + readonly service: typeof Platform; + readonly requestStream: false; + readonly responseStream: false; + readonly requestType: typeof platform_pb.GetIdentityRequest; + readonly responseType: typeof platform_pb.GetIdentityBalanceResponse; +}; + +type PlatformgetIdentityBalanceAndRevision = { + readonly methodName: string; + readonly service: typeof Platform; + readonly requestStream: false; + readonly responseStream: false; + readonly requestType: typeof platform_pb.GetIdentityRequest; + readonly responseType: typeof platform_pb.GetIdentityBalanceAndRevisionResponse; +}; + type PlatformgetDataContract = { readonly methodName: string; readonly service: typeof Platform; @@ -31,6 +58,15 @@ type PlatformgetDataContract = { readonly responseType: typeof platform_pb.GetDataContractResponse; }; +type PlatformgetDataContracts = { + readonly methodName: string; + readonly service: typeof Platform; + readonly requestStream: false; + readonly responseStream: false; + readonly requestType: typeof platform_pb.GetDataContractsRequest; + readonly responseType: typeof platform_pb.GetDataContractsResponse; +}; + type PlatformgetDocuments = { readonly methodName: string; readonly service: typeof Platform; @@ -49,6 +85,15 @@ type PlatformgetIdentitiesByPublicKeyHashes = { readonly responseType: typeof platform_pb.GetIdentitiesByPublicKeyHashesResponse; }; +type PlatformgetIdentityByPublicKeyHashes = { + readonly methodName: string; + readonly service: typeof Platform; + readonly requestStream: false; + readonly responseStream: false; + readonly requestType: typeof platform_pb.GetIdentityByPublicKeyHashesRequest; + readonly responseType: typeof platform_pb.GetIdentityByPublicKeyHashesResponse; +}; + type PlatformwaitForStateTransitionResult = { readonly methodName: string; readonly service: typeof Platform; @@ -71,9 +116,14 @@ export class Platform { static readonly serviceName: string; static readonly broadcastStateTransition: PlatformbroadcastStateTransition; static readonly getIdentity: PlatformgetIdentity; + static readonly getIdentityKeys: PlatformgetIdentityKeys; + static readonly getIdentityBalance: PlatformgetIdentityBalance; + static readonly getIdentityBalanceAndRevision: PlatformgetIdentityBalanceAndRevision; static readonly getDataContract: PlatformgetDataContract; + static readonly getDataContracts: PlatformgetDataContracts; static readonly getDocuments: PlatformgetDocuments; static readonly getIdentitiesByPublicKeyHashes: PlatformgetIdentitiesByPublicKeyHashes; + static readonly getIdentityByPublicKeyHashes: PlatformgetIdentityByPublicKeyHashes; static readonly waitForStateTransitionResult: PlatformwaitForStateTransitionResult; static readonly getConsensusParams: PlatformgetConsensusParams; } @@ -128,6 +178,33 @@ export class PlatformClient { requestMessage: platform_pb.GetIdentityRequest, callback: (error: ServiceError|null, responseMessage: platform_pb.GetIdentityResponse|null) => void ): UnaryResponse; + getIdentityKeys( + requestMessage: platform_pb.GetIdentityKeysRequest, + metadata: grpc.Metadata, + callback: (error: ServiceError|null, responseMessage: platform_pb.GetIdentityKeysResponse|null) => void + ): UnaryResponse; + getIdentityKeys( + requestMessage: platform_pb.GetIdentityKeysRequest, + callback: (error: ServiceError|null, responseMessage: platform_pb.GetIdentityKeysResponse|null) => void + ): UnaryResponse; + getIdentityBalance( + requestMessage: platform_pb.GetIdentityRequest, + metadata: grpc.Metadata, + callback: (error: ServiceError|null, responseMessage: platform_pb.GetIdentityBalanceResponse|null) => void + ): UnaryResponse; + getIdentityBalance( + requestMessage: platform_pb.GetIdentityRequest, + callback: (error: ServiceError|null, responseMessage: platform_pb.GetIdentityBalanceResponse|null) => void + ): UnaryResponse; + getIdentityBalanceAndRevision( + requestMessage: platform_pb.GetIdentityRequest, + metadata: grpc.Metadata, + callback: (error: ServiceError|null, responseMessage: platform_pb.GetIdentityBalanceAndRevisionResponse|null) => void + ): UnaryResponse; + getIdentityBalanceAndRevision( + requestMessage: platform_pb.GetIdentityRequest, + callback: (error: ServiceError|null, responseMessage: platform_pb.GetIdentityBalanceAndRevisionResponse|null) => void + ): UnaryResponse; getDataContract( requestMessage: platform_pb.GetDataContractRequest, metadata: grpc.Metadata, @@ -137,6 +214,15 @@ export class PlatformClient { requestMessage: platform_pb.GetDataContractRequest, callback: (error: ServiceError|null, responseMessage: platform_pb.GetDataContractResponse|null) => void ): UnaryResponse; + getDataContracts( + requestMessage: platform_pb.GetDataContractsRequest, + metadata: grpc.Metadata, + callback: (error: ServiceError|null, responseMessage: platform_pb.GetDataContractsResponse|null) => void + ): UnaryResponse; + getDataContracts( + requestMessage: platform_pb.GetDataContractsRequest, + callback: (error: ServiceError|null, responseMessage: platform_pb.GetDataContractsResponse|null) => void + ): UnaryResponse; getDocuments( requestMessage: platform_pb.GetDocumentsRequest, metadata: grpc.Metadata, @@ -155,6 +241,15 @@ export class PlatformClient { requestMessage: platform_pb.GetIdentitiesByPublicKeyHashesRequest, callback: (error: ServiceError|null, responseMessage: platform_pb.GetIdentitiesByPublicKeyHashesResponse|null) => void ): UnaryResponse; + getIdentityByPublicKeyHashes( + requestMessage: platform_pb.GetIdentityByPublicKeyHashesRequest, + metadata: grpc.Metadata, + callback: (error: ServiceError|null, responseMessage: platform_pb.GetIdentityByPublicKeyHashesResponse|null) => void + ): UnaryResponse; + getIdentityByPublicKeyHashes( + requestMessage: platform_pb.GetIdentityByPublicKeyHashesRequest, + callback: (error: ServiceError|null, responseMessage: platform_pb.GetIdentityByPublicKeyHashesResponse|null) => void + ): UnaryResponse; waitForStateTransitionResult( requestMessage: platform_pb.WaitForStateTransitionResultRequest, metadata: grpc.Metadata, diff --git a/packages/dapi-grpc/clients/platform/v0/web/platform_pb_service.js b/packages/dapi-grpc/clients/platform/v0/web/platform_pb_service.js index 896bc82397..feb2dff9a0 100644 --- a/packages/dapi-grpc/clients/platform/v0/web/platform_pb_service.js +++ b/packages/dapi-grpc/clients/platform/v0/web/platform_pb_service.js @@ -28,6 +28,33 @@ Platform.getIdentity = { responseType: platform_pb.GetIdentityResponse }; +Platform.getIdentityKeys = { + methodName: "getIdentityKeys", + service: Platform, + requestStream: false, + responseStream: false, + requestType: platform_pb.GetIdentityKeysRequest, + responseType: platform_pb.GetIdentityKeysResponse +}; + +Platform.getIdentityBalance = { + methodName: "getIdentityBalance", + service: Platform, + requestStream: false, + responseStream: false, + requestType: platform_pb.GetIdentityRequest, + responseType: platform_pb.GetIdentityBalanceResponse +}; + +Platform.getIdentityBalanceAndRevision = { + methodName: "getIdentityBalanceAndRevision", + service: Platform, + requestStream: false, + responseStream: false, + requestType: platform_pb.GetIdentityRequest, + responseType: platform_pb.GetIdentityBalanceAndRevisionResponse +}; + Platform.getDataContract = { methodName: "getDataContract", service: Platform, @@ -37,6 +64,15 @@ Platform.getDataContract = { responseType: platform_pb.GetDataContractResponse }; +Platform.getDataContracts = { + methodName: "getDataContracts", + service: Platform, + requestStream: false, + responseStream: false, + requestType: platform_pb.GetDataContractsRequest, + responseType: platform_pb.GetDataContractsResponse +}; + Platform.getDocuments = { methodName: "getDocuments", service: Platform, @@ -55,6 +91,15 @@ Platform.getIdentitiesByPublicKeyHashes = { responseType: platform_pb.GetIdentitiesByPublicKeyHashesResponse }; +Platform.getIdentityByPublicKeyHashes = { + methodName: "getIdentityByPublicKeyHashes", + service: Platform, + requestStream: false, + responseStream: false, + requestType: platform_pb.GetIdentityByPublicKeyHashesRequest, + responseType: platform_pb.GetIdentityByPublicKeyHashesResponse +}; + Platform.waitForStateTransitionResult = { methodName: "waitForStateTransitionResult", service: Platform, @@ -142,6 +187,99 @@ PlatformClient.prototype.getIdentity = function getIdentity(requestMessage, meta }; }; +PlatformClient.prototype.getIdentityKeys = function getIdentityKeys(requestMessage, metadata, callback) { + if (arguments.length === 2) { + callback = arguments[1]; + } + var client = grpc.unary(Platform.getIdentityKeys, { + request: requestMessage, + host: this.serviceHost, + metadata: metadata, + transport: this.options.transport, + debug: this.options.debug, + onEnd: function (response) { + if (callback) { + if (response.status !== grpc.Code.OK) { + var err = new Error(response.statusMessage); + err.code = response.status; + err.metadata = response.trailers; + callback(err, null); + } else { + callback(null, response.message); + } + } + } + }); + return { + cancel: function () { + callback = null; + client.close(); + } + }; +}; + +PlatformClient.prototype.getIdentityBalance = function getIdentityBalance(requestMessage, metadata, callback) { + if (arguments.length === 2) { + callback = arguments[1]; + } + var client = grpc.unary(Platform.getIdentityBalance, { + request: requestMessage, + host: this.serviceHost, + metadata: metadata, + transport: this.options.transport, + debug: this.options.debug, + onEnd: function (response) { + if (callback) { + if (response.status !== grpc.Code.OK) { + var err = new Error(response.statusMessage); + err.code = response.status; + err.metadata = response.trailers; + callback(err, null); + } else { + callback(null, response.message); + } + } + } + }); + return { + cancel: function () { + callback = null; + client.close(); + } + }; +}; + +PlatformClient.prototype.getIdentityBalanceAndRevision = function getIdentityBalanceAndRevision(requestMessage, metadata, callback) { + if (arguments.length === 2) { + callback = arguments[1]; + } + var client = grpc.unary(Platform.getIdentityBalanceAndRevision, { + request: requestMessage, + host: this.serviceHost, + metadata: metadata, + transport: this.options.transport, + debug: this.options.debug, + onEnd: function (response) { + if (callback) { + if (response.status !== grpc.Code.OK) { + var err = new Error(response.statusMessage); + err.code = response.status; + err.metadata = response.trailers; + callback(err, null); + } else { + callback(null, response.message); + } + } + } + }); + return { + cancel: function () { + callback = null; + client.close(); + } + }; +}; + PlatformClient.prototype.getDataContract = function getDataContract(requestMessage, metadata, callback) { if (arguments.length === 2) { callback = arguments[1]; @@ -173,6 +311,37 @@ PlatformClient.prototype.getDataContract = function getDataContract(requestMessa }; }; +PlatformClient.prototype.getDataContracts = function getDataContracts(requestMessage, metadata, callback) { + if (arguments.length === 2) { + callback = arguments[1]; + } + var client = grpc.unary(Platform.getDataContracts, { + request: requestMessage, + host: this.serviceHost, + metadata: metadata, + transport: this.options.transport, + debug: this.options.debug, + onEnd: function (response) { + if (callback) { + if (response.status !== grpc.Code.OK) { + var err = new Error(response.statusMessage); + err.code = response.status; + err.metadata = response.trailers; + callback(err, null); + } else { + callback(null, response.message); + } + } + } + }); + return { + cancel: function () { + callback = null; + client.close(); + } + }; +}; + PlatformClient.prototype.getDocuments = function getDocuments(requestMessage, metadata, callback) { if (arguments.length === 2) { callback = arguments[1]; @@ -235,6 +404,37 @@ PlatformClient.prototype.getIdentitiesByPublicKeyHashes = function getIdentities }; }; +PlatformClient.prototype.getIdentityByPublicKeyHashes = function getIdentityByPublicKeyHashes(requestMessage, metadata, callback) { + if (arguments.length === 2) { + callback = arguments[1]; + } + var client = grpc.unary(Platform.getIdentityByPublicKeyHashes, { + request: requestMessage, + host: this.serviceHost, + metadata: metadata, + transport: this.options.transport, + debug: this.options.debug, + onEnd: function (response) { + if (callback) { + if (response.status !== grpc.Code.OK) { + var err = new Error(response.statusMessage); + err.code = response.status; + err.metadata = response.trailers; + callback(err, null); + } else { + callback(null, response.message); + } + } + } + }); + return { + cancel: function () { + callback = null; + client.close(); + } + }; +}; + PlatformClient.prototype.waitForStateTransitionResult = function waitForStateTransitionResult(requestMessage, metadata, callback) { if (arguments.length === 2) { callback = arguments[1]; diff --git a/packages/dapi-grpc/protos/platform/v0/platform.proto b/packages/dapi-grpc/protos/platform/v0/platform.proto index 51f4b49abc..556aa5f3cb 100644 --- a/packages/dapi-grpc/protos/platform/v0/platform.proto +++ b/packages/dapi-grpc/protos/platform/v0/platform.proto @@ -1,4 +1,6 @@ syntax = "proto3"; +import "google/protobuf/wrappers.proto"; +import "google/protobuf/struct.proto"; package org.dash.platform.dapi.v0; @@ -7,22 +9,29 @@ import "google/protobuf/timestamp.proto"; service Platform { rpc broadcastStateTransition (BroadcastStateTransitionRequest) returns (BroadcastStateTransitionResponse); rpc getIdentity (GetIdentityRequest) returns (GetIdentityResponse); + rpc getIdentityKeys (GetIdentityKeysRequest) returns (GetIdentityKeysResponse); +// rpc getIdentitiesKeys (GetIdentitiesKeysRequest) returns (GetIdentitiesKeysResponse); + rpc getIdentityBalance(GetIdentityRequest) returns (GetIdentityBalanceResponse); + rpc getIdentityBalanceAndRevision(GetIdentityRequest) + returns (GetIdentityBalanceAndRevisionResponse); rpc getDataContract (GetDataContractRequest) returns (GetDataContractResponse); + rpc getDataContracts (GetDataContractsRequest) returns (GetDataContractsResponse); rpc getDocuments (GetDocumentsRequest) returns (GetDocumentsResponse); rpc getIdentitiesByPublicKeyHashes (GetIdentitiesByPublicKeyHashesRequest) returns (GetIdentitiesByPublicKeyHashesResponse); + rpc getIdentityByPublicKeyHashes (GetIdentityByPublicKeyHashesRequest) returns (GetIdentityByPublicKeyHashesResponse); rpc waitForStateTransitionResult (WaitForStateTransitionResultRequest) returns (WaitForStateTransitionResultResponse); rpc getConsensusParams (GetConsensusParamsRequest) returns (GetConsensusParamsResponse); } message Proof { - bytes merkle_proof = 1; + bytes grovedb_proof = 1; bytes quorum_hash = 2; bytes signature = 3; uint32 round = 4; } message ResponseMetadata { - int64 height = 1; + uint64 height = 1; uint32 core_chain_locked_height = 2; uint64 time_ms = 3; uint32 protocol_version = 4; @@ -53,7 +62,104 @@ message GetIdentityResponse { ResponseMetadata metadata = 3; } - message GetDataContractRequest { +message GetIdentityBalanceResponse { + google.protobuf.UInt64Value balance = 1; + Proof proof = 2; + ResponseMetadata metadata = 3; +} + +message GetIdentityBalanceAndRevisionResponse { + google.protobuf.UInt64Value balance = 1; + google.protobuf.UInt64Value revision = 2; + Proof proof = 3; + ResponseMetadata metadata = 4; +} + +message KeyRequestType { + oneof request { + AllKeys all_keys = 1; + SpecificKeys specific_keys = 2; + SearchKey search_key = 3; + } +} + +message AllKeys { +} + +message SpecificKeys { + repeated uint32 key_ids = 1; +} + +message SearchKey { + map purpose_map = 1; +} + +message SecurityLevelMap { + enum KeyKindRequestType { + CURRENT_KEY_OF_KIND_REQUEST = 0; + ALL_KEYS_OF_KIND_REQUEST = 1; + } + map security_level_map = 1; +} + +message GetIdentityKeysRequest { + bytes identity_id = 1; + KeyRequestType request_type = 2; + google.protobuf.UInt32Value limit = 3; + google.protobuf.UInt32Value offset = 4; + bool prove = 5; +} + +message GetIdentityKeysResponse { + message Keys { + repeated bytes keys_bytes = 1; + } + oneof result { + Keys keys = 1; + Proof proof = 2; + } + ResponseMetadata metadata = 3; +} + + +message GetIdentitiesKeysRequest { + repeated bytes identity_ids = 1; + KeyRequestType request_type = 2; + google.protobuf.UInt32Value limit = 3; + google.protobuf.UInt32Value offset = 4; + bool prove = 5; + + message SecurityLevelMap { + enum KeyKindRequestType { + CURRENT_KEY_OF_KIND_REQUEST = 0; + } + map security_level_map = 1; + } +} + +message GetIdentitiesKeysResponse { + message PublicKey { + bytes value = 1; + } + + message PublicKeyEntry { + bytes key = 1; + PublicKey value = 2; + } + + message PublicKeyEntries { + repeated PublicKeyEntry public_key_entries = 1; + } + + oneof result { + PublicKeyEntries public_keys = 1; + Proof proof = 2; + } + ResponseMetadata metadata = 3; +} + + +message GetDataContractRequest { bytes id = 1; bool prove = 2; } @@ -64,6 +170,31 @@ message GetDataContractResponse { ResponseMetadata metadata = 3; } +message GetDataContractsRequest { + repeated bytes ids = 1; + bool prove = 2; +} + +message GetDataContractsResponse { + message DataContractValue { + bytes value = 1; + } + + message DataContractEntry { + bytes key = 1; + DataContractValue value = 2; + } + + message DataContracts { + repeated DataContractEntry data_contract_entries = 1; + } + + oneof result { + DataContracts data_contracts = 1; + Proof proof = 2; + } + ResponseMetadata metadata = 3; +} message GetDocumentsRequest { bytes data_contract_id = 1; string document_type = 2; @@ -73,10 +204,10 @@ message GetDocumentsRequest { uint32 limit = 5; - oneof start { - bytes start_after = 6; - bytes start_at = 7; - } + oneof start { + bytes start_after = 6; + bytes start_at = 7; + } bool prove = 8; } @@ -98,6 +229,19 @@ message GetIdentitiesByPublicKeyHashesResponse { ResponseMetadata metadata = 3; } +message GetIdentityByPublicKeyHashesRequest { + bytes public_key_hash = 1; + bool prove = 2; +} + +message GetIdentityByPublicKeyHashesResponse { + oneof result { + bytes identity = 1; + Proof proof = 2; + } + ResponseMetadata metadata = 3; +} + message WaitForStateTransitionResultRequest { bytes state_transition_hash = 1; bool prove = 2; diff --git a/packages/rs-dpp/src/block/block_info.rs b/packages/rs-dpp/src/block/block_info.rs index 0203190f3b..607ae26939 100644 --- a/packages/rs-dpp/src/block/block_info.rs +++ b/packages/rs-dpp/src/block/block_info.rs @@ -3,8 +3,24 @@ use crate::serialization_traits::{PlatformDeserializable, PlatformSerializable}; use crate::ProtocolError; use bincode::config; use bincode::{Decode, Encode}; + use platform_serialization::{PlatformDeserialize, PlatformSerialize}; +/// Extended Block information +#[derive(Clone, Encode, Decode, PlatformSerialize, PlatformDeserialize)] +#[platform_error_type(ProtocolError)] +#[platform_deserialize_limit(15000)] +pub struct ExtendedBlockInfo { + /// Basic block info + pub basic_info: BlockInfo, + /// Signature + pub quorum_hash: [u8; 32], + /// Signature + pub signature: [u8; 96], + /// Round + pub round: u32, +} + /// Block information #[derive(Clone, Default, Encode, Decode, PlatformSerialize, PlatformDeserialize)] #[platform_error_type(ProtocolError)] diff --git a/packages/rs-dpp/src/identity/core_script.rs b/packages/rs-dpp/src/identity/core_script.rs index a4efe241b3..49afdf51ac 100644 --- a/packages/rs-dpp/src/identity/core_script.rs +++ b/packages/rs-dpp/src/identity/core_script.rs @@ -4,7 +4,6 @@ use bincode::error::{DecodeError, EncodeError}; use bincode::{BorrowDecode, Decode, Encode}; use dashcore::blockdata::opcodes; use std::fmt; -use std::io::{Read, Write}; use std::ops::Deref; use dashcore::{Script as DashcoreScript, Script}; diff --git a/packages/rs-dpp/src/validation/validation_result.rs b/packages/rs-dpp/src/validation/validation_result.rs index 97907193a0..ac047d6ccf 100644 --- a/packages/rs-dpp/src/validation/validation_result.rs +++ b/packages/rs-dpp/src/validation/validation_result.rs @@ -2,6 +2,16 @@ use crate::errors::consensus::ConsensusError; use crate::ProtocolError; use std::fmt::Debug; +#[macro_export] +macro_rules! check_validation_result_with_data { + ($result:expr) => { + match $result { + Ok(result) => result, + Err(e) => return Ok(ValidationResult::new_with_errors(vec![e.into()])), + } + }; +} + pub type SimpleConsensusValidationResult = ConsensusValidationResult<()>; pub type SimpleValidationResult = ValidationResult<(), E>; @@ -232,11 +242,11 @@ impl From for ValidationResult { } } -impl From> for ValidationResult { - fn from(value: Result) -> Self { +impl> From> for ValidationResult { + fn from(value: Result) -> Self { match value { Ok(data) => ValidationResult::new_with_data(data), - Err(e) => ValidationResult::new_with_errors(vec![e]), + Err(e) => ValidationResult::new_with_errors(vec![e.into()]), } } } diff --git a/packages/rs-drive-abci/Cargo.toml b/packages/rs-drive-abci/Cargo.toml index 4e6340b89c..89a273f3d7 100644 --- a/packages/rs-drive-abci/Cargo.toml +++ b/packages/rs-drive-abci/Cargo.toml @@ -39,6 +39,7 @@ tracing = { version = "0.1.37", default-features = false, features = [] } clap = { version = "4.1.8", optional = true, features = ["derive"] } envy = { version = "0.4.2" } dotenvy = { version = "0.15.6", optional = true } +dapi-grpc = { path = "../dapi-grpc" } tracing-subscriber = { version = "0.3.16", default-features = false, features = [ "env-filter", "ansi", diff --git a/packages/rs-drive-abci/src/abci/handlers.rs b/packages/rs-drive-abci/src/abci/handlers.rs index c69dae55fe..2755e1ce78 100644 --- a/packages/rs-drive-abci/src/abci/handlers.rs +++ b/packages/rs-drive-abci/src/abci/handlers.rs @@ -508,44 +508,30 @@ where fn query(&self, request: RequestQuery) -> Result { let RequestQuery { - data, - path, - height, - prove, + data, path, prove, .. } = request; - match self.platform.drive.query_serialized(data, path, prove) { - Ok(data) => { - Ok(ResponseQuery { - //todo: right now just put GRPC error codes, - // later we will use own error codes - code: 0, - log: "".to_string(), - info: "".to_string(), - index: 0, - key: vec![], - value: data, - proof_ops: None, - height, - codespace: "".to_string(), - }) - } - Err(error) => { - Ok(ResponseQuery { - //todo: right now just put GRPC error codes, - // later we will use own error codes - code: 1, - log: "".to_string(), - info: "".to_string(), - index: 0, - key: vec![], - value: vec![], - proof_ops: None, - height, - codespace: "".to_string(), - }) - } - } + let result = self.platform.query(path.as_str(), data.as_slice(), prove)?; + + let (code, data) = if result.is_valid() { + (0, result.data.unwrap_or_default()) + } else { + (1, vec![]) + }; + + Ok(ResponseQuery { + //todo: right now just put GRPC error codes, + // later we will use own error codes + code, + log: "".to_string(), + info: "".to_string(), + index: 0, + key: vec![], + value: data, + proof_ops: None, + height: self.platform.state.read().unwrap().height() as i64, + codespace: "".to_string(), + }) } } // diff --git a/packages/rs-drive-abci/src/config.rs b/packages/rs-drive-abci/src/config.rs index 78ba7fbba0..6f873b0d91 100644 --- a/packages/rs-drive-abci/src/config.rs +++ b/packages/rs-drive-abci/src/config.rs @@ -133,7 +133,7 @@ impl Default for CoreConfig { pub struct PlatformConfig { /// Drive configuration #[serde(flatten)] - pub drive: Option, + pub drive: DriveConfig, /// Dash Core config #[serde(flatten)] diff --git a/packages/rs-drive-abci/src/contracts/reward_shares.rs b/packages/rs-drive-abci/src/contracts/reward_shares.rs index cce018e433..f233fcb8a6 100644 --- a/packages/rs-drive-abci/src/contracts/reward_shares.rs +++ b/packages/rs-drive-abci/src/contracts/reward_shares.rs @@ -96,7 +96,7 @@ impl Platform { order_by: Default::default(), start_at: None, start_at_included: false, - block_time: None, + block_time_ms: None, }; let QueryDocumentsOutcome { documents, .. } = diff --git a/packages/rs-drive-abci/src/error/mod.rs b/packages/rs-drive-abci/src/error/mod.rs index 344f0e2908..54d1a48765 100644 --- a/packages/rs-drive-abci/src/error/mod.rs +++ b/packages/rs-drive-abci/src/error/mod.rs @@ -10,6 +10,8 @@ use tracing::error; /// Execution errors module pub mod execution; +/// Query errors module +pub mod query; /// Serialization errors module pub mod serialization; diff --git a/packages/rs-drive-abci/src/error/query.rs b/packages/rs-drive-abci/src/error/query.rs new file mode 100644 index 0000000000..1278678fb7 --- /dev/null +++ b/packages/rs-drive-abci/src/error/query.rs @@ -0,0 +1,33 @@ +use dpp::platform_value::Error as ValueError; +use dpp::ProtocolError; +use drive::error::proof::ProofError; +use drive::error::query::QuerySyntaxError as SyntaxError; +use drive::error::Error as DriveError; +use prost::DecodeError; + +/// Errors +#[derive(Debug, thiserror::Error)] +pub enum QueryError { + /// Proof Error + #[error("proof error: {0}")] + Proof(#[from] ProofError), + /// Syntax Error + #[error("query syntax error: {0}")] + Query(#[from] SyntaxError), + + /// Protocol Error + #[error("protocol error: {0}")] + Protocol(#[from] ProtocolError), + + /// Value Error + #[error("query value error: {0}")] + Value(#[from] ValueError), + + /// Drive Error + #[error("drive error: {0}")] + Drive(#[from] DriveError), + + /// Decoding error Error + #[error("protobuf decoding error: {0}")] + ProtobufDecode(#[from] DecodeError), +} diff --git a/packages/rs-drive-abci/src/execution/data_trigger/dashpay_data_triggers/mod.rs b/packages/rs-drive-abci/src/execution/data_trigger/dashpay_data_triggers/mod.rs index b7dfa0e717..c12fa41c48 100644 --- a/packages/rs-drive-abci/src/execution/data_trigger/dashpay_data_triggers/mod.rs +++ b/packages/rs-drive-abci/src/execution/data_trigger/dashpay_data_triggers/mod.rs @@ -130,7 +130,7 @@ mod test { use crate::execution::data_trigger::DataTriggerExecutionContext; use crate::platform::PlatformStateRef; use crate::test::helpers::setup::TestPlatformBuilder; - use dpp::block::block_info::BlockInfo; + use dpp::block::block_info::{BlockInfo, ExtendedBlockInfo}; use dpp::document::document_transition::{Action, DocumentCreateTransitionAction}; use dpp::errors::consensus::state::data_trigger::data_trigger_error::DataTriggerActionError; use dpp::platform_value; @@ -204,11 +204,16 @@ mod test { .set_initial_state_structure(); let mut state_write_guard = platform.state.write().unwrap(); - state_write_guard.last_committed_block_info = Some(BlockInfo { - time_ms: 500000, - height: 100, - core_height: 42, - epoch: Default::default(), + state_write_guard.last_committed_block_info = Some(ExtendedBlockInfo { + basic_info: BlockInfo { + time_ms: 500000, + height: 100, + core_height: 42, + epoch: Default::default(), + }, + quorum_hash: [0u8; 32], + signature: [0u8; 96], + round: 0, }); let platform_ref = PlatformStateRef { drive: &platform.drive, @@ -277,12 +282,18 @@ mod test { .set_initial_state_structure(); let mut state_write_guard = platform.state.write().unwrap(); - state_write_guard.last_committed_block_info = Some(BlockInfo { - time_ms: 500000, - height: 100, - core_height: 42, - epoch: Default::default(), + state_write_guard.last_committed_block_info = Some(ExtendedBlockInfo { + basic_info: BlockInfo { + time_ms: 500000, + height: 100, + core_height: 42, + epoch: Default::default(), + }, + quorum_hash: [0u8; 32], + signature: [0u8; 96], + round: 0, }); + let platform_ref = PlatformStateRef { drive: &platform.drive, state: &state_write_guard, diff --git a/packages/rs-drive-abci/src/execution/data_trigger/dpns_triggers/mod.rs b/packages/rs-drive-abci/src/execution/data_trigger/dpns_triggers/mod.rs index 38d0691652..750f3a4e4c 100644 --- a/packages/rs-drive-abci/src/execution/data_trigger/dpns_triggers/mod.rs +++ b/packages/rs-drive-abci/src/execution/data_trigger/dpns_triggers/mod.rs @@ -199,7 +199,7 @@ pub fn create_domain_data_trigger( order_by: Default::default(), start_at: None, start_at_included: false, - block_time: None, + block_time_ms: None, }; let documents = context @@ -276,7 +276,7 @@ pub fn create_domain_data_trigger( order_by: Default::default(), start_at: None, start_at_included: false, - block_time: None, + block_time_ms: None, }; let preorder_documents = context diff --git a/packages/rs-drive-abci/src/execution/data_trigger/reward_share_data_triggers/mod.rs b/packages/rs-drive-abci/src/execution/data_trigger/reward_share_data_triggers/mod.rs index d9f2de599a..4e61e325d4 100644 --- a/packages/rs-drive-abci/src/execution/data_trigger/reward_share_data_triggers/mod.rs +++ b/packages/rs-drive-abci/src/execution/data_trigger/reward_share_data_triggers/mod.rs @@ -122,7 +122,7 @@ pub fn create_masternode_reward_shares_data_trigger( order_by: Default::default(), start_at: None, start_at_included: false, - block_time: None, + block_time_ms: None, }; let documents = context diff --git a/packages/rs-drive-abci/src/execution/data_trigger/withdrawals_data_triggers/mod.rs b/packages/rs-drive-abci/src/execution/data_trigger/withdrawals_data_triggers/mod.rs index 928578f09b..eacde9b3aa 100644 --- a/packages/rs-drive-abci/src/execution/data_trigger/withdrawals_data_triggers/mod.rs +++ b/packages/rs-drive-abci/src/execution/data_trigger/withdrawals_data_triggers/mod.rs @@ -64,7 +64,7 @@ pub fn delete_withdrawal_data_trigger( order_by: Default::default(), start_at: None, start_at_included: false, - block_time: None, + block_time_ms: None, }; let withdrawals = context diff --git a/packages/rs-drive-abci/src/execution/engine.rs b/packages/rs-drive-abci/src/execution/engine.rs index d9bd9dcfd2..c74f523a07 100644 --- a/packages/rs-drive-abci/src/execution/engine.rs +++ b/packages/rs-drive-abci/src/execution/engine.rs @@ -1,6 +1,6 @@ use dashcore_rpc::dashcore::hashes::{hex::ToHex, Hash}; use dashcore_rpc::dashcore::{QuorumHash, Txid}; -use dpp::block::block_info::BlockInfo; +use dpp::block::block_info::{BlockInfo, ExtendedBlockInfo}; use dpp::block::epoch::Epoch; use dpp::bls_signatures; use dpp::consensus::ConsensusError; @@ -509,7 +509,7 @@ where // TODO: remove function from here fn store_ephemeral_data( &self, - block_info: &BlockInfo, + block_info: &ExtendedBlockInfo, quorum_hash: &QuorumHash, transaction: &Transaction, ) -> Result<(), Error> { @@ -545,7 +545,7 @@ where /// Update the current quorums if the core_height changes pub fn update_state_cache_and_quorums( &self, - block_info: BlockInfo, + block_info: ExtendedBlockInfo, transaction: &Transaction, ) -> Result<(), Error> { let mut block_execution_context = self.block_execution_context.write().unwrap(); @@ -719,7 +719,8 @@ where } let state_cache = self.state.read().unwrap(); - if state_cache.current_validator_set_quorum_hash.as_inner() != &commit_info.quorum_hash { + let current_quorum_hash = state_cache.current_validator_set_quorum_hash.into_inner(); + if current_quorum_hash != commit_info.quorum_hash { validation_result.add_error(AbciError::WrongFinalizeBlockReceived(format!( "received a block for h: {} r: {} with validator set quorum hash {} expected current validator set quorum hash is {}", height, round, hex::encode(commit_info.quorum_hash), hex::encode(block_platform_state.current_validator_set_quorum_hash) @@ -791,7 +792,15 @@ where // At the end we update the state cache drop(guarded_block_execution_context); - self.update_state_cache_and_quorums(to_commit_block_info, transaction)?; + + let extended_block_info = ExtendedBlockInfo { + basic_info: to_commit_block_info, + quorum_hash: current_quorum_hash, + signature: commit_info.block_signature, + round, + }; + + self.update_state_cache_and_quorums(extended_block_info, transaction)?; let mut drive_cache = self.drive.cache.write().unwrap(); @@ -826,7 +835,7 @@ where if let Some(block_info) = state_read_guard.last_committed_block_info.as_ref() { // We do not put the transaction, because this event happens outside of a block execution_event.and_then_borrowed_validation(|execution_event| { - self.validate_fees_of_event(execution_event, block_info, None) + self.validate_fees_of_event(execution_event, &block_info.basic_info, None) }) } else { execution_event.and_then_borrowed_validation(|execution_event| { diff --git a/packages/rs-drive-abci/src/execution/helpers.rs b/packages/rs-drive-abci/src/execution/helpers.rs index 4d15c89025..832980a5dc 100644 --- a/packages/rs-drive-abci/src/execution/helpers.rs +++ b/packages/rs-drive-abci/src/execution/helpers.rs @@ -290,7 +290,7 @@ where if let Some(last_commited_block_info) = block_platform_state.last_committed_block_info.as_ref() { - if core_block_height == last_commited_block_info.core_height { + if core_block_height == last_commited_block_info.basic_info.core_height { tracing::debug!( method = "update_masternode_list", "no update mnl at height {}", diff --git a/packages/rs-drive-abci/src/identity_credit_withdrawal/mod.rs b/packages/rs-drive-abci/src/identity_credit_withdrawal/mod.rs index 3abd343546..bcffac2161 100644 --- a/packages/rs-drive-abci/src/identity_credit_withdrawal/mod.rs +++ b/packages/rs-drive-abci/src/identity_credit_withdrawal/mod.rs @@ -54,7 +54,7 @@ where let data_contract_id = &withdrawals_contract::CONTRACT_ID; - let (_, Some(contract_fetch_info)) = self.drive.get_contract_with_fetch_info( + let (_, Some(contract_fetch_info)) = self.drive.get_contract_with_fetch_info_and_fee( data_contract_id.to_buffer(), None, true, @@ -192,7 +192,7 @@ where let data_contract_id = withdrawals_contract::CONTRACT_ID.deref(); - let (_, Some(contract_fetch_info)) = self.drive.get_contract_with_fetch_info( + let (_, Some(contract_fetch_info)) = self.drive.get_contract_with_fetch_info_and_fee( data_contract_id.to_buffer(), None, true, @@ -318,7 +318,7 @@ where let data_contract_id = withdrawals_contract::CONTRACT_ID.deref(); - let (_, Some(contract_fetch_info)) = self.drive.get_contract_with_fetch_info( + let (_, Some(contract_fetch_info)) = self.drive.get_contract_with_fetch_info_and_fee( data_contract_id.to_buffer(), None, true, diff --git a/packages/rs-drive-abci/src/lib.rs b/packages/rs-drive-abci/src/lib.rs index 3047431c28..b068553141 100644 --- a/packages/rs-drive-abci/src/lib.rs +++ b/packages/rs-drive-abci/src/lib.rs @@ -51,6 +51,8 @@ pub mod rpc; // TODO We should compile it only for tests /// Asset Lock pub mod asset_lock; +/// Querying +pub mod query; /// Test helpers and fixtures pub mod test; /// Validator Set diff --git a/packages/rs-drive-abci/src/platform/mod.rs b/packages/rs-drive-abci/src/platform/mod.rs index a8705a1fb7..5684fdef6b 100644 --- a/packages/rs-drive-abci/src/platform/mod.rs +++ b/packages/rs-drive-abci/src/platform/mod.rs @@ -47,7 +47,7 @@ use dashcore_rpc::dashcore::hashes::hex::FromHex; use dashcore_rpc::dashcore::hashes::Hash; use dashcore_rpc::dashcore::{BlockHash, QuorumHash}; -use dpp::block::block_info::BlockInfo; +use dpp::block::block_info::ExtendedBlockInfo; use dpp::serialization_traits::PlatformDeserializable; use drive::error::drive::DriveError; use drive::error::Error::GroveDB; @@ -168,7 +168,8 @@ impl Platform { return Ok(false); }; - let block_info: BlockInfo = BlockInfo::deserialize(serialized_block_info.as_slice())?; + let block_info: ExtendedBlockInfo = + ExtendedBlockInfo::deserialize(serialized_block_info.as_slice())?; let maybe_quorum_hash = self .drive @@ -231,7 +232,7 @@ impl Platform { C: CoreRPCLike, { let config = config.unwrap_or_default(); - let drive = Drive::open(path, config.drive.clone()).map_err(Error::Drive)?; + let drive = Drive::open(path, Some(config.drive.clone())).map_err(Error::Drive)?; let current_protocol_version_in_consensus = drive .fetch_current_protocol_version(None) @@ -281,7 +282,7 @@ impl Platform { where C: CoreRPCLike, { - let block_info = BlockInfo::deserialize(serialized_block_info.as_slice())?; + let block_info = ExtendedBlockInfo::deserialize(serialized_block_info.as_slice())?; let maybe_quorum_hash = drive .grove diff --git a/packages/rs-drive-abci/src/query/mod.rs b/packages/rs-drive-abci/src/query/mod.rs new file mode 100644 index 0000000000..8aff6efd0c --- /dev/null +++ b/packages/rs-drive-abci/src/query/mod.rs @@ -0,0 +1,550 @@ +use crate::error::query::QueryError; +use crate::error::Error; +use crate::platform::Platform; +use dapi_grpc::platform::v0::get_documents_request::Start; +use dapi_grpc::platform::v0::{ + get_data_contracts_response, get_identity_by_public_key_hashes_response, + get_identity_keys_response, GetDataContractRequest, GetDataContractResponse, + GetDataContractsRequest, GetDataContractsResponse, GetDocumentsRequest, GetDocumentsResponse, + GetIdentitiesByPublicKeyHashesRequest, GetIdentitiesByPublicKeyHashesResponse, + GetIdentityBalanceAndRevisionResponse, GetIdentityBalanceResponse, + GetIdentityByPublicKeyHashesRequest, GetIdentityByPublicKeyHashesResponse, + GetIdentityKeysRequest, GetIdentityKeysResponse, GetIdentityRequest, Proof, ResponseMetadata, +}; +use dpp::identifier::Identifier; +use dpp::platform_value::{Bytes20, Bytes32}; +use std::collections::BTreeMap; + +use dpp::serialization_traits::PlatformSerializable; +use dpp::validation::ValidationResult; +use dpp::{check_validation_result_with_data, ProtocolError}; + +use dapi_grpc::platform::v0::get_data_contracts_response::DataContractEntry; +use dpp::identity::{KeyID, Purpose, SecurityLevel}; +use drive::drive::identity::key::fetch::{ + IdentityKeysRequest, KeyKindRequestType, KeyRequestType, PurposeU8, SecurityLevelU8, + SerializedKeyVec, +}; +use drive::error::query::QuerySyntaxError; +use drive::query::DriveQuery; +use prost::Message; + +/// A query validation result +pub type QueryValidationResult = ValidationResult; + +fn from_i32_to_key_kind_request_type(value: i32) -> Option { + match value { + 0 => Some(KeyKindRequestType::CurrentKeyOfKindRequest), + 1 => Some(KeyKindRequestType::AllKeysOfKindRequest), + _ => None, + } +} + +fn convert_key_request_type( + request_type: dapi_grpc::platform::v0::key_request_type::Request, +) -> Result { + match request_type { + dapi_grpc::platform::v0::key_request_type::Request::AllKeys(_) => { + Ok(KeyRequestType::AllKeys) + } + dapi_grpc::platform::v0::key_request_type::Request::SpecificKeys(specific_keys) => { + let key_ids = specific_keys + .key_ids + .into_iter() + .map(|id| id as KeyID) + .collect(); + Ok(KeyRequestType::SpecificKeys(key_ids)) + } + dapi_grpc::platform::v0::key_request_type::Request::SearchKey(search_key) => { + let purpose_map = search_key.purpose_map.into_iter().map(|(purpose, security_level_map)| { + let security_level_map = security_level_map.security_level_map.into_iter().map(|(security_level, key_kind_request_type)| { + if security_level > u8::MAX as u32 { + return Err(QueryError::Query(QuerySyntaxError::InvalidKeyParameter("security level out of bounds".to_string()))); + } + let security_level = SecurityLevel::try_from(security_level as u8).map_err(|_| QueryError::Query(QuerySyntaxError::InvalidKeyParameter(format!("security level {} not recognized", security_level))))?; + + let key_kind_request_type = from_i32_to_key_kind_request_type(key_kind_request_type).ok_or(QueryError::Query(QuerySyntaxError::InvalidKeyParameter(format!("unknown key kind request type {}", key_kind_request_type))))?; + Ok(( + security_level as u8, + key_kind_request_type, + )) + }).collect::, QueryError>>()?; + if purpose > u8::MAX as u32 { + return Err(QueryError::Query(QuerySyntaxError::InvalidKeyParameter("purpose out of bounds".to_string()))); + } + let purpose = Purpose::try_from(purpose as u8).map_err(|_| QueryError::Query(QuerySyntaxError::InvalidKeyParameter(format!("purpose {} not recognized", purpose))))?; + + Ok((purpose as u8, security_level_map)) + }).collect::>, QueryError>>()?; + + Ok(KeyRequestType::SearchKey(purpose_map)) + } + } +} + +impl Platform { + /// Querying + pub fn query( + &self, + query_path: &str, + query_data: &[u8], + _prove: bool, + ) -> Result>, Error> { + let state = self.state.read().unwrap(); + let metadata = ResponseMetadata { + height: state.height(), + core_chain_locked_height: state.core_height(), + time_ms: state.last_block_time_ms().unwrap_or_default(), + protocol_version: state.current_protocol_version_in_consensus, + }; + match query_path { + "/identity/balance" => { + let GetIdentityRequest { id, prove } = + check_validation_result_with_data!(GetIdentityRequest::decode(query_data)); + let identity_id: Identifier = check_validation_result_with_data!(id.try_into()); + let response_data = if prove { + let proof = check_validation_result_with_data!(self + .drive + .prove_identity_balance(identity_id.into_buffer(), None)); + GetIdentityBalanceResponse { + balance: None, + proof: Some(Proof { + grovedb_proof: proof, + quorum_hash: state.last_quorum_hash().to_vec(), + signature: state.last_block_signature().to_vec(), + round: state.last_block_round(), + }), + metadata: Some(metadata), + } + .encode_to_vec() + } else { + let balance = check_validation_result_with_data!(self + .drive + .fetch_identity_balance(identity_id.into_buffer(), None,)); + GetIdentityBalanceResponse { + balance, + proof: None, + metadata: Some(metadata), + } + .encode_to_vec() + }; + Ok(QueryValidationResult::new_with_data(response_data)) + } + "/identity/balanceAndRevision" => { + let GetIdentityRequest { id, prove } = + check_validation_result_with_data!(GetIdentityRequest::decode(query_data)); + let identity_id: Identifier = check_validation_result_with_data!(id.try_into()); + let response_data = if prove { + let proof = check_validation_result_with_data!(self + .drive + .prove_identity_balance_and_revision(identity_id.into_buffer(), None)); + GetIdentityBalanceResponse { + balance: None, + proof: Some(Proof { + grovedb_proof: proof, + quorum_hash: state.last_quorum_hash().to_vec(), + signature: state.last_block_signature().to_vec(), + round: state.last_block_round(), + }), + metadata: Some(metadata), + } + .encode_to_vec() + } else { + let balance = check_validation_result_with_data!(self + .drive + .fetch_identity_balance(identity_id.into_buffer(), None,)); + let revision = check_validation_result_with_data!(self + .drive + .fetch_identity_revision(identity_id.into_buffer(), true, None,)); + GetIdentityBalanceAndRevisionResponse { + balance, + revision, + proof: None, + metadata: Some(metadata), + } + .encode_to_vec() + }; + Ok(QueryValidationResult::new_with_data(response_data)) + } + "/identity/keys" => { + let GetIdentityKeysRequest { + identity_id, + request_type, + limit, + offset, + prove, + } = check_validation_result_with_data!(GetIdentityKeysRequest::decode(query_data)); + let identity_id: Identifier = + check_validation_result_with_data!(identity_id.try_into()); + if let Some(limit) = limit { + if limit > u16::MAX as u32 { + return Ok(QueryValidationResult::new_with_error(QueryError::Query( + QuerySyntaxError::InvalidParameter("limit out of bounds".to_string()), + ))); + } + if limit as u16 > self.config.drive.max_query_limit { + return Ok(QueryValidationResult::new_with_error(QueryError::Query( + QuerySyntaxError::InvalidLimit(format!( + "limit greater than max limit {}", + self.config.drive.max_query_limit + )), + ))); + } + } + + if let Some(offset) = offset { + if offset > u16::MAX as u32 { + return Ok(QueryValidationResult::new_with_error(QueryError::Query( + QuerySyntaxError::InvalidParameter("limit out of bounds".to_string()), + ))); + } + } + let Some(request_type) = request_type else { + return Ok(QueryValidationResult::new_with_error(QueryError::Query( + QuerySyntaxError::InvalidParameter("key request must be defined".to_string()), + ))); + }; + let Some(request) = request_type.request else { + return Ok(QueryValidationResult::new_with_error(QueryError::Query( + QuerySyntaxError::InvalidParameter("key request must be defined".to_string()), + ))); + }; + let key_request_type = + check_validation_result_with_data!(convert_key_request_type(request)); + let key_request = IdentityKeysRequest { + identity_id: identity_id.into_buffer(), + request_type: key_request_type, + limit: limit.map(|l| l as u16), + offset: offset.map(|o| o as u16), + }; + let response_data = if prove { + let proof = check_validation_result_with_data!(self + .drive + .prove_identity_keys(key_request, None)); + GetIdentityKeysResponse { + result: Some(get_identity_keys_response::Result::Proof(Proof { + grovedb_proof: proof, + quorum_hash: state.last_quorum_hash().to_vec(), + signature: state.last_block_signature().to_vec(), + round: state.last_block_round(), + })), + metadata: Some(metadata), + } + .encode_to_vec() + } else { + let keys: SerializedKeyVec = check_validation_result_with_data!(self + .drive + .fetch_identity_keys(key_request, None)); + GetIdentityKeysResponse { + result: Some(get_identity_keys_response::Result::Keys( + get_identity_keys_response::Keys { keys_bytes: keys }, + )), + metadata: Some(metadata), + } + .encode_to_vec() + }; + Ok(QueryValidationResult::new_with_data(response_data)) + } + "/dataContract" => { + let GetDataContractRequest { id, prove } = + check_validation_result_with_data!(GetDataContractRequest::decode(query_data)); + let contract_id: Identifier = check_validation_result_with_data!(id.try_into()); + let response_data = if prove { + let proof = check_validation_result_with_data!(self + .drive + .prove_contract(contract_id.into_buffer(), None)); + GetIdentityBalanceResponse { + balance: None, + proof: Some(Proof { + grovedb_proof: proof, + quorum_hash: state.last_quorum_hash().to_vec(), + signature: state.last_block_signature().to_vec(), + round: state.last_block_round(), + }), + metadata: Some(metadata), + } + .encode_to_vec() + } else { + let contract = check_validation_result_with_data!(self + .drive + .fetch_contract(contract_id.into_buffer(), None, None,) + .unwrap()) + .map(|contract| contract.contract.serialize()) + .transpose()?; + GetDataContractResponse { + data_contract: contract.unwrap_or_default(), + proof: None, + metadata: Some(metadata), + } + .encode_to_vec() + }; + Ok(QueryValidationResult::new_with_data(response_data)) + } + "/dataContracts" => { + let GetDataContractsRequest { ids, prove } = + check_validation_result_with_data!(GetDataContractsRequest::decode(query_data)); + let contract_ids = check_validation_result_with_data!(ids + .into_iter() + .map(|contract_id_vec| { + Bytes32::from_vec(contract_id_vec).map(|bytes| bytes.0) + }) + .collect::, dpp::platform_value::Error>>()); + let response_data = if prove { + let proof = check_validation_result_with_data!(self + .drive + .prove_contracts(contract_ids.as_slice(), None)); + GetDataContractsResponse { + metadata: Some(metadata), + result: Some(get_data_contracts_response::Result::Proof(Proof { + grovedb_proof: proof, + quorum_hash: state.last_quorum_hash().to_vec(), + signature: state.last_block_signature().to_vec(), + round: state.last_block_round(), + })), + } + .encode_to_vec() + } else { + let contracts = check_validation_result_with_data!(self + .drive + .get_contracts_with_fetch_info(contract_ids.as_slice(), false, None)); + + let contracts = check_validation_result_with_data!(contracts + .into_iter() + .map( + |(key, maybe_contract)| Ok::( + get_data_contracts_response::DataContractEntry { + key: key.to_vec(), + value: maybe_contract + .map(|contract| Ok::< + get_data_contracts_response::DataContractValue, + ProtocolError, + >( + get_data_contracts_response::DataContractValue { + value: contract.contract.serialize()? + } + )) + .transpose()?, + } + ) + ) + .collect()); + GetDataContractsResponse { + result: Some(get_data_contracts_response::Result::DataContracts( + get_data_contracts_response::DataContracts { + data_contract_entries: contracts, + }, + )), + metadata: Some(metadata), + } + .encode_to_vec() + }; + Ok(QueryValidationResult::new_with_data(response_data)) + } + "/documents" | "/dataContract/documents" => { + let GetDocumentsRequest { + data_contract_id, + document_type: document_type_name, + r#where, + order_by, + limit, + prove, + start, + } = check_validation_result_with_data!(GetDocumentsRequest::decode(query_data)); + let contract_id: Identifier = + check_validation_result_with_data!(data_contract_id.try_into()); + let (_, contract) = check_validation_result_with_data!(self + .drive + .get_contract_with_fetch_info_and_fee( + contract_id.to_buffer(), + None, + true, + None + )); + let contract = check_validation_result_with_data!(contract.ok_or( + QueryError::Query(QuerySyntaxError::ContractNotFound( + "contract not found when querying from value with contract info", + )) + )); + let contract_ref = &contract.contract; + let document_type = check_validation_result_with_data!( + contract_ref.document_type_for_name(document_type_name.as_str()) + ); + + let where_clause = check_validation_result_with_data!(ciborium::de::from_reader( + r#where.as_slice() + ) + .map_err(|_| { + QueryError::Query(QuerySyntaxError::DeserializationError( + "unable to decode query from cbor".to_string(), + )) + })); + + let order_by = check_validation_result_with_data!(ciborium::de::from_reader( + order_by.as_slice() + ) + .map_err(|_| { + QueryError::Query(QuerySyntaxError::DeserializationError( + "unable to decode query from cbor".to_string(), + )) + })); + + let (start_at_included, start_at) = if let Some(start) = start { + match start { + Start::StartAfter(after) => (false, Some(after)), + Start::StartAt(at) => (true, Some(at)), + } + } else { + (true, None) + }; + + if limit > u16::MAX as u32 { + return Ok(QueryValidationResult::new_with_error(QueryError::Query( + QuerySyntaxError::InvalidLimit(format!("limit {} out of bounds", limit)), + ))); + } + + let drive_query = + check_validation_result_with_data!(DriveQuery::from_decomposed_values( + where_clause, + order_by, + Some(limit as u16), + start_at, + start_at_included, + None, + contract_ref, + document_type, + &self.config.drive, + )); + let response_data = if prove { + let (proof, _) = check_validation_result_with_data!( + drive_query.execute_with_proof(&self.drive, None, None) + ); + GetDocumentsResponse { + documents: vec![], + proof: Some(Proof { + grovedb_proof: proof, + quorum_hash: state.last_quorum_hash().to_vec(), + signature: state.last_block_signature().to_vec(), + round: state.last_block_round(), + }), + metadata: Some(metadata), + } + .encode_to_vec() + } else { + let results = check_validation_result_with_data!( + drive_query.execute_raw_results_no_proof(&self.drive, None, None,) + ) + .0; + GetDocumentsResponse { + documents: results, + proof: None, + metadata: Some(metadata), + } + .encode_to_vec() + }; + Ok(QueryValidationResult::new_with_data(response_data)) + } + "/identity/by-public-key-hash" => { + let GetIdentityByPublicKeyHashesRequest { + public_key_hash, + prove, + } = check_validation_result_with_data!( + GetIdentityByPublicKeyHashesRequest::decode(query_data) + ); + let public_key_hash = check_validation_result_with_data!(Bytes20::from_vec( + public_key_hash + ) + .map(|bytes| bytes.0)); + let response_data = if prove { + let proof = check_validation_result_with_data!(self + .drive + .prove_full_identity_by_unique_public_key_hash(public_key_hash, None)); + GetIdentityByPublicKeyHashesResponse { + metadata: Some(metadata), + result: Some(get_identity_by_public_key_hashes_response::Result::Proof( + Proof { + grovedb_proof: proof, + quorum_hash: state.last_quorum_hash().to_vec(), + signature: state.last_block_signature().to_vec(), + round: state.last_block_round(), + }, + )), + } + .encode_to_vec() + } else { + let maybe_identity = check_validation_result_with_data!(self + .drive + .fetch_full_identity_by_unique_public_key_hash(public_key_hash, None,)); + let serialized_identity = check_validation_result_with_data!(maybe_identity + .map(|identity| identity.serialize_consume()) + .transpose()); + GetIdentityByPublicKeyHashesResponse { + metadata: Some(metadata), + result: Some( + get_identity_by_public_key_hashes_response::Result::Identity( + serialized_identity.unwrap_or_default(), + ), + ), + } + .encode_to_vec() + }; + Ok(QueryValidationResult::new_with_data(response_data)) + } + "/identities/by-public-key-hash" => { + let GetIdentitiesByPublicKeyHashesRequest { + public_key_hashes, + prove, + } = check_validation_result_with_data!( + GetIdentitiesByPublicKeyHashesRequest::decode(query_data) + ); + let public_key_hashes = check_validation_result_with_data!(public_key_hashes + .into_iter() + .map(|pub_key_hash_vec| { + Bytes20::from_vec(pub_key_hash_vec).map(|bytes| bytes.0) + }) + .collect::, dpp::platform_value::Error>>()); + let response_data = if prove { + let proof = check_validation_result_with_data!(self + .drive + .prove_full_identities_by_unique_public_key_hashes( + &public_key_hashes, + None + )); + GetIdentitiesByPublicKeyHashesResponse { + identities: vec![], + proof: Some(Proof { + grovedb_proof: proof, + quorum_hash: state.last_quorum_hash().to_vec(), + signature: state.last_block_signature().to_vec(), + round: state.last_block_round(), + }), + metadata: Some(metadata), + } + .encode_to_vec() + } else { + //todo: fix this so we return optionals + let identities = check_validation_result_with_data!(self + .drive + .fetch_full_identities_by_unique_public_key_hashes( + public_key_hashes.as_slice(), + None, + )); + let identities = check_validation_result_with_data!(identities + .into_values() + .filter_map(|maybe_identity| Some(maybe_identity?.serialize_consume())) + .collect::>, ProtocolError>>()); + GetIdentitiesByPublicKeyHashesResponse { + identities, + proof: None, + metadata: Some(metadata), + } + .encode_to_vec() + }; + Ok(QueryValidationResult::new_with_data(response_data)) + } + other => Ok(QueryValidationResult::new_with_error(QueryError::Query( + QuerySyntaxError::Unsupported(format!("query path '{}' is not supported", other)), + ))), + } + } +} diff --git a/packages/rs-drive-abci/src/state/mod.rs b/packages/rs-drive-abci/src/state/mod.rs index c1bda7067d..31677a33e5 100644 --- a/packages/rs-drive-abci/src/state/mod.rs +++ b/packages/rs-drive-abci/src/state/mod.rs @@ -5,8 +5,9 @@ use crate::rpc::core::QuorumListExtendedInfo; use dashcore_rpc::dashcore::{ProTxHash, QuorumHash}; use dashcore_rpc::dashcore_rpc_json::MasternodeListItem; use dashcore_rpc::json::QuorumType; -use dpp::block::block_info::BlockInfo; +use dpp::block::block_info::ExtendedBlockInfo; use dpp::block::epoch::Epoch; + use drive::dpp::util::deserializer::ProtocolVersion; use indexmap::IndexMap; use std::collections::{BTreeMap, HashMap}; @@ -16,9 +17,8 @@ mod genesis; /// Platform state #[derive(Clone)] pub struct PlatformState { - //todo: add quorum hash to block info /// Information about the last block - pub last_committed_block_info: Option, + pub last_committed_block_info: Option, /// Current Version pub current_protocol_version_in_consensus: ProtocolVersion, /// upcoming protocol version @@ -56,7 +56,7 @@ impl PlatformState { pub fn height(&self) -> u64 { self.last_committed_block_info .as_ref() - .map(|block_info| block_info.height) + .map(|block_info| block_info.basic_info.height) .unwrap_or_default() } @@ -64,7 +64,7 @@ impl PlatformState { pub fn known_height_or(&self, default: u64) -> u64 { self.last_committed_block_info .as_ref() - .map(|block_info| block_info.height) + .map(|block_info| block_info.basic_info.height) .unwrap_or(default) } @@ -72,7 +72,7 @@ impl PlatformState { pub fn core_height(&self) -> u32 { self.last_committed_block_info .as_ref() - .map(|block_info| block_info.core_height) + .map(|block_info| block_info.basic_info.core_height) .unwrap_or_else(|| { self.initialization_information .as_ref() @@ -87,7 +87,7 @@ impl PlatformState { pub fn known_core_height_or(&self, default: u32) -> u32 { self.last_committed_block_info .as_ref() - .map(|block_info| block_info.core_height) + .map(|block_info| block_info.basic_info.core_height) .unwrap_or_else(|| { self.initialization_information .as_ref() @@ -102,14 +102,38 @@ impl PlatformState { pub fn last_block_time_ms(&self) -> Option { self.last_committed_block_info .as_ref() - .map(|block_info| block_info.time_ms) + .map(|block_info| block_info.basic_info.time_ms) + } + + /// The last quorum hash + pub fn last_quorum_hash(&self) -> [u8; 32] { + self.last_committed_block_info + .as_ref() + .map(|block_info| block_info.quorum_hash) + .unwrap_or_default() + } + + /// The last block signature + pub fn last_block_signature(&self) -> [u8; 96] { + self.last_committed_block_info + .as_ref() + .map(|block_info| block_info.signature) + .unwrap_or([0u8; 96]) + } + + /// The last block round + pub fn last_block_round(&self) -> u32 { + self.last_committed_block_info + .as_ref() + .map(|block_info| block_info.round) + .unwrap_or_default() } /// The current epoch pub fn epoch(&self) -> Epoch { self.last_committed_block_info .as_ref() - .map(|block_info| block_info.epoch) + .map(|block_info| block_info.basic_info.epoch) .unwrap_or_default() } diff --git a/packages/rs-drive-abci/src/validation/state_transition/data_contract_create.rs b/packages/rs-drive-abci/src/validation/state_transition/data_contract_create.rs index d699db2aa2..f8ee48942b 100644 --- a/packages/rs-drive-abci/src/validation/state_transition/data_contract_create.rs +++ b/packages/rs-drive-abci/src/validation/state_transition/data_contract_create.rs @@ -97,7 +97,12 @@ impl StateTransitionValidation for DataContractCreateTransition { let drive = platform.drive; // Data contract shouldn't exist if drive - .get_contract_with_fetch_info(self.data_contract.id.to_buffer(), None, false, tx)? + .get_contract_with_fetch_info_and_fee( + self.data_contract.id.to_buffer(), + None, + false, + tx, + )? .1 .is_some() { diff --git a/packages/rs-drive-abci/src/validation/state_transition/data_contract_update.rs b/packages/rs-drive-abci/src/validation/state_transition/data_contract_update.rs index f53a99f84d..0657a0da5c 100644 --- a/packages/rs-drive-abci/src/validation/state_transition/data_contract_update.rs +++ b/packages/rs-drive-abci/src/validation/state_transition/data_contract_update.rs @@ -91,7 +91,7 @@ impl StateTransitionValidation for DataContractUpdateTransition { // Data contract should exist let Some(contract_fetch_info) = drive - .get_contract_with_fetch_info(self.data_contract.id.0 .0, None, add_to_cache_if_pulled, tx)? + .get_contract_with_fetch_info_and_fee(self.data_contract.id.0 .0, None, add_to_cache_if_pulled, tx)? .1 else { validation_result diff --git a/packages/rs-drive-abci/src/validation/state_transition/document_state_validation/fetch_documents.rs b/packages/rs-drive-abci/src/validation/state_transition/document_state_validation/fetch_documents.rs index 09216bdf1e..6912534e73 100644 --- a/packages/rs-drive-abci/src/validation/state_transition/document_state_validation/fetch_documents.rs +++ b/packages/rs-drive-abci/src/validation/state_transition/document_state_validation/fetch_documents.rs @@ -68,7 +68,7 @@ pub(super) fn fetch_documents_for_transitions_knowing_contract_id_and_document_t //todo: deal with fee result //we only want to add to the cache if we are validating in a transaction let add_to_cache_if_pulled = transaction.is_some(); - let (_, contract_fetch_info) = drive.get_contract_with_fetch_info( + let (_, contract_fetch_info) = drive.get_contract_with_fetch_info_and_fee( contract_id.to_buffer(), Some(&platform.state.epoch()), add_to_cache_if_pulled, @@ -124,7 +124,7 @@ pub(super) fn fetch_documents_for_transitions_knowing_contract_and_document_type order_by: Default::default(), start_at: None, start_at_included: false, - block_time: None, + block_time_ms: None, }; //todo: deal with cost of this operation diff --git a/packages/rs-drive-abci/src/validation/state_transition/document_state_validation/validate_documents_batch_transition_state.rs b/packages/rs-drive-abci/src/validation/state_transition/document_state_validation/validate_documents_batch_transition_state.rs index 37859a34c6..f8318381b8 100644 --- a/packages/rs-drive-abci/src/validation/state_transition/document_state_validation/validate_documents_batch_transition_state.rs +++ b/packages/rs-drive-abci/src/validation/state_transition/document_state_validation/validate_documents_batch_transition_state.rs @@ -123,7 +123,7 @@ fn validate_document_transitions_within_contract( let drive = platform.drive; // Data Contract must exist let Some(contract_fetch_info) = drive - .get_contract_with_fetch_info(data_contract_id.0 .0, None, false, transaction)? + .get_contract_with_fetch_info_and_fee(data_contract_id.0 .0, None, false, transaction)? .1 else { return Ok(ConsensusValidationResult::new_with_error(BasicError::DataContractNotPresentError(DataContractNotPresentError::new(*data_contract_id)).into())); diff --git a/packages/rs-drive-abci/src/validation/state_transition/documents_batch.rs b/packages/rs-drive-abci/src/validation/state_transition/documents_batch.rs index 6a250542dc..6e3e7f324a 100644 --- a/packages/rs-drive-abci/src/validation/state_transition/documents_batch.rs +++ b/packages/rs-drive-abci/src/validation/state_transition/documents_batch.rs @@ -73,7 +73,7 @@ impl StateTransitionValidation for DocumentsBatchTransition { // This block cache only gets merged to the main cache if the block is finalized let Some(contract_fetch_info) = drive - .get_contract_with_fetch_info(data_contract_id.0.0, None, true, tx)? + .get_contract_with_fetch_info_and_fee(data_contract_id.0.0, None, true, tx)? .1 else { result.add_error(BasicError::DataContractNotPresentError(DataContractNotPresentError::new( diff --git a/packages/rs-drive-abci/tests/strategy_tests/execution.rs b/packages/rs-drive-abci/tests/strategy_tests/execution.rs index f06971df24..8795f859e4 100644 --- a/packages/rs-drive-abci/tests/strategy_tests/execution.rs +++ b/packages/rs-drive-abci/tests/strategy_tests/execution.rs @@ -582,7 +582,7 @@ pub(crate) fn continue_chain_for_strategy( .expect("lock is poisoned") .last_committed_block_info .as_ref() - .map(|block_info| block_info.time_ms), + .map(|block_info| block_info.basic_info.time_ms), ) .expect("should calculate epoch info"); @@ -690,6 +690,7 @@ pub(crate) fn continue_chain_for_strategy( .last_committed_block_info .as_ref() .unwrap() + .basic_info .epoch .index; diff --git a/packages/rs-drive-abci/tests/strategy_tests/main.rs b/packages/rs-drive-abci/tests/strategy_tests/main.rs index bda62568c5..aa9165fad4 100644 --- a/packages/rs-drive-abci/tests/strategy_tests/main.rs +++ b/packages/rs-drive-abci/tests/strategy_tests/main.rs @@ -257,6 +257,7 @@ mod tests { .last_committed_block_info .as_ref() .unwrap() + .basic_info .height + 1; @@ -445,6 +446,7 @@ mod tests { .last_committed_block_info .as_ref() .unwrap() + .basic_info .epoch .index, 0 diff --git a/packages/rs-drive-abci/tests/strategy_tests/upgrade_fork_tests.rs b/packages/rs-drive-abci/tests/strategy_tests/upgrade_fork_tests.rs index afaa6103f7..c15a548521 100644 --- a/packages/rs-drive-abci/tests/strategy_tests/upgrade_fork_tests.rs +++ b/packages/rs-drive-abci/tests/strategy_tests/upgrade_fork_tests.rs @@ -87,6 +87,7 @@ mod tests { .last_committed_block_info .as_ref() .unwrap() + .basic_info .epoch .index, 0 @@ -116,6 +117,7 @@ mod tests { .last_committed_block_info .as_ref() .unwrap() + .basic_info .height + 1; @@ -159,6 +161,7 @@ mod tests { .last_committed_block_info .as_ref() .unwrap() + .basic_info .epoch .index, 1 @@ -189,6 +192,7 @@ mod tests { .last_committed_block_info .as_ref() .unwrap() + .basic_info .height + 1; let ChainExecutionOutcome { .. } = continue_chain_for_strategy( @@ -221,6 +225,7 @@ mod tests { .last_committed_block_info .as_ref() .unwrap() + .basic_info .epoch .index, 2 @@ -314,6 +319,7 @@ mod tests { .last_committed_block_info .as_ref() .unwrap() + .basic_info .epoch .index, 5 @@ -348,6 +354,7 @@ mod tests { .last_committed_block_info .as_ref() .unwrap() + .basic_info .height + 1; let ChainExecutionOutcome { @@ -387,6 +394,7 @@ mod tests { .last_committed_block_info .as_ref() .unwrap() + .basic_info .epoch .index, 11 @@ -416,6 +424,7 @@ mod tests { .last_committed_block_info .as_ref() .unwrap() + .basic_info .height + 1; let ChainExecutionOutcome { .. } = continue_chain_for_strategy( @@ -444,6 +453,7 @@ mod tests { .last_committed_block_info .as_ref() .unwrap() + .basic_info .epoch .index, 12 @@ -534,6 +544,7 @@ mod tests { .last_committed_block_info .as_ref() .unwrap() + .basic_info .epoch .index, 4 @@ -558,6 +569,7 @@ mod tests { .last_committed_block_info .as_ref() .unwrap() + .basic_info .height + 1; let ChainExecutionOutcome { @@ -597,6 +609,7 @@ mod tests { .last_committed_block_info .as_ref() .unwrap() + .basic_info .epoch .index, 8 @@ -650,6 +663,7 @@ mod tests { .last_committed_block_info .as_ref() .unwrap() + .basic_info .height + 1; config.block_spacing_ms = hour_in_ms / 5; //speed things up @@ -693,6 +707,7 @@ mod tests { .last_committed_block_info .as_ref() .unwrap() + .basic_info .epoch .index, 9 @@ -718,6 +733,7 @@ mod tests { .last_committed_block_info .as_ref() .unwrap() + .basic_info .height + 1; config.block_spacing_ms = hour_in_ms * 4; //let's try to move to next epoch @@ -752,6 +768,7 @@ mod tests { .last_committed_block_info .as_ref() .unwrap() + .basic_info .epoch .index, 10 @@ -842,6 +859,7 @@ mod tests { .last_committed_block_info .as_ref() .unwrap() + .basic_info .epoch .index, 3 @@ -897,6 +915,7 @@ mod tests { .last_committed_block_info .as_ref() .unwrap() + .basic_info .height + 1; let ChainExecutionOutcome { .. } = continue_chain_for_strategy( @@ -929,6 +948,7 @@ mod tests { .last_committed_block_info .as_ref() .unwrap() + .basic_info .epoch .index, 4 diff --git a/packages/rs-drive/Cargo.toml b/packages/rs-drive/Cargo.toml index 97f37a9f08..4375188e77 100644 --- a/packages/rs-drive/Cargo.toml +++ b/packages/rs-drive/Cargo.toml @@ -25,7 +25,6 @@ moka = { version = "0.10.1", features = ["future", "futures-util"] } nohash-hasher = { version = "0.2.0" } dpp = { path = "../rs-dpp", features = ["fixtures-and-mocks", "cbor"] } bincode = { version = "2.0.0-rc.3", features = ["serde"] } -dapi-grpc = { path = "../dapi-grpc" } # optional dependencies bs58 = { version = "0.4.0", optional = true } diff --git a/packages/rs-drive/src/drive/config.rs b/packages/rs-drive/src/drive/config.rs index 294333362f..87e0224a19 100644 --- a/packages/rs-drive/src/drive/config.rs +++ b/packages/rs-drive/src/drive/config.rs @@ -36,6 +36,10 @@ use serde::{Deserialize, Serialize}; pub const DEFAULT_GROVE_BATCHING_CONSISTENCY_VERIFICATION_ENABLED: bool = false; /// Boolean if GroveDB has_raw in enabled by default pub const DEFAULT_GROVE_HAS_RAW_ENABLED: bool = true; +/// The default default query limit +pub const DEFAULT_DEFAULT_QUERY_LIMIT: u16 = 100; +/// The default max query limit +pub const DEFAULT_MAX_QUERY_LIMIT: u16 = 100; /// Default maximum number of contracts in cache pub const DEFAULT_DATA_CONTRACTS_CACHE_SIZE: u64 = 500; @@ -52,27 +56,87 @@ pub enum DriveEncoding { /// Drive configuration struct pub struct DriveConfig { /// Boolean if batching consistency verification is enabled + #[serde(default = "default_batching_consistency_verification")] pub batching_consistency_verification: bool, /// Boolean if has_raw is enabled + #[serde(default = "default_has_raw_enabled")] pub has_raw_enabled: bool, + /// The default returned count if no limit is set + #[serde( + default = "default_default_query_limit", + deserialize_with = "from_str_or_number" + )] + pub default_query_limit: u16, + + /// The limit for user defined queries + #[serde( + default = "default_max_query_limit", + deserialize_with = "from_str_or_number" + )] + pub max_query_limit: u16, + /// Default genesis time + #[serde(default)] pub default_genesis_time: Option, /// Maximum number of contracts in global cache + #[serde( + default = "default_data_contracts_cache_size", + deserialize_with = "from_str_or_number" + )] pub data_contracts_global_cache_size: u64, /// Maximum number of contracts in block candidate cache + #[serde( + default = "default_data_contracts_cache_size", + deserialize_with = "from_str_or_number" + )] pub data_contracts_block_cache_size: u64, } +fn from_str_or_number<'de, D, T>(deserializer: D) -> Result +where + D: serde::Deserializer<'de>, + T: serde::Deserialize<'de> + std::str::FromStr, + ::Err: std::fmt::Display, +{ + use serde::de::Error; + + let s = String::deserialize(deserializer)?; + s.parse::().map_err(Error::custom) +} + +// Define default functions for serde +fn default_batching_consistency_verification() -> bool { + DEFAULT_GROVE_BATCHING_CONSISTENCY_VERIFICATION_ENABLED +} + +fn default_has_raw_enabled() -> bool { + DEFAULT_GROVE_HAS_RAW_ENABLED +} + +fn default_default_query_limit() -> u16 { + DEFAULT_DEFAULT_QUERY_LIMIT +} + +fn default_max_query_limit() -> u16 { + DEFAULT_MAX_QUERY_LIMIT +} + +fn default_data_contracts_cache_size() -> u64 { + DEFAULT_DATA_CONTRACTS_CACHE_SIZE +} + impl Default for DriveConfig { fn default() -> Self { DriveConfig { batching_consistency_verification: DEFAULT_GROVE_BATCHING_CONSISTENCY_VERIFICATION_ENABLED, has_raw_enabled: DEFAULT_GROVE_HAS_RAW_ENABLED, + default_query_limit: DEFAULT_DEFAULT_QUERY_LIMIT, + max_query_limit: DEFAULT_MAX_QUERY_LIMIT, default_genesis_time: None, data_contracts_global_cache_size: DEFAULT_DATA_CONTRACTS_CACHE_SIZE, data_contracts_block_cache_size: DEFAULT_DATA_CONTRACTS_CACHE_SIZE, diff --git a/packages/rs-drive/src/drive/contract/mod.rs b/packages/rs-drive/src/drive/contract/mod.rs index 6acfd62385..ff826dd680 100644 --- a/packages/rs-drive/src/drive/contract/mod.rs +++ b/packages/rs-drive/src/drive/contract/mod.rs @@ -44,6 +44,7 @@ pub(crate) mod queries; #[cfg(feature = "full")] use std::borrow::Cow; +use std::collections::BTreeMap; #[cfg(feature = "full")] use std::collections::{HashMap, HashSet}; #[cfg(feature = "full")] @@ -401,7 +402,29 @@ impl Drive { Ok(batch_operations) } - /// Update a data contract + /// Updates a data contract. + /// + /// This function updates a given data contract in the storage. The fee for updating + /// the contract is also calculated and returned. + /// + /// # Arguments + /// + /// * `contract` - A reference to the `DataContract` to be updated. + /// * `block_info` - A `BlockInfo` object containing information about the block where + /// the contract is being updated. + /// * `apply` - A boolean indicating whether the contract update should be applied (`true`) or not (`false`). Passing `false` would only tell the fees but won't interact with the state. + /// * `transaction` - A `TransactionArg` object representing the transaction to be used + /// for updating the contract. + /// + /// # Returns + /// + /// * `Result` - If successful, returns a `FeeResult` representing the fee + /// for updating the contract. If an error occurs during the contract update or fee calculation, + /// returns an `Error`. + /// + /// # Errors + /// + /// This function returns an error if the contract update or fee calculation fails. pub fn update_contract( &self, contract: &DataContract, @@ -739,8 +762,108 @@ impl Drive { encoding.encode_value(&value) } - /// Returns the contract with fetch info and operations with the given ID. + /// Retrieves the specified contracts along with their fetch info. + /// + /// # Arguments + /// + /// * `contract_ids` - A slice of contract IDs as 32-byte arrays. The contract IDs are used to + /// fetch the corresponding contracts and their fetch info. + /// * `add_to_cache_if_pulled` - A boolean indicating whether to add the fetched contracts to the + /// cache if they were pulled from storage. + /// * `transaction` - A `TransactionArg` object representing the transaction to be used + /// for fetching the contracts. + /// + /// # Returns + /// + /// * `Result>>, Error>` - If successful, + /// returns a `BTreeMap` where the keys are the contract IDs and the values are `Option`s + /// containing `Arc`s to `Contract`s. If an error occurs during the contract fetching, + /// returns an `Error`. + /// + /// # Errors + /// + /// This function returns an error if the contract fetching fails. + pub fn get_contracts_with_fetch_info( + &self, + contract_ids: &[[u8; 32]], + add_to_cache_if_pulled: bool, + transaction: TransactionArg, + ) -> Result>>, Error> { + contract_ids + .iter() + .map(|contract_id| { + Ok(( + *contract_id, + self.get_contract_with_fetch_info( + *contract_id, + add_to_cache_if_pulled, + transaction, + )?, + )) + }) + .collect() + } + + /// Retrieves the specified contract. + /// + /// # Arguments + /// + /// * `contract_id` - A contract ID as a 32-byte array. The contract ID is used to + /// fetch the corresponding contract. + /// * `add_to_cache_if_pulled` - A boolean indicating whether to add the fetched contract to the + /// cache if it was pulled from storage. + /// * `transaction` - A `TransactionArg` object representing the transaction to be used + /// for fetching the contract. + /// + /// # Returns + /// + /// * `Result>, Error>` - If successful, returns an `Option` containing a + /// reference to the fetched `Contract`. If an error occurs during the contract fetching, + /// returns an `Error`. + /// + /// # Errors + /// + /// This function returns an error if the contract fetching fails. pub fn get_contract_with_fetch_info( + &self, + contract_id: [u8; 32], + add_to_cache_if_pulled: bool, + transaction: TransactionArg, + ) -> Result>, Error> { + self.get_contract_with_fetch_info_and_add_to_operations( + contract_id, + None, + add_to_cache_if_pulled, + transaction, + &mut vec![], + ) + } + + /// Retrieves the specified contract along with its fetch info and calculates the fee if an epoch is provided. + /// + /// # Arguments + /// + /// * `contract_id` - A contract ID as a 32-byte array. The contract ID is used to + /// fetch the corresponding contract and its fetch info. + /// * `epoch` - An optional reference to an `Epoch` object. If provided, the function calculates + /// the fee for the contract operations. + /// * `add_to_cache_if_pulled` - A boolean indicating whether to add the fetched contract to the + /// cache if it was pulled from storage. + /// * `transaction` - A `TransactionArg` object representing the transaction to be used + /// + /// for fetching the contract. + /// + /// # Returns + /// + /// * `Result<(Option, Option>), Error>` - If successful, + /// returns a tuple containing an `Option` with the `FeeResult` (if an epoch was provided) and + /// an `Option` containing an `Arc` to the fetched `ContractFetchInfo`. If an error occurs + /// during the contract fetching or fee calculation, returns an `Error`. + /// + /// # Errors + /// + /// This function returns an error if the contract fetching or fee calculation fails. + pub fn get_contract_with_fetch_info_and_fee( &self, contract_id: [u8; 32], epoch: Option<&Epoch>, @@ -877,7 +1000,30 @@ impl Drive { .map(|fetch_info| Arc::clone(&fetch_info)) } - /// Returns the contract with the given ID from storage and also inserts it in cache. + /// Retrieves the specified contract from storage and inserts it into the cache. + /// + /// This function fetches the contract with the given ID from storage and, if successful, + /// inserts the contract into the cache. Additionally, the fee for the contract operations + /// is calculated if an epoch is provided. + /// + /// # Arguments + /// + /// * `contract_id` - A contract ID as a 32-byte array. The contract ID is used to + /// fetch the corresponding contract from storage. + /// * `epoch` - An optional reference to an `Epoch` object. If provided, the function calculates + /// the fee for the contract operations. + /// * `transaction` - A `TransactionArg` object representing the transaction to be used + /// for fetching the contract from storage. + /// + /// # Returns + /// + /// * `CostResult>, Error>` - If successful, returns a `CostResult` + /// containing an `Option` with an `Arc` to the fetched `ContractFetchInfo`. If an error occurs + /// during the contract fetching or fee calculation, returns an `Error`. + /// + /// # Errors + /// + /// This function returns an error if the contract fetching or fee calculation fails. pub fn fetch_contract( &self, contract_id: [u8; 32], @@ -938,7 +1084,30 @@ impl Drive { } /// Applies a contract and returns the fee for applying. - /// If the contract already exists, an update is applied, otherwise an insert. + /// + /// This function applies a given contract to the storage. If the contract already exists, + /// an update is performed; otherwise, a new contract is inserted. The fee for applying + /// the contract is also calculated and returned. + /// + /// # Arguments + /// + /// * `contract` - A reference to the `Contract` to be applied. + /// * `block_info` - A `BlockInfo` object containing information about the block where + /// the contract is being applied. + /// * `apply` - A boolean indicating whether the contract should be applied (`true`) or not (`false`). + /// * `storage_flags` - An optional `Cow` containing the storage flags for the contract. + /// * `transaction` - A `TransactionArg` object representing the transaction to be used + /// for applying the contract. + /// + /// # Returns + /// + /// * `Result` - If successful, returns a `FeeResult` representing the fee + /// for applying the contract. If an error occurs during the contract application or fee calculation, + /// returns an `Error`. + /// + /// # Errors + /// + /// This function returns an error if the contract application or fee calculation fails. pub fn apply_contract( &self, contract: &Contract, @@ -1405,7 +1574,7 @@ mod tests { .expect("should update contract"); let fetch_info_from_database = drive - .get_contract_with_fetch_info(contract.id.to_buffer(), None, true, None) + .get_contract_with_fetch_info_and_fee(contract.id.to_buffer(), None, true, None) .expect("should get contract") .1 .expect("should be present"); @@ -1413,7 +1582,7 @@ mod tests { assert_eq!(fetch_info_from_database.contract.version, 1); let fetch_info_from_cache = drive - .get_contract_with_fetch_info( + .get_contract_with_fetch_info_and_fee( contract.id.to_buffer(), None, true, @@ -1431,7 +1600,7 @@ mod tests { let drive = setup_drive_with_initial_state_structure(); let result = drive - .get_contract_with_fetch_info([0; 32], None, true, None) + .get_contract_with_fetch_info_and_fee([0; 32], None, true, None) .expect("should get contract"); assert!(result.0.is_none()); @@ -1443,7 +1612,12 @@ mod tests { let drive = setup_drive_with_initial_state_structure(); let result = drive - .get_contract_with_fetch_info([0; 32], Some(&Epoch::new(0).unwrap()), true, None) + .get_contract_with_fetch_info_and_fee( + [0; 32], + Some(&Epoch::new(0).unwrap()), + true, + None, + ) .expect("should get contract"); assert_eq!( @@ -1502,7 +1676,7 @@ mod tests { .expect("expected to apply contract successfully"); let mut ref_contract_fetch_info_transactional = drive - .get_contract_with_fetch_info( + .get_contract_with_fetch_info_and_fee( ref_contract_id_buffer, Some(&Epoch::new(0).unwrap()), true, @@ -1513,7 +1687,7 @@ mod tests { .expect("got contract fetch info"); let mut deep_contract_fetch_info_transactional = drive - .get_contract_with_fetch_info( + .get_contract_with_fetch_info_and_fee( deep_contract.id.to_buffer(), Some(&Epoch::new(0).unwrap()), true, @@ -1539,13 +1713,18 @@ mod tests { */ let deep_contract_fetch_info = drive - .get_contract_with_fetch_info(deep_contract.id.to_buffer(), None, true, None) + .get_contract_with_fetch_info_and_fee( + deep_contract.id.to_buffer(), + None, + true, + None, + ) .expect("got contract") .1 .expect("got contract fetch info"); let ref_contract_fetch_info = drive - .get_contract_with_fetch_info(ref_contract_id_buffer, None, true, None) + .get_contract_with_fetch_info_and_fee(ref_contract_id_buffer, None, true, None) .expect("got contract") .1 .expect("got contract fetch info"); @@ -1574,13 +1753,18 @@ mod tests { */ let deep_contract_fetch_info_without_cache = drive - .get_contract_with_fetch_info(deep_contract.id.to_buffer(), None, true, None) + .get_contract_with_fetch_info_and_fee( + deep_contract.id.to_buffer(), + None, + true, + None, + ) .expect("got contract") .1 .expect("got contract fetch info"); let ref_contract_fetch_info_without_cache = drive - .get_contract_with_fetch_info(ref_contract_id_buffer, None, true, None) + .get_contract_with_fetch_info_and_fee(ref_contract_id_buffer, None, true, None) .expect("got contract") .1 .expect("got contract fetch info"); @@ -1637,7 +1821,7 @@ mod tests { */ let mut deep_contract_fetch_info_transactional2 = drive - .get_contract_with_fetch_info( + .get_contract_with_fetch_info_and_fee( deep_contract.id.to_buffer(), Some(&Epoch::new(0).unwrap()), true, @@ -1648,7 +1832,7 @@ mod tests { .expect("got contract fetch info"); let mut ref_contract_fetch_info_transactional2 = drive - .get_contract_with_fetch_info( + .get_contract_with_fetch_info_and_fee( ref_contract_id_buffer, Some(&Epoch::new(0).unwrap()), true, diff --git a/packages/rs-drive/src/drive/contract/prove.rs b/packages/rs-drive/src/drive/contract/prove.rs index a34c6fa4d0..fe30c78b26 100644 --- a/packages/rs-drive/src/drive/contract/prove.rs +++ b/packages/rs-drive/src/drive/contract/prove.rs @@ -3,7 +3,26 @@ use crate::error::Error; use grovedb::TransactionArg; impl Drive { - /// Proves an Identity's balance from the backing store + /// Proves the existence of a specified contract. + /// + /// This function creates a path query for the provided contract ID and then proves + /// the existence of the contract in the context of the provided database `transaction`. + /// + /// # Arguments + /// + /// * `contract_id` - A contract ID as a 32-byte array. The contract ID is used to + /// create a path query for proving its existence. + /// * `transaction` - A `TransactionArg` object representing the transaction to be used + /// for proving the existence of the contract. This is either None or Some(&Transaction). + /// + /// # Returns + /// + /// * `Result, Error>` - If successful, returns a `Vec` containing the proof data. + /// If an error occurs during the proof generation, returns an `Error`. + /// + /// # Errors + /// + /// This function returns an error if the path query generation or proof generation fails. pub fn prove_contract( &self, contract_id: [u8; 32], @@ -12,4 +31,33 @@ impl Drive { let contract_query = Self::fetch_contract_query(contract_id); self.grove_get_proved_path_query(&contract_query, false, transaction, &mut vec![]) } + + /// Proves the existence of the specified contracts. + /// + /// This function creates a path query for each contract ID provided, and then proves + /// the existence of the contracts in the context of the provided database `transaction`. + /// + /// # Arguments + /// + /// * `contract_ids` - A slice of contract IDs as 32-byte arrays. Each contract ID is used to + /// create a path query for proving its existence. + /// * `transaction` - A `TransactionArg` object representing the transaction to be used + /// for proving the existence of the contracts. This is either None or Some(&Transaction). + /// + /// # Returns + /// + /// * `Result, Error>` - If successful, returns a `Vec` containing the proof data. + /// If an error occurs during the proof generation, returns an `Error`. + /// + /// # Errors + /// + /// This function returns an error if the path query generation or proof generation fails. + pub fn prove_contracts( + &self, + contract_ids: &[[u8; 32]], + transaction: TransactionArg, + ) -> Result, Error> { + let contracts_query = Self::fetch_contracts_query(contract_ids)?; + self.grove_get_proved_path_query(&contracts_query, false, transaction, &mut vec![]) + } } diff --git a/packages/rs-drive/src/drive/contract/queries.rs b/packages/rs-drive/src/drive/contract/queries.rs index aa2862b537..add61e024d 100644 --- a/packages/rs-drive/src/drive/contract/queries.rs +++ b/packages/rs-drive/src/drive/contract/queries.rs @@ -1,11 +1,51 @@ use crate::drive::contract::paths::contract_storage_path_vec; use crate::drive::Drive; +use crate::error::Error; +use crate::error::Error::GroveDB; use grovedb::PathQuery; impl Drive { - /// The query for proving a contract from a contract id. + /// Creates a path query for a specified contract. + /// + /// This function takes a contract ID and creates a path query for fetching the contract data. + /// + /// # Arguments + /// + /// * `contract_id` - A contract ID as a 32-byte array. The contract ID is used to + /// create the path query. + /// + /// # Returns + /// + /// * `PathQuery` - A `PathQuery` object representing the query for fetching the contract data. pub fn fetch_contract_query(contract_id: [u8; 32]) -> PathQuery { let contract_path = contract_storage_path_vec(contract_id.as_slice()); PathQuery::new_single_key(contract_path, contract_id.to_vec()) } + + /// Creates a merged path query for multiple contracts. + /// + /// This function takes a slice of contract IDs and creates a merged path query for fetching + /// the data of all specified contracts. + /// + /// # Arguments + /// + /// * `contract_ids` - A slice of contract IDs as 32-byte arrays. The contract IDs are used to + /// create the path queries. + /// + /// # Returns + /// + /// * `Result` - If successful, returns a `PathQuery` object representing the + /// merged query for fetching the contracts' data. If an error occurs during the merging of + /// path queries, returns an `Error`. + /// + /// # Errors + /// + /// This function returns an error if the merging of path queries fails. + pub fn fetch_contracts_query(contract_ids: &[[u8; 32]]) -> Result { + let mut queries = Vec::new(); + for contract_id in contract_ids { + queries.push(Self::fetch_contract_query(*contract_id)); + } + PathQuery::merge(queries.iter().collect()).map_err(GroveDB) + } } diff --git a/packages/rs-drive/src/drive/document/delete.rs b/packages/rs-drive/src/drive/document/delete.rs index c2572cca2e..d099ae324b 100644 --- a/packages/rs-drive/src/drive/document/delete.rs +++ b/packages/rs-drive/src/drive/document/delete.rs @@ -813,6 +813,7 @@ mod tests { use super::*; use crate::common::{cbor_from_hex, setup_contract, setup_contract_from_cbor_hex}; + use crate::drive::config::DriveConfig; use crate::drive::document::tests::setup_dashpay; use crate::drive::flags::StorageFlags; use crate::drive::object_size_info::DocumentAndContractInfo; @@ -876,7 +877,8 @@ mod tests { let sql_string = "select * from person where firstName = 'Samuel' order by firstName asc limit 100"; - let query = DriveQuery::from_sql_expr(sql_string, &contract).expect("should build query"); + let query = DriveQuery::from_sql_expr(sql_string, &contract, &DriveConfig::default()) + .expect("should build query"); let (results_no_transaction, _, _) = query .execute_raw_results_no_proof(&drive, None, None) @@ -973,7 +975,8 @@ mod tests { let sql_string = "select * from person where firstName = 'Samuel' order by firstName asc limit 100"; - let query = DriveQuery::from_sql_expr(sql_string, &contract).expect("should build query"); + let query = DriveQuery::from_sql_expr(sql_string, &contract, &DriveConfig::default()) + .expect("should build query"); let (results_no_transaction, _, _) = query .execute_raw_results_no_proof(&drive, None, None) @@ -1139,7 +1142,8 @@ mod tests { let sql_string = "select * from person where firstName > 'A' order by firstName asc limit 5"; - let query = DriveQuery::from_sql_expr(sql_string, &contract).expect("should build query"); + let query = DriveQuery::from_sql_expr(sql_string, &contract, &DriveConfig::default()) + .expect("should build query"); let (results_no_transaction, _, _) = query .execute_raw_results_no_proof(&drive, None, None) @@ -1176,7 +1180,8 @@ mod tests { let sql_string = "select * from person where firstName > 'A' order by firstName asc limit 5"; - let query = DriveQuery::from_sql_expr(sql_string, &contract).expect("should build query"); + let query = DriveQuery::from_sql_expr(sql_string, &contract, &DriveConfig::default()) + .expect("should build query"); let (results_no_transaction, _, _) = query .execute_raw_results_no_proof(&drive, None, None) @@ -1213,7 +1218,8 @@ mod tests { let sql_string = "select * from person where firstName > 'A' order by firstName asc limit 5"; - let query = DriveQuery::from_sql_expr(sql_string, &contract).expect("should build query"); + let query = DriveQuery::from_sql_expr(sql_string, &contract, &DriveConfig::default()) + .expect("should build query"); let (results_no_transaction, _, _) = query .execute_raw_results_no_proof(&drive, None, None) @@ -1308,7 +1314,8 @@ mod tests { let sql_string = "select * from person where firstName > 'A' order by firstName asc limit 5"; - let query = DriveQuery::from_sql_expr(sql_string, &contract).expect("should build query"); + let query = DriveQuery::from_sql_expr(sql_string, &contract, &DriveConfig::default()) + .expect("should build query"); let (results_no_transaction, _, _) = query .execute_raw_results_no_proof(&drive, None, None) @@ -1415,7 +1422,8 @@ mod tests { let sql_string = "select * from person where firstName > 'A' order by firstName asc limit 5"; - let query = DriveQuery::from_sql_expr(sql_string, &contract).expect("should build query"); + let query = DriveQuery::from_sql_expr(sql_string, &contract, &DriveConfig::default()) + .expect("should build query"); let (results_no_transaction, _, _) = query .execute_raw_results_no_proof(&drive, None, None) diff --git a/packages/rs-drive/src/drive/document/index_uniqueness.rs b/packages/rs-drive/src/drive/document/index_uniqueness.rs index 19f70bfc83..e66b95793a 100644 --- a/packages/rs-drive/src/drive/document/index_uniqueness.rs +++ b/packages/rs-drive/src/drive/document/index_uniqueness.rs @@ -218,7 +218,7 @@ impl Drive { order_by: Default::default(), start_at: None, start_at_included: false, - block_time: None, + block_time_ms: None, }; let query_result = self.query_documents(query, None, false, transaction); diff --git a/packages/rs-drive/src/drive/document/update.rs b/packages/rs-drive/src/drive/document/update.rs index 6f0a2f784f..61c37a76aa 100644 --- a/packages/rs-drive/src/drive/document/update.rs +++ b/packages/rs-drive/src/drive/document/update.rs @@ -858,7 +858,8 @@ mod tests { .expect("should create alice profile"); let sql_string = "select * from profile"; - let query = DriveQuery::from_sql_expr(sql_string, &contract).expect("should build query"); + let query = DriveQuery::from_sql_expr(sql_string, &contract, &DriveConfig::default()) + .expect("should build query"); let (results_no_transaction, _, _) = query .execute_raw_results_no_proof(&drive, None, None) @@ -953,7 +954,8 @@ mod tests { .expect("should commit transaction"); let sql_string = "select * from profile"; - let query = DriveQuery::from_sql_expr(sql_string, &contract).expect("should build query"); + let query = DriveQuery::from_sql_expr(sql_string, &contract, &DriveConfig::default()) + .expect("should build query"); let (results_no_transaction, _, _) = query .execute_raw_results_no_proof(&drive, None, None) @@ -1062,7 +1064,8 @@ mod tests { .expect("should commit transaction"); let sql_string = "select * from profile"; - let query = DriveQuery::from_sql_expr(sql_string, &contract).expect("should build query"); + let query = DriveQuery::from_sql_expr(sql_string, &contract, &DriveConfig::default()) + .expect("should build query"); let (results_no_transaction, _, _) = query .execute_raw_results_no_proof(&drive, None, None) diff --git a/packages/rs-drive/src/drive/identity/fetch/fetch_by_public_key_hashes.rs b/packages/rs-drive/src/drive/identity/fetch/fetch_by_public_key_hashes.rs index 2668a91ebc..c9e5605331 100644 --- a/packages/rs-drive/src/drive/identity/fetch/fetch_by_public_key_hashes.rs +++ b/packages/rs-drive/src/drive/identity/fetch/fetch_by_public_key_hashes.rs @@ -325,30 +325,6 @@ impl Drive { encoding.encode_value(&identity_value) } - /// Fetches an identity with all its information from storage. - pub fn fetch_serialized_full_identities_by_unique_public_key_hashes( - &self, - public_key_hashes: &[[u8; 20]], - encoding: QueryResultEncoding, - transaction: TransactionArg, - ) -> Result, Error> { - let identities = self - .fetch_full_identities_by_unique_public_key_hashes(public_key_hashes, transaction)? - .into_iter() - .map(|(key, value)| { - Ok(( - key.into(), - value - .map(|identity| identity.to_cleaned_object()) - .transpose()? - .into(), - )) - }) - .collect::, Error>>()?; - - encoding.encode_value(&identities.into()) - } - /// Fetches an identity with all its information from storage. pub fn fetch_full_identity_by_unique_public_key_hash( &self, diff --git a/packages/rs-drive/src/drive/identity/fetch/revision.rs b/packages/rs-drive/src/drive/identity/fetch/revision.rs index e6f6edc2a3..4ad067dce6 100644 --- a/packages/rs-drive/src/drive/identity/fetch/revision.rs +++ b/packages/rs-drive/src/drive/identity/fetch/revision.rs @@ -9,6 +9,7 @@ use crate::fee::calculate_fee; use crate::fee::op::LowLevelDriveOperation; use crate::fee::result::FeeResult; use dpp::block::block_info::BlockInfo; +use dpp::prelude::Revision; use grovedb::Element::Item; use grovedb::TransactionArg; @@ -20,7 +21,7 @@ impl Drive { identity_id: [u8; 32], apply: bool, transaction: TransactionArg, - ) -> Result, Error> { + ) -> Result, Error> { let mut drive_operations: Vec = vec![]; self.fetch_identity_revision_operations( identity_id, @@ -38,7 +39,7 @@ impl Drive { block_info: &BlockInfo, apply: bool, transaction: TransactionArg, - ) -> Result<(Option, FeeResult), Error> { + ) -> Result<(Option, FeeResult), Error> { let mut drive_operations: Vec = vec![]; let value = self.fetch_identity_revision_operations( identity_id, @@ -58,7 +59,7 @@ impl Drive { apply: bool, transaction: TransactionArg, drive_operations: &mut Vec, - ) -> Result, Error> { + ) -> Result, Error> { let direct_query_type = if apply { DirectQueryType::StatefulDirectQuery } else { @@ -76,11 +77,12 @@ impl Drive { drive_operations, ) { Ok(Some(Item(encoded_revision, _))) => { - let revision = u64::from_be_bytes(encoded_revision.try_into().map_err(|_| { - Error::Drive(DriveError::CorruptedElementType( - "identity revision was not 8 bytes as expected", - )) - })?); + let revision = + Revision::from_be_bytes(encoded_revision.try_into().map_err(|_| { + Error::Drive(DriveError::CorruptedElementType( + "identity revision was not 8 bytes as expected", + )) + })?); Ok(Some(revision)) } diff --git a/packages/rs-drive/src/drive/identity/key/fetch.rs b/packages/rs-drive/src/drive/identity/key/fetch.rs index b272d70ca9..649648b759 100644 --- a/packages/rs-drive/src/drive/identity/key/fetch.rs +++ b/packages/rs-drive/src/drive/identity/key/fetch.rs @@ -81,9 +81,11 @@ pub enum KeyRequestType { } #[cfg(any(feature = "full", feature = "verify"))] -type PurposeU8 = u8; +/// The key purpose as u8. +pub type PurposeU8 = u8; #[cfg(any(feature = "full", feature = "verify"))] -type SecurityLevelU8 = u8; +/// The key security level as u8. +pub type SecurityLevelU8 = u8; #[cfg(feature = "full")] /// Type alias for a hashset of IdentityPublicKey Ids as the outcome of the query. @@ -93,6 +95,14 @@ pub type KeyIDHashSet = HashSet; /// Type alias for a vec of IdentityPublicKey Ids as the outcome of the query. pub type KeyIDVec = Vec; +#[cfg(feature = "full")] +/// Type alias for a vec of IdentityPublicKeys as the outcome of the query. +pub type KeyVec = Vec; + +#[cfg(feature = "full")] +/// Type alias for a vec of serialized IdentityPublicKeys as the outcome of the query. +pub type SerializedKeyVec = Vec>; + #[cfg(feature = "full")] /// Type alias for a single IdentityPublicKey as the outcome of the query. pub type SingleIdentityPublicKeyOutcome = IdentityPublicKey; @@ -139,6 +149,17 @@ pub trait IdentityPublicKeyResult { Self: Sized; } +#[cfg(feature = "full")] +fn element_to_serialized_identity_public_key(element: Element) -> Result, Error> { + let Item(value, _) = element else { + return Err(Error::Drive(DriveError::CorruptedElementType( + "expected item for identity public key", + ))) + }; + + Ok(value) +} + #[cfg(feature = "full")] fn element_to_identity_public_key(element: Element) -> Result { let Item(value, _) = element else { @@ -195,6 +216,19 @@ fn supported_query_result_element_to_identity_public_key( } } +#[cfg(feature = "full")] +fn supported_query_result_element_to_serialized_identity_public_key( + query_result_element: QueryResultElement, +) -> Result, Error> { + match query_result_element { + QueryResultElement::ElementResultItem(element) + | QueryResultElement::KeyElementPairResultItem((_, element)) + | QueryResultElement::PathKeyElementTrioResultItem((_, _, element)) => { + element_to_serialized_identity_public_key(element) + } + } +} + #[cfg(feature = "full")] fn supported_query_result_element_to_identity_public_key_id( query_result_element: QueryResultElement, @@ -353,6 +387,46 @@ impl IdentityPublicKeyResult for KeyIDVec { } } +#[cfg(feature = "full")] +impl IdentityPublicKeyResult for KeyVec { + fn try_from_path_key_optional(value: Vec) -> Result { + // We do not care about non existence + value + .into_iter() + .filter_map(|(_, _, maybe_element)| maybe_element) + .map(element_to_identity_public_key) + .collect() + } + + fn try_from_query_results(value: QueryResultElements) -> Result { + value + .elements + .into_iter() + .map(supported_query_result_element_to_identity_public_key) + .collect() + } +} + +#[cfg(feature = "full")] +impl IdentityPublicKeyResult for SerializedKeyVec { + fn try_from_path_key_optional(value: Vec) -> Result { + // We do not care about non existence + value + .into_iter() + .filter_map(|(_, _, maybe_element)| maybe_element) + .map(element_to_serialized_identity_public_key) + .collect() + } + + fn try_from_query_results(value: QueryResultElements) -> Result { + value + .elements + .into_iter() + .map(supported_query_result_element_to_serialized_identity_public_key) + .collect() + } +} + #[cfg(feature = "full")] impl IdentityPublicKeyResult for KeyIDIdentityPublicKeyPairVec { fn try_from_path_key_optional(value: Vec) -> Result { @@ -796,6 +870,44 @@ impl Drive { } } } + + /// Fetches all keys associated with the specified identities. + /// + /// This function retrieves all keys associated with each identity ID provided + /// and returns the result as a `BTreeMap` mapping the identity IDs to their respective keys. + /// + /// # Arguments + /// + /// * `identity_ids` - A slice of identity IDs as 32-byte arrays. Each identity ID is used to + /// fetch its associated keys. + /// * `transaction` - A `TransactionArg` object representing the transaction to be used + /// for fetching the keys. + /// + /// # Returns + /// + /// * `Result>>, Error>` - If successful, + /// returns a `BTreeMap` where the keys are the identity IDs and the values are `Vec`s containing + /// `BTreeMap`s mapping `KeyID`s to `IdentityPublicKey`s. If an error occurs during the key + /// fetching, returns an `Error`. + /// + /// # Errors + /// + /// This function returns an error if the key fetching fails. + pub fn fetch_identities_all_keys( + &self, + identity_ids: &[[u8; 32]], + transaction: TransactionArg, + ) -> Result>, Error> { + identity_ids + .iter() + .map(|identity_id| { + Ok(( + *identity_id, + Self::fetch_all_identity_keys(&self, *identity_id, transaction)?, + )) + }) + .collect() + } } #[cfg(feature = "full")] diff --git a/packages/rs-drive/src/drive/identity/key/mod.rs b/packages/rs-drive/src/drive/identity/key/mod.rs index 1474c67375..3764e2754c 100644 --- a/packages/rs-drive/src/drive/identity/key/mod.rs +++ b/packages/rs-drive/src/drive/identity/key/mod.rs @@ -5,6 +5,12 @@ pub mod fetch; pub(crate) mod insert; #[cfg(feature = "full")] pub(crate) mod insert_key_hash_identity_reference; +#[cfg(feature = "full")] +/// Prove module +pub mod prove; +#[cfg(any(feature = "full", feature = "verify"))] +/// Queries module +pub mod queries; #[cfg(feature = "full")] /// Apply info for a contract diff --git a/packages/rs-drive/src/drive/identity/key/prove.rs b/packages/rs-drive/src/drive/identity/key/prove.rs new file mode 100644 index 0000000000..1022fd313e --- /dev/null +++ b/packages/rs-drive/src/drive/identity/key/prove.rs @@ -0,0 +1,67 @@ +use crate::drive::identity::key::fetch::IdentityKeysRequest; +use crate::drive::Drive; +use crate::error::Error; +use grovedb::TransactionArg; + +impl Drive { + /// Proves the existence of all keys associated with the specified identities. + /// + /// This function creates a path query for each identity ID provided, requesting + /// all keys associated with each identity. It then proves the existence of the keys + /// using the provided `transaction`. + /// + /// # Arguments + /// + /// * `identity_ids` - A slice of identity IDs as 32-byte arrays. Each identity ID is used to + /// create a path query for proving its associated keys. + /// * `limit` - An optional `u16` value specifying the maximum number of keys to fetch for each + /// identity. If `None`, fetches all available keys. + /// * `transaction` - A `TransactionArg` object representing the transaction to be used + /// for proving the existence of the keys. + /// + /// # Returns + /// + /// * `Result, Error>` - If successful, returns a `Vec` containing the proof data. + /// If an error occurs during the proof generation, returns an `Error`. + /// + /// # Errors + /// + /// This function returns an error if the path query generation or proof generation fails. + + pub fn prove_identities_all_keys( + &self, + identity_ids: &[[u8; 32]], + limit: Option, + transaction: TransactionArg, + ) -> Result, Error> { + let identity_query = Self::fetch_identities_all_keys_query(&self, identity_ids, limit)?; + self.grove_get_proved_path_query(&identity_query, false, transaction, &mut vec![]) + } + + /// Prove the requested identity keys. + /// + /// This function takes an `IdentityKeysRequest` and a `TransactionArg` as arguments + /// and returns a proof of the requested identity keys as a `Vec` or an error + /// if the proof cannot be generated. + /// + /// # Arguments + /// + /// * `key_request` - An `IdentityKeysRequest` containing the details of the + /// requested identity keys, such as the identity ID, request type, limit, and offset. + /// * `transaction` - A `TransactionArg` representing the current transaction. + /// + /// # Returns + /// + /// * `Ok(Vec)` - A proof of the requested identity keys as a `Vec` if the + /// proof is successfully generated. + /// * `Err(Error)` - An error if the proof cannot be generated. + /// + pub fn prove_identity_keys( + &self, + key_request: IdentityKeysRequest, + transaction: TransactionArg, + ) -> Result, Error> { + let identity_query = key_request.into_path_query(); + self.grove_get_proved_path_query(&identity_query, false, transaction, &mut vec![]) + } +} diff --git a/packages/rs-drive/src/drive/identity/key/queries.rs b/packages/rs-drive/src/drive/identity/key/queries.rs new file mode 100644 index 0000000000..9db5889d9a --- /dev/null +++ b/packages/rs-drive/src/drive/identity/key/queries.rs @@ -0,0 +1,45 @@ +use crate::drive::identity::key::fetch::IdentityKeysRequest; +use crate::drive::Drive; +use crate::error::Error; +use crate::error::Error::GroveDB; +use grovedb::PathQuery; + +impl Drive { + /// Fetches the path queries for all keys associated with the specified identities. + /// + /// This function creates path queries for each identity ID provided, requesting + /// all keys associated with each identity. It then merges the path queries into a single + /// path query. + /// + /// # Arguments + /// + /// * `identity_ids` - A slice of identity IDs as 32-byte arrays. Each identity ID is used to + /// create a path query for fetching its associated keys. + /// * `limit` - An optional `u16` value specifying the maximum number of keys to fetch for each + /// identity. If `None`, fetches all available keys. + /// + /// # Returns + /// + /// * `Result` - If successful, returns a `PathQuery` object containing the + /// merged path queries. If an error occurs during merging, returns an `Error`. + /// + /// # Errors + /// + /// This function returns an error if the merging of path queries fails. + pub fn fetch_identities_all_keys_query( + &self, + identity_ids: &[[u8; 32]], + limit: Option, + ) -> Result { + let path_queries = identity_ids + .iter() + .map(|identity_id| { + let key_request = + IdentityKeysRequest::new_all_keys_query(identity_id, limit.clone()); + key_request.into_path_query() + }) + .collect::>(); + + PathQuery::merge(path_queries.iter().collect()).map_err(GroveDB) + } +} diff --git a/packages/rs-drive/src/drive/identity/withdrawals/documents.rs b/packages/rs-drive/src/drive/identity/withdrawals/documents.rs index d58c1f4174..f7f62b5d8c 100644 --- a/packages/rs-drive/src/drive/identity/withdrawals/documents.rs +++ b/packages/rs-drive/src/drive/identity/withdrawals/documents.rs @@ -24,7 +24,12 @@ impl Drive { let data_contract_id = withdrawals_contract::CONTRACT_ID.deref(); let contract_fetch_info = self - .get_contract_with_fetch_info(data_contract_id.to_buffer(), None, true, transaction)? + .get_contract_with_fetch_info_and_fee( + data_contract_id.to_buffer(), + None, + true, + transaction, + )? .1 .ok_or_else(|| { Error::Drive(DriveError::CorruptedCodeExecution( @@ -73,7 +78,7 @@ impl Drive { order_by, start_at: None, start_at_included: false, - block_time: None, + block_time_ms: None, }; let QuerySerializedDocumentsOutcome { @@ -107,7 +112,12 @@ impl Drive { let data_contract_id = withdrawals_contract::CONTRACT_ID.deref(); let contract_fetch_info = self - .get_contract_with_fetch_info(data_contract_id.to_buffer(), None, true, transaction)? + .get_contract_with_fetch_info_and_fee( + data_contract_id.to_buffer(), + None, + true, + transaction, + )? .1 .ok_or_else(|| { Error::Drive(DriveError::CorruptedCodeExecution( @@ -154,7 +164,7 @@ impl Drive { order_by: IndexMap::new(), start_at: None, start_at_included: false, - block_time: None, + block_time_ms: None, }; let QuerySerializedDocumentsOutcome { diff --git a/packages/rs-drive/src/drive/query/mod.rs b/packages/rs-drive/src/drive/query/mod.rs index 0e5cba9f4b..9431cdf52f 100644 --- a/packages/rs-drive/src/drive/query/mod.rs +++ b/packages/rs-drive/src/drive/query/mod.rs @@ -34,11 +34,10 @@ use grovedb::query_result_type::{Key, QueryResultType}; use grovedb::TransactionArg; -use std::collections::BTreeMap; use crate::contract::Contract; use crate::drive::Drive; -use crate::error::query::QueryError; +use crate::error::query::QuerySyntaxError; use crate::error::Error; use crate::fee::calculate_fee; use crate::fee::op::LowLevelDriveOperation; @@ -46,13 +45,9 @@ use crate::query::DriveQuery; use dpp::data_contract::document_type::DocumentType; use dpp::document::Document; -use dpp::platform_value::btreemap_extensions::{ - BTreeValueRemoveFromMapHelper, BTreeValueRemoveInnerValueFromMapHelper, -}; -use dpp::platform_value::{Bytes20, Value}; + use dpp::ProtocolError; -use crate::query::QueryResultEncoding::CborEncodedQueryResult; use dpp::block::block_info::BlockInfo; use dpp::block::epoch::Epoch; @@ -88,132 +83,6 @@ pub struct QueryDocumentIdsOutcome { } impl Drive { - /// Performs and returns the result of the specified query along with skipped items - /// and the cost. - pub fn query_serialized( - &self, - serialized_query: Vec, - path: String, - prove: bool, - ) -> Result, Error> { - let mut query: BTreeMap = - ciborium::de::from_reader(serialized_query.as_slice()).map_err(|e| { - ProtocolError::DecodingError(format!("Unable to decode identity CBOR: {}", e)) - })?; - match path.as_str() { - "/identity/balance" => { - let identity_id = query.remove_identifier("identityId")?; - if prove { - self.prove_identity_balance(identity_id.into_buffer(), None) - } else { - self.fetch_serialized_identity_balance( - identity_id.into_buffer(), - CborEncodedQueryResult, - None, - ) - } - } - "/identity/balanceAndRevision" => { - let identity_id = query.remove_identifier("identityId")?; - if prove { - self.prove_identity_balance_and_revision(identity_id.into_buffer(), None) - } else { - self.fetch_serialized_identity_balance_and_revision( - identity_id.into_buffer(), - CborEncodedQueryResult, - None, - ) - } - } - "/identities/keys" => { - // let identity_id = query.remove_identifier("identityIds")?; - // let request = query.str_val("keyRequest")?; - todo!() - } - "/dataContract" => { - let contract_id = query.remove_identifier("contractId")?; - if prove { - self.prove_contract(contract_id.into_buffer(), None) - } else { - self.query_contract_as_serialized( - contract_id.into_buffer(), - CborEncodedQueryResult, - None, - ) - } - } - "/documents" | "/dataContract/documents" => { - let contract_id = query.remove_identifier("contractId")?; - let (_, contract) = - self.get_contract_with_fetch_info(contract_id.to_buffer(), None, true, None)?; - let contract = contract.ok_or(Error::Query(QueryError::ContractNotFound( - "contract not found when querying from value with contract info", - )))?; - let contract_ref = &contract.contract; - let document_type_name = query.remove_string("type")?; - let document_type = - contract_ref.document_type_for_name(document_type_name.as_str())?; - let drive_query = - DriveQuery::from_btree_map_value(query, contract_ref, document_type)?; - if prove { - drive_query.execute_with_proof_internal(self, None, &mut vec![]) - } else { - drive_query.execute_serialized_as_result_no_proof( - self, - None, - CborEncodedQueryResult, - None, - ) - } - } - "/proofs" => { - if prove { - todo!() - } else { - todo!() - } - } - "/identity/by-public-key-hash" => { - let public_key_hash = query.remove_bytes_20("publicKeyHash")?; - if prove { - self.prove_full_identity_by_unique_public_key_hash( - public_key_hash.into_buffer(), - None, - ) - } else { - self.fetch_serialized_full_identity_by_unique_public_key_hash( - public_key_hash.into_buffer(), - CborEncodedQueryResult, - None, - ) - } - } - "/identities/by-public-key-hash" => { - let public_key_hashes_values: Vec<_> = - query.remove_inner_value_array("publicKeyHashes")?; - let public_key_hashes = public_key_hashes_values - .into_iter() - .map(|pub_key_hash_value| { - pub_key_hash_value.into_bytes_20().map(|bytes| bytes.0) - }) - .collect::, dpp::platform_value::Error>>()?; - if prove { - self.prove_full_identities_by_unique_public_key_hashes(&public_key_hashes, None) - } else { - self.fetch_serialized_full_identities_by_unique_public_key_hashes( - public_key_hashes.as_slice(), - CborEncodedQueryResult, - None, - ) - } - } - other => Err(Error::Query(QueryError::Unsupported(format!( - "query path '{}' is not supported", - other - )))), - } - } - /// Performs and returns the result of the specified query along with skipped items /// and the cost. pub fn query_documents( @@ -330,14 +199,15 @@ impl Drive { transaction, &mut drive_operations, )? - .ok_or(Error::Query(QueryError::ContractNotFound( + .ok_or(Error::Query(QuerySyntaxError::ContractNotFound( "contract not found", )))?; let document_type = contract .contract .document_type_for_name(document_type_name)?; - let query = DriveQuery::from_cbor(query_cbor, &contract.contract, document_type)?; + let query = + DriveQuery::from_cbor(query_cbor, &contract.contract, document_type, &self.config)?; self.query_documents_as_serialized(query, epoch, transaction) } @@ -433,7 +303,7 @@ impl Drive { transaction: TransactionArg, drive_operations: &mut Vec, ) -> Result<(Vec>, u16), Error> { - let query = DriveQuery::from_cbor(query_cbor, contract, document_type)?; + let query = DriveQuery::from_cbor(query_cbor, contract, document_type, &self.config)?; query.execute_raw_results_no_proof_internal(self, transaction, drive_operations) } @@ -458,7 +328,7 @@ impl Drive { transaction, &mut drive_operations, )? - .ok_or(Error::Query(QueryError::ContractNotFound( + .ok_or(Error::Query(QuerySyntaxError::ContractNotFound( "contract not found", )))?; let document_type = contract @@ -518,7 +388,7 @@ impl Drive { transaction: TransactionArg, drive_operations: &mut Vec, ) -> Result, Error> { - let query = DriveQuery::from_cbor(query_cbor, contract, document_type)?; + let query = DriveQuery::from_cbor(query_cbor, contract, document_type, &self.config)?; query.execute_with_proof_internal(self, transaction, drive_operations) } @@ -560,7 +430,7 @@ impl Drive { transaction: TransactionArg, drive_operations: &mut Vec, ) -> Result<([u8; 32], Vec>), Error> { - let query = DriveQuery::from_cbor(query_cbor, contract, document_type)?; + let query = DriveQuery::from_cbor(query_cbor, contract, document_type, &self.config)?; query.execute_with_proof_only_get_elements_internal(self, transaction, drive_operations) } diff --git a/packages/rs-drive/src/drive/verify/mod.rs b/packages/rs-drive/src/drive/verify/mod.rs index 546835f233..e22686a1c6 100644 --- a/packages/rs-drive/src/drive/verify/mod.rs +++ b/packages/rs-drive/src/drive/verify/mod.rs @@ -7,7 +7,7 @@ use crate::drive::{unique_key_hashes_tree_path_vec, Drive}; use crate::error::proof::ProofError; use crate::error::Error; use crate::fee::credits::Credits; -use crate::query::DriveQuery; + use dpp::identifier::Identifier; use dpp::identity::{IdentityPublicKey, KeyID}; pub use dpp::prelude::{Identity, Revision}; diff --git a/packages/rs-drive/src/error/mod.rs b/packages/rs-drive/src/error/mod.rs index fc924d5002..2ad881d87e 100644 --- a/packages/rs-drive/src/error/mod.rs +++ b/packages/rs-drive/src/error/mod.rs @@ -6,7 +6,7 @@ use dpp::platform_value::Error as ValueError; use dpp::ProtocolError; use fee::FeeError; use identity::IdentityError; -use query::QueryError; +use query::QuerySyntaxError; /// Document module pub mod document; @@ -28,7 +28,7 @@ pub mod storage_flags; pub enum Error { /// Query error #[error("query: {0}")] - Query(#[from] QueryError), + Query(#[from] QuerySyntaxError), /// Storage Flags error #[error("storage flags: {0}")] StorageFlags(#[from] StorageFlagsError), diff --git a/packages/rs-drive/src/error/query.rs b/packages/rs-drive/src/error/query.rs index ad132a9371..b0439ee2dc 100644 --- a/packages/rs-drive/src/error/query.rs +++ b/packages/rs-drive/src/error/query.rs @@ -1,6 +1,6 @@ /// Query errors #[derive(Debug, thiserror::Error)] -pub enum QueryError { +pub enum QuerySyntaxError { /// Deserialization #[error("deserialization error: {0}")] DeserializationError(String), @@ -58,9 +58,15 @@ pub enum QueryError { /// Invalid contract id error #[error("invalid contract id error: {0}")] InvalidContractId(&'static str), + /// Query for a key has an invalid parameter + #[error("query invalid key parameter error: {0}")] + InvalidKeyParameter(String), /// Query invalid limit error #[error("query invalid limit error: {0}")] - InvalidLimit(&'static str), + InvalidLimit(String), + /// Query invalid parameter error + #[error("query invalid parameter error: {0}")] + InvalidParameter(String), /// Query invalid format for where clause error #[error("query invalid format for where clause error: {0}")] InvalidFormatWhereClause(&'static str), diff --git a/packages/rs-drive/src/query/conditions.rs b/packages/rs-drive/src/query/conditions.rs index d853cf8a74..192241813b 100644 --- a/packages/rs-drive/src/query/conditions.rs +++ b/packages/rs-drive/src/query/conditions.rs @@ -40,7 +40,7 @@ use WhereOperator::{ GreaterThanOrEquals, In, LessThan, LessThanOrEquals, StartsWith, }; -use crate::error::query::QueryError; +use crate::error::query::QuerySyntaxError; use crate::error::Error; use dpp::data_contract::document_type::DocumentType; use dpp::document::Document; @@ -123,22 +123,22 @@ impl WhereOperator { GreaterThanOrEquals => Ok(LessThanOrEquals), LessThan => Ok(GreaterThan), LessThanOrEquals => Ok(GreaterThanOrEquals), - Between => Err(Error::Query(QueryError::InvalidWhereClauseOrder( + Between => Err(Error::Query(QuerySyntaxError::InvalidWhereClauseOrder( "Between clause order invalid", ))), - BetweenExcludeBounds => Err(Error::Query(QueryError::InvalidWhereClauseOrder( + BetweenExcludeBounds => Err(Error::Query(QuerySyntaxError::InvalidWhereClauseOrder( "Between clause order invalid", ))), - BetweenExcludeLeft => Err(Error::Query(QueryError::InvalidWhereClauseOrder( + BetweenExcludeLeft => Err(Error::Query(QuerySyntaxError::InvalidWhereClauseOrder( "Between clause order invalid", ))), - BetweenExcludeRight => Err(Error::Query(QueryError::InvalidWhereClauseOrder( + BetweenExcludeRight => Err(Error::Query(QuerySyntaxError::InvalidWhereClauseOrder( "Between clause order invalid", ))), - In => Err(Error::Query(QueryError::InvalidWhereClauseOrder( + In => Err(Error::Query(QuerySyntaxError::InvalidWhereClauseOrder( "In clause order invalid", ))), - StartsWith => Err(Error::Query(QueryError::InvalidWhereClauseOrder( + StartsWith => Err(Error::Query(QuerySyntaxError::InvalidWhereClauseOrder( "Startswith clause order invalid", ))), } @@ -222,27 +222,27 @@ impl<'a> WhereClause { Value::Bytes(bytes) => Ok(Cow::Owned( bytes.iter().map(|int| Value::U8(*int)).collect(), )), - _ => Err(Error::Query(QueryError::InvalidInClause( + _ => Err(Error::Query(QuerySyntaxError::InvalidInClause( "when using in operator you must provide an array of values", ))), }?; let len = in_values.len(); if len == 0 { - return Err(Error::Query(QueryError::InvalidInClause( + return Err(Error::Query(QuerySyntaxError::InvalidInClause( "in clause must at least 1 value", ))); } if len > 100 { - return Err(Error::Query(QueryError::InvalidInClause( + return Err(Error::Query(QuerySyntaxError::InvalidInClause( "in clause must at most 100 values", ))); } // Throw an error if there are duplicates if (1..in_values.len()).any(|i| in_values[i..].contains(&in_values[i - 1])) { - return Err(Error::Query(QueryError::InvalidInClause( + return Err(Error::Query(QuerySyntaxError::InvalidInClause( "there should be no duplicates values for In query", ))); } @@ -343,7 +343,7 @@ impl<'a> WhereClause { Ok(x.lt(y)) } } - _ => Err(Error::Query(QueryError::RangeClausesNotGroupable( + _ => Err(Error::Query(QuerySyntaxError::RangeClausesNotGroupable( "range clauses can not be coherently grouped", ))), } @@ -352,42 +352,45 @@ impl<'a> WhereClause { /// Returns a `WhereClause` given a list of clause components pub fn from_components(clause_components: &'a [Value]) -> Result { if clause_components.len() != 3 { - return Err(Error::Query(QueryError::InvalidWhereClauseComponents( - "where clauses should have at most 3 components", - ))); + return Err(Error::Query( + QuerySyntaxError::InvalidWhereClauseComponents( + "where clauses should have at most 3 components", + ), + )); } let field_value = clause_components .get(0) .expect("check above enforces it exists"); - let field_ref = - field_value - .as_text() - .ok_or(Error::Query(QueryError::InvalidWhereClauseComponents( - "first field of where component should be a string", - )))?; + let field_ref = field_value.as_text().ok_or(Error::Query( + QuerySyntaxError::InvalidWhereClauseComponents( + "first field of where component should be a string", + ), + ))?; let field = String::from(field_ref); let operator_value = clause_components .get(1) .expect("check above enforces it exists"); let operator_string = operator_value.as_text().ok_or(Error::Query( - QueryError::InvalidWhereClauseComponents( + QuerySyntaxError::InvalidWhereClauseComponents( "second field of where component should be a string", ), ))?; let operator = WhereOperator::from_string(operator_string).ok_or({ - Error::Query(QueryError::InvalidWhereClauseComponents( + Error::Query(QuerySyntaxError::InvalidWhereClauseComponents( "second field of where component should be a known operator", )) })?; let value = clause_components .get(2) - .ok_or(Error::Query(QueryError::InvalidWhereClauseComponents( - "third field of where component should exist", - )))? + .ok_or(Error::Query( + QuerySyntaxError::InvalidWhereClauseComponents( + "third field of where component should exist", + ), + ))? .clone(); Ok(WhereClause { @@ -407,7 +410,7 @@ impl<'a> WhereClause { match lower_range_clauses.len() { 0 => Ok(None), 1 => Ok(Some(lower_range_clauses.get(0).unwrap())), - _ => Err(Error::Query(QueryError::MultipleRangeClauses( + _ => Err(Error::Query(QuerySyntaxError::MultipleRangeClauses( "there can only at most one range clause with a lower bound", ))), } @@ -421,7 +424,7 @@ impl<'a> WhereClause { match upper_range_clauses.len() { 0 => Ok(None), 1 => Ok(Some(upper_range_clauses.get(0).unwrap())), - _ => Err(Error::Query(QueryError::MultipleRangeClauses( + _ => Err(Error::Query(QuerySyntaxError::MultipleRangeClauses( "there can only at most one range clause with a lower bound", ))), } @@ -450,7 +453,7 @@ impl<'a> WhereClause { .map(|where_clause| { if known_fields.contains(&where_clause.field) { Err(Error::Query( - QueryError::DuplicateNonGroupableClauseSameField( + QuerySyntaxError::DuplicateNonGroupableClauseSameField( "duplicate equality fields", ), )) @@ -478,7 +481,7 @@ impl<'a> WhereClause { let clause = in_clauses_array.get(0).expect("there must be a value"); if known_fields.contains(&clause.field) { Err(Error::Query( - QueryError::DuplicateNonGroupableClauseSameField( + QuerySyntaxError::DuplicateNonGroupableClauseSameField( "in clause has same field as an equality clause", ), )) @@ -487,7 +490,7 @@ impl<'a> WhereClause { Ok(Some(clause.clone())) } } - _ => Err(Error::Query(QueryError::MultipleInClauses( + _ => Err(Error::Query(QuerySyntaxError::MultipleInClauses( "There should only be one in clause", ))), }?; @@ -534,32 +537,36 @@ impl<'a> WhereClause { } else if groupable_range_clauses.len() == 1 { let clause = *groupable_range_clauses.first().unwrap(); if known_fields.contains(clause.field.as_str()) { - Err(Error::Query(QueryError::InvalidWhereClauseComponents( - "in clause has same field as an equality clause", - ))) + Err(Error::Query( + QuerySyntaxError::InvalidWhereClauseComponents( + "in clause has same field as an equality clause", + ), + )) } else { Ok(Some(clause.clone())) } } else if groupable_range_clauses.len() > 2 { - Err(Error::Query(QueryError::MultipleRangeClauses( + Err(Error::Query(QuerySyntaxError::MultipleRangeClauses( "there can only be at most 2 range clauses that must be on the same field", ))) } else { let first_field = groupable_range_clauses.first().unwrap().field.as_str(); if known_fields.contains(first_field) { - Err(Error::Query(QueryError::InvalidWhereClauseComponents( - "a range clause has same field as an equality or in clause", - ))) + Err(Error::Query( + QuerySyntaxError::InvalidWhereClauseComponents( + "a range clause has same field as an equality or in clause", + ), + )) } else if groupable_range_clauses .iter() .any(|&z| z.field.as_str() != first_field) { - Err(Error::Query(QueryError::MultipleRangeClauses( + Err(Error::Query(QuerySyntaxError::MultipleRangeClauses( "all ranges must be on same field", ))) } else { let lower_upper_error = || { - Error::Query(QueryError::RangeClausesNotGroupable( + Error::Query(QuerySyntaxError::RangeClausesNotGroupable( "lower and upper bounds must be passed if providing 2 ranges", )) }; @@ -585,7 +592,7 @@ impl<'a> WhereClause { if upper_bounds_clause .less_than(lower_bounds_clause, operator == BetweenExcludeBounds)? { - return Err(Error::Query(QueryError::MultipleRangeClauses( + return Err(Error::Query(QuerySyntaxError::MultipleRangeClauses( "lower bounds must be under upper bounds", ))); } @@ -606,25 +613,25 @@ impl<'a> WhereClause { // Starts with must null be against an empty string if let Value::Text(text) = &where_clause.value { if text.is_empty() { - return Err(Error::Query(QueryError::StartsWithIllegalString( + return Err(Error::Query(QuerySyntaxError::StartsWithIllegalString( "starts with can not start with an empty string", ))); } } } if known_fields.contains(where_clause.field.as_str()) { - Err(Error::Query(QueryError::DuplicateNonGroupableClauseSameField( + Err(Error::Query(QuerySyntaxError::DuplicateNonGroupableClauseSameField( "a non groupable range clause has same field as an equality or in clause", ))) } else { Ok(Some(where_clause.clone())) } } else if groupable_range_clauses.is_empty() { - Err(Error::Query(QueryError::MultipleRangeClauses( + Err(Error::Query(QuerySyntaxError::MultipleRangeClauses( "there can not be more than 1 non groupable range clause", ))) } else { - Err(Error::Query(QueryError::RangeClausesNotGroupable( + Err(Error::Query(QuerySyntaxError::RangeClausesNotGroupable( "clauses are not groupable", ))) }?; @@ -641,12 +648,12 @@ impl<'a> WhereClause { _ => None, } .ok_or({ - Error::Query(QueryError::InvalidBetweenClause( + Error::Query(QuerySyntaxError::InvalidBetweenClause( "when using between operator you must provide a tuple array of values", )) })?; if in_values.len() != 2 { - return Err(Error::Query(QueryError::InvalidBetweenClause( + return Err(Error::Query(QuerySyntaxError::InvalidBetweenClause( "when using between operator you must provide an array of exactly two values", ))); } @@ -960,7 +967,7 @@ impl<'a> WhereClause { document_type.serialize_value_for_key(self.field.as_str(), &self.value)?; let mut right_key = left_key.clone(); let last_char = right_key.last_mut().ok_or({ - Error::Query(QueryError::InvalidStartsWithClause( + Error::Query(QuerySyntaxError::InvalidStartsWithClause( "starts with must have at least one character", )) })?; @@ -1010,7 +1017,7 @@ impl<'a> WhereClause { negated, } => { if *negated { - return Err(Error::Query(QueryError::Unsupported( + return Err(Error::Query(QuerySyntaxError::Unsupported( "Invalid query: negated in clause not supported".to_string(), ))); } @@ -1018,7 +1025,7 @@ impl<'a> WhereClause { let field_name = if let ast::Expr::Identifier(ident) = &**expr { ident.value.clone() } else { - return Err(Error::Query(QueryError::InvalidInClause( + return Err(Error::Query(QuerySyntaxError::InvalidInClause( "Invalid query: in clause should start with an identifier", ))); }; @@ -1027,13 +1034,13 @@ impl<'a> WhereClause { for value in list { if let ast::Expr::Value(sql_value) = value { let cbor_val = sql_value_to_platform_value(sql_value.clone()).ok_or({ - Error::Query(QueryError::InvalidSQL( + Error::Query(QuerySyntaxError::InvalidSQL( "Invalid query: unexpected value type", )) })?; in_values.push(cbor_val); } else { - return Err(Error::Query(QueryError::InvalidSQL( + return Err(Error::Query(QuerySyntaxError::InvalidSQL( "Invalid query: expected a list of sql values", ))); } @@ -1052,9 +1059,10 @@ impl<'a> WhereClause { Self::build_where_clauses_from_operations(left, where_clauses)?; Self::build_where_clauses_from_operations(right, where_clauses)?; } else { - let mut where_operator = WhereOperator::from_sql_operator(op.clone()).ok_or( - Error::Query(QueryError::Unsupported("Unknown operator".to_string())), - )?; + let mut where_operator = + WhereOperator::from_sql_operator(op.clone()).ok_or(Error::Query( + QuerySyntaxError::Unsupported("Unknown operator".to_string()), + ))?; let identifier; let value_expr; @@ -1071,7 +1079,7 @@ impl<'a> WhereClause { value_expr = &**left; where_operator = where_operator.flip()?; } else { - return Err(Error::Query(QueryError::InvalidSQL( + return Err(Error::Query(QuerySyntaxError::InvalidSQL( "Invalid query: where clause should have field name and value", ))); } @@ -1084,14 +1092,14 @@ impl<'a> WhereClause { let value = if let ast::Expr::Value(value) = value_expr { let cbor_val = sql_value_to_platform_value(value.clone()).ok_or({ - Error::Query(QueryError::InvalidSQL( + Error::Query(QuerySyntaxError::InvalidSQL( "Invalid query: unexpected value type", )) })?; if where_operator == StartsWith { // make sure the value is of the right format i.e prefix% let inner_text = cbor_val.as_text().ok_or({ - Error::Query(QueryError::InvalidStartsWithClause( + Error::Query(QuerySyntaxError::InvalidStartsWithClause( "Invalid query: startsWith takes text", )) })?; @@ -1101,7 +1109,7 @@ impl<'a> WhereClause { { Value::Text(String::from(&inner_text[..(inner_text.len() - 1)])) } else { - return Err(Error::Query(QueryError::Unsupported( + return Err(Error::Query(QuerySyntaxError::Unsupported( "Invalid query: like can only be used to represent startswith" .to_string(), ))); @@ -1121,7 +1129,7 @@ impl<'a> WhereClause { } Ok(()) } - _ => Err(Error::Query(QueryError::InvalidSQL( + _ => Err(Error::Query(QuerySyntaxError::InvalidSQL( "Issue parsing sql: invalid selection format", ))), } diff --git a/packages/rs-drive/src/query/defaults.rs b/packages/rs-drive/src/query/defaults.rs index 14d16a8aad..9f33f2a14b 100644 --- a/packages/rs-drive/src/query/defaults.rs +++ b/packages/rs-drive/src/query/defaults.rs @@ -1,6 +1,2 @@ -/// Default query limit constant -pub(crate) const DEFAULT_QUERY_LIMIT: u16 = 100; -/// Max query limit constant -pub(crate) const MAX_QUERY_LIMIT: u16 = 100; /// Max index difference constant pub(crate) const MAX_INDEX_DIFFERENCE: u16 = 2; diff --git a/packages/rs-drive/src/query/mod.rs b/packages/rs-drive/src/query/mod.rs index e77fe3d95d..e52d1df5ab 100644 --- a/packages/rs-drive/src/query/mod.rs +++ b/packages/rs-drive/src/query/mod.rs @@ -75,8 +75,6 @@ use dpp::data_contract::document_type::{Index, IndexProperty}; #[cfg(any(feature = "full", feature = "verify"))] pub use ordering::OrderClause; -#[cfg(any(feature = "full", feature = "verify"))] -use crate::common::encode::encode_float; #[cfg(any(feature = "full", feature = "verify"))] use crate::contract::Contract; #[cfg(feature = "full")] @@ -86,7 +84,7 @@ use crate::drive::Drive; #[cfg(feature = "full")] use crate::error::drive::DriveError; #[cfg(any(feature = "full", feature = "verify"))] -use crate::error::query::QueryError; +use crate::error::query::QuerySyntaxError; #[cfg(any(feature = "full", feature = "verify"))] use crate::error::Error; #[cfg(feature = "full")] @@ -106,6 +104,8 @@ use dpp::platform_value::platform_value; #[cfg(any(feature = "full", feature = "verify"))] use dpp::platform_value::Value; +use crate::common::encode::encode_u64; +use crate::drive::config::DriveConfig; #[cfg(any(feature = "full", feature = "verify"))] use dpp::ProtocolError; @@ -206,7 +206,7 @@ impl InternalClauses { .clone(), )), _ => Err(Error::Query( - QueryError::DuplicateNonGroupableClauseSameField( + QuerySyntaxError::DuplicateNonGroupableClauseSameField( "There should only be one equal clause for the primary key", ), )), @@ -221,7 +221,7 @@ impl InternalClauses { .clone(), )), _ => Err(Error::Query( - QueryError::DuplicateNonGroupableClauseSameField( + QuerySyntaxError::DuplicateNonGroupableClauseSameField( "There should only be one in clause for the primary key", ), )), @@ -237,9 +237,9 @@ impl InternalClauses { match internal_clauses.verify() { true => Ok(internal_clauses), - false => Err(Error::Query(QueryError::InvalidWhereClauseComponents( - "Query has invalid where clauses", - ))), + false => Err(Error::Query( + QuerySyntaxError::InvalidWhereClauseComponents("Query has invalid where clauses"), + )), } } } @@ -288,7 +288,7 @@ pub struct DriveQuery<'a> { /// Start at included pub start_at_included: bool, /// Block time - pub block_time: Option, + pub block_time_ms: Option, } // TODO: expose this also @@ -306,7 +306,7 @@ impl<'a> DriveQuery<'a> { order_by: Default::default(), start_at: None, start_at_included: true, - block_time: None, + block_time_ms: None, } } @@ -333,13 +333,14 @@ impl<'a> DriveQuery<'a> { query_cbor: &[u8], contract: &'a Contract, document_type: &'a DocumentType, + config: &DriveConfig, ) -> Result { let query_document_value: Value = ciborium::de::from_reader(query_cbor).map_err(|_| { - Error::Query(QueryError::DeserializationError( + Error::Query(QuerySyntaxError::DeserializationError( "unable to decode query from cbor".to_string(), )) })?; - Self::from_value(query_document_value, contract, document_type) + Self::from_value(query_document_value, contract, document_type, config) } #[cfg(any(feature = "full", feature = "verify"))] @@ -348,9 +349,10 @@ impl<'a> DriveQuery<'a> { query_value: Value, contract: &'a Contract, document_type: &'a DocumentType, + config: &DriveConfig, ) -> Result { let query_document: BTreeMap = query_value.into_btree_string_map()?; - Self::from_btree_map_value(query_document, contract, document_type) + Self::from_btree_map_value(query_document, contract, document_type, config) } #[cfg(any(feature = "full", feature = "verify"))] @@ -359,25 +361,27 @@ impl<'a> DriveQuery<'a> { mut query_document: BTreeMap, contract: &'a Contract, document_type: &'a DocumentType, + config: &DriveConfig, ) -> Result { let maybe_limit: Option = query_document .remove_optional_integer("limit") .map_err(|e| Error::Protocol(ProtocolError::ValueError(e)))?; let limit = maybe_limit - .map_or(Some(defaults::DEFAULT_QUERY_LIMIT), |limit_value| { - if limit_value == 0 || limit_value > defaults::DEFAULT_QUERY_LIMIT { + .map_or(Some(config.default_query_limit), |limit_value| { + if limit_value == 0 || limit_value > config.default_query_limit { None } else { Some(limit_value) } }) - .ok_or(Error::Query(QueryError::InvalidLimit( - "limit should be a integer from 1 to 100", - )))?; + .ok_or(Error::Query(QuerySyntaxError::InvalidLimit(format!( + "limit greater than max limit {}", + config.max_query_limit + ))))?; - let block_time: Option = query_document - .remove_optional_float("blockTime") + let block_time_ms: Option = query_document + .remove_optional_integer("blockTime") .map_err(|e| Error::Protocol(ProtocolError::ValueError(e)))?; let all_where_clauses: Vec = @@ -391,14 +395,14 @@ impl<'a> DriveQuery<'a> { if let Value::Array(clauses_components) = where_clause { WhereClause::from_components(clauses_components) } else { - Err(Error::Query(QueryError::InvalidFormatWhereClause( + Err(Error::Query(QuerySyntaxError::InvalidFormatWhereClause( "where clause must be an array", ))) } }) .collect::, Error>>() } else { - Err(Error::Query(QueryError::InvalidFormatWhereClause( + Err(Error::Query(QuerySyntaxError::InvalidFormatWhereClause( "where clause must be an array", ))) } @@ -409,7 +413,7 @@ impl<'a> DriveQuery<'a> { let start_at_option = query_document.remove("startAt"); let start_after_option = query_document.remove("startAfter"); if start_after_option.is_some() && start_at_option.is_some() { - return Err(Error::Query(QueryError::DuplicateStartConditions( + return Err(Error::Query(QuerySyntaxError::DuplicateStartConditions( "only one of startAt or startAfter should be provided", ))); } @@ -456,7 +460,7 @@ impl<'a> DriveQuery<'a> { .collect::, Error>>()?; if !query_document.is_empty() { - return Err(Error::Query(QueryError::Unsupported( + return Err(Error::Query(QuerySyntaxError::Unsupported( "unsupported syntax in where clause".to_string(), ))); } @@ -470,27 +474,117 @@ impl<'a> DriveQuery<'a> { order_by, start_at, start_at_included, - block_time, + block_time_ms, + }) + } + + #[cfg(any(feature = "full", feature = "verify"))] + /// Converts a query Value to a `DriveQuery`. + pub fn from_decomposed_values( + where_clause: Value, + order_by: Option, + maybe_limit: Option, + start_at: Option>, + start_at_included: bool, + block_time_ms: Option, + contract: &'a Contract, + document_type: &'a DocumentType, + config: &DriveConfig, + ) -> Result { + let limit = maybe_limit + .map_or(Some(config.default_query_limit), |limit_value| { + if limit_value == 0 || limit_value > config.default_query_limit { + None + } else { + Some(limit_value) + } + }) + .ok_or(Error::Query(QuerySyntaxError::InvalidLimit(format!( + "limit greater than max limit {}", + config.max_query_limit + ))))?; + + let all_where_clauses: Vec = match where_clause { + Value::Null => Ok(vec![]), + Value::Array(clauses) => clauses + .iter() + .map(|where_clause| { + if let Value::Array(clauses_components) = where_clause { + WhereClause::from_components(clauses_components) + } else { + Err(Error::Query(QuerySyntaxError::InvalidFormatWhereClause( + "where clause must be an array", + ))) + } + }) + .collect::, Error>>(), + _ => Err(Error::Query(QuerySyntaxError::InvalidFormatWhereClause( + "where clause must be an array", + ))), + }?; + + let internal_clauses = InternalClauses::extract_from_clauses(all_where_clauses)?; + + let order_by: IndexMap = order_by + .map_or(vec![], |id_cbor| { + if let Value::Array(clauses) = id_cbor { + clauses + .iter() + .filter_map(|order_clause| { + if let Value::Array(clauses_components) = order_clause { + OrderClause::from_components(clauses_components).ok() + } else { + None + } + }) + .collect() + } else { + vec![] + } + }) + .iter() + .map(|order_clause| Ok((order_clause.field.clone(), order_clause.to_owned()))) + .collect::, Error>>()?; + + Ok(DriveQuery { + contract, + document_type, + internal_clauses, + offset: 0, + limit, + order_by, + start_at, + start_at_included, + block_time_ms, }) } #[cfg(any(feature = "full", feature = "verify"))] /// Converts a SQL expression to a `DriveQuery`. - pub fn from_sql_expr(sql_string: &str, contract: &'a Contract) -> Result { + pub fn from_sql_expr( + sql_string: &str, + contract: &'a Contract, + config: &DriveConfig, + ) -> Result { let dialect: GenericDialect = sqlparser::dialect::GenericDialect {}; let statements: Vec = Parser::parse_sql(&dialect, sql_string) - .map_err(|_| Error::Query(QueryError::InvalidSQL("Issue parsing sql")))?; + .map_err(|_| Error::Query(QuerySyntaxError::InvalidSQL("Issue parsing sql")))?; // Should ideally iterate over each statement - let first_statement = statements - .get(0) - .ok_or(Error::Query(QueryError::InvalidSQL("Issue parsing sql")))?; + let first_statement = + statements + .get(0) + .ok_or(Error::Query(QuerySyntaxError::InvalidSQL( + "Issue parsing sql", + )))?; let query: &ast::Query = match first_statement { ast::Statement::Query(query_struct) => Some(query_struct), _ => None, } - .ok_or(Error::Query(QueryError::InvalidSQL("Issue parsing sql")))?; + .ok_or(Error::Query(QuerySyntaxError::InvalidSQL( + "Issue parsing sql", + )))?; let limit: u16 = if let Some(limit_expr) = &query.limit { match limit_expr { @@ -500,11 +594,12 @@ impl<'a> DriveQuery<'a> { } _ => None, } - .ok_or(Error::Query(QueryError::InvalidLimit( - "Issue parsing sql: invalid limit value", - )))? + .ok_or(Error::Query(QuerySyntaxError::InvalidLimit(format!( + "limit greater than max limit {}", + config.max_query_limit + ))))? } else { - defaults::DEFAULT_QUERY_LIMIT + config.default_query_limit }; let order_by: IndexMap = query @@ -522,13 +617,15 @@ impl<'a> DriveQuery<'a> { ast::SetExpr::Select(select) => Some(select), _ => None, } - .ok_or(Error::Query(QueryError::InvalidSQL("Issue parsing sql")))?; + .ok_or(Error::Query(QuerySyntaxError::InvalidSQL( + "Issue parsing sql", + )))?; // Get the document type from the 'from' section let document_type_name = match &select .from .get(0) - .ok_or(Error::Query(QueryError::InvalidSQL( + .ok_or(Error::Query(QuerySyntaxError::InvalidSQL( "Invalid query: missing from section", )))? .relation @@ -541,14 +638,14 @@ impl<'a> DriveQuery<'a> { } => name.0.get(0).as_ref().map(|identifier| &identifier.value), _ => None, } - .ok_or(Error::Query(QueryError::InvalidSQL( + .ok_or(Error::Query(QuerySyntaxError::InvalidSQL( "Issue parsing sql: invalid from value", )))?; let document_type = contract .document_types .get(document_type_name) - .ok_or(Error::Query(QueryError::DocumentTypeNotFound( + .ok_or(Error::Query(QuerySyntaxError::DocumentTypeNotFound( "document type not found in contract", )))?; @@ -603,7 +700,7 @@ impl<'a> DriveQuery<'a> { order_by, start_at, start_at_included, - block_time: None, + block_time_ms: None, }) } @@ -665,7 +762,7 @@ impl<'a> DriveQuery<'a> { "startAfter document not found" }; - Error::Query(QueryError::StartDocumentNotFound(error_message)) + Error::Query(QuerySyntaxError::StartDocumentNotFound(error_message)) } _ => e, })? @@ -712,8 +809,8 @@ impl<'a> DriveQuery<'a> { if self.document_type.documents_keep_history { // if the documents keep history then we should insert a subquery - if let Some(block_time) = self.block_time { - let encoded_block_time = encode_float(block_time)?; + if let Some(block_time) = self.block_time_ms { + let encoded_block_time = encode_u64(block_time)?; let mut sub_query = Query::new_with_direction(false); sub_query.insert_range_to_inclusive(..=encoded_block_time); query.set_subquery(sub_query); @@ -727,7 +824,7 @@ impl<'a> DriveQuery<'a> { // This is for a range let left_to_right = if self.order_by.keys().len() == 1 { if self.order_by.keys().next().unwrap() != "$id" { - return Err(Error::Query(QueryError::InvalidOrderByProperties( + return Err(Error::Query(QuerySyntaxError::InvalidOrderByProperties( "order by should include $id only", ))); } @@ -778,9 +875,9 @@ impl<'a> DriveQuery<'a> { if self.document_type.documents_keep_history { // if the documents keep history then we should insert a subquery - if let Some(_block_time) = self.block_time { + if let Some(_block_time) = self.block_time_ms { //todo - return Err(Error::Query(QueryError::Unsupported( + return Err(Error::Query(QuerySyntaxError::Unsupported( "Not yet implemented".to_string(), ))); // in order to be able to do this we would need limited subqueries @@ -819,8 +916,8 @@ impl<'a> DriveQuery<'a> { if self.document_type.documents_keep_history { // if the documents keep history then we should insert a subquery - if let Some(_block_time) = self.block_time { - return Err(Error::Query(QueryError::Unsupported( + if let Some(_block_time) = self.block_time_ms { + return Err(Error::Query(QuerySyntaxError::Unsupported( "this query is not supported".to_string(), ))); // in order to be able to do this we would need limited subqueries @@ -886,11 +983,13 @@ impl<'a> DriveQuery<'a> { let (index, difference) = self .document_type .index_for_types(fields.as_slice(), in_field, order_by_keys.as_slice()) - .ok_or(Error::Query(QueryError::WhereClauseOnNonIndexedProperty( - "query must be for valid indexes", - )))?; + .ok_or(Error::Query( + QuerySyntaxError::WhereClauseOnNonIndexedProperty( + "query must be for valid indexes", + ), + ))?; if difference > defaults::MAX_INDEX_DIFFERENCE { - return Err(Error::Query(QueryError::QueryTooFarFromIndex( + return Err(Error::Query(QuerySyntaxError::QueryTooFarFromIndex( "query must better match an existing index", ))); } @@ -1213,7 +1312,7 @@ impl<'a> DriveQuery<'a> { let order_clause: &OrderClause = self .order_by .get(where_clause.field.as_str()) - .ok_or(Error::Query(QueryError::MissingOrderByForRange( + .ok_or(Error::Query(QuerySyntaxError::MissingOrderByForRange( "query must have an orderBy field for each range element", )))?; @@ -1263,7 +1362,7 @@ impl<'a> DriveQuery<'a> { let order_clause: &OrderClause = self .order_by .get(subquery_where_clause.field.as_str()) - .ok_or(Error::Query(QueryError::MissingOrderByForRange( + .ok_or(Error::Query(QuerySyntaxError::MissingOrderByForRange( "query must have an orderBy field for each range element", )))?; let mut subquery = subquery_where_clause.to_path_query( @@ -1303,7 +1402,9 @@ impl<'a> DriveQuery<'a> { // Now we should construct the path let last_index = last_indexes.first().ok_or(Error::Query( - QueryError::QueryOnDocumentTypeWithNoIndexes("document query has no index with fields"), + QuerySyntaxError::QueryOnDocumentTypeWithNoIndexes( + "document query has no index with fields", + ), ))?; let mut path = document_type_path; @@ -1534,6 +1635,7 @@ mod tests { use dpp::util::cbor_serializer; use serde_json::Value::Null; + use crate::drive::config::DriveConfig; use dpp::block::block_info::BlockInfo; fn setup_family_contract() -> (Drive, Contract) { @@ -1596,8 +1698,13 @@ mod tests { let where_cbor = cbor_serializer::serializable_value_to_cbor(&query_value, None) .expect("expected to serialize to cbor"); - DriveQuery::from_cbor(where_cbor.as_slice(), &contract, &document_type) - .expect_err("all ranges must be on same field"); + DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + &document_type, + &DriveConfig::default(), + ) + .expect_err("all ranges must be on same field"); } #[test] @@ -1618,9 +1725,13 @@ mod tests { let where_cbor = cbor_serializer::serializable_value_to_cbor(&query_value, None) .expect("expected to serialize to cbor"); - DriveQuery::from_cbor(where_cbor.as_slice(), &contract, &document_type).expect_err( - "fields of queries must of defined supported types (where, limit, orderBy...)", - ); + DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + &document_type, + &DriveConfig::default(), + ) + .expect_err("fields of queries must of defined supported types (where, limit, orderBy...)"); } #[test] @@ -1642,8 +1753,13 @@ mod tests { let where_cbor = cbor_serializer::serializable_value_to_cbor(&query_value, None) .expect("expected to serialize to cbor"); - DriveQuery::from_cbor(where_cbor.as_slice(), &contract, &document_type) - .expect_err("the query should not be created"); + DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + &document_type, + &DriveConfig::default(), + ) + .expect_err("the query should not be created"); } #[test] @@ -1665,8 +1781,13 @@ mod tests { let where_cbor = cbor_serializer::serializable_value_to_cbor(&query_value, None) .expect("expected to serialize to cbor"); - DriveQuery::from_cbor(where_cbor.as_slice(), &contract, &document_type) - .expect("the query should be created"); + DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + &document_type, + &DriveConfig::default(), + ) + .expect("the query should be created"); } #[test] @@ -1687,8 +1808,13 @@ mod tests { let where_cbor = cbor_serializer::serializable_value_to_cbor(&query_value, None) .expect("expected to serialize to cbor"); - DriveQuery::from_cbor(where_cbor.as_slice(), &contract, &document_type) - .expect("query should be fine for a 255 byte long string"); + DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + &document_type, + &DriveConfig::default(), + ) + .expect("query should be fine for a 255 byte long string"); } #[test] @@ -1713,8 +1839,13 @@ mod tests { let where_cbor = cbor_serializer::serializable_value_to_cbor(&query_value, None) .expect("expected to serialize to cbor"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, document_type) - .expect("fields of queries length must be under 256 bytes long"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + document_type, + &DriveConfig::default(), + ) + .expect("fields of queries length must be under 256 bytes long"); query .execute_raw_results_no_proof(&drive, None, None) .expect_err("fields of queries length must be under 256 bytes long"); @@ -1740,7 +1871,7 @@ mod tests { // }); // // let where_cbor = serializer::value_to_cbor(query_value, None).expect("expected to serialize to cbor"); - // let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, &document_type) + // let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, &document_type, &DriveConfig::default()) // .expect("The query itself should be valid for a null type"); // query // .execute_no_proof(&drive, None, None) @@ -1768,7 +1899,7 @@ mod tests { // }); // // let where_cbor = serializer::value_to_cbor(query_value, None).expect("expected to serialize to cbor"); - // let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, &document_type) + // let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, &document_type, &DriveConfig::default()) // .expect("The query itself should be valid for a null type"); // query // .execute_no_proof(&drive, None, None) @@ -1795,8 +1926,13 @@ mod tests { let where_cbor = cbor_serializer::serializable_value_to_cbor(&query_value, None) .expect("expected to serialize to cbor"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, document_type) - .expect("The query itself should be valid for a null type"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + document_type, + &DriveConfig::default(), + ) + .expect("The query itself should be valid for a null type"); query .execute_raw_results_no_proof(&drive, None, None) .expect("a Null value doesn't make sense for a float"); @@ -1822,8 +1958,13 @@ mod tests { let where_cbor = cbor_serializer::serializable_value_to_cbor(&query_value, None) .expect("expected to serialize to cbor"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, document_type) - .expect("query should be valid for empty array"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + document_type, + &DriveConfig::default(), + ) + .expect("query should be valid for empty array"); query .execute_raw_results_no_proof(&drive, None, None) @@ -1854,8 +1995,13 @@ mod tests { let where_cbor = cbor_serializer::serializable_value_to_cbor(&query_value, None) .expect("expected to serialize to cbor"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, document_type) - .expect("query is valid for too many elements"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + document_type, + &DriveConfig::default(), + ) + .expect("query is valid for too many elements"); query .execute_raw_results_no_proof(&drive, None, None) @@ -1886,8 +2032,13 @@ mod tests { // The is actually valid, however executing it is not // This is in order to optimize query execution - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, document_type) - .expect("the query should be created"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + document_type, + &DriveConfig::default(), + ) + .expect("the query should be created"); query .execute_raw_results_no_proof(&drive, None, None) @@ -1911,8 +2062,13 @@ mod tests { let where_cbor = cbor_serializer::serializable_value_to_cbor(&query_value, None) .expect("expected to serialize to cbor"); - DriveQuery::from_cbor(where_cbor.as_slice(), &contract, &document_type) - .expect_err("starts with can not start with an empty string"); + DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + &document_type, + &DriveConfig::default(), + ) + .expect_err("starts with can not start with an empty string"); } #[test] @@ -1932,8 +2088,13 @@ mod tests { let where_cbor = cbor_serializer::serializable_value_to_cbor(&query_value, None) .expect("expected to serialize to cbor"); - DriveQuery::from_cbor(where_cbor.as_slice(), &contract, &document_type) - .expect_err("starts with can not start with an empty string"); + DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + &document_type, + &DriveConfig::default(), + ) + .expect_err("starts with can not start with an empty string"); } #[test] @@ -1953,8 +2114,13 @@ mod tests { let where_cbor = cbor_serializer::serializable_value_to_cbor(&query_value, None) .expect("expected to serialize to cbor"); - DriveQuery::from_cbor(where_cbor.as_slice(), &contract, &document_type) - .expect_err("starts with can not start with an empty string"); + DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + &document_type, + &DriveConfig::default(), + ) + .expect_err("starts with can not start with an empty string"); } #[test] @@ -1974,7 +2140,12 @@ mod tests { let where_cbor = cbor_serializer::serializable_value_to_cbor(&query_value, None) .expect("expected to serialize to cbor"); - DriveQuery::from_cbor(where_cbor.as_slice(), &contract, &document_type) - .expect_err("starts with can not start with an empty string"); + DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + &document_type, + &DriveConfig::default(), + ) + .expect_err("starts with can not start with an empty string"); } } diff --git a/packages/rs-drive/src/query/test_index.rs b/packages/rs-drive/src/query/test_index.rs index 66993668a0..a6622bb68f 100644 --- a/packages/rs-drive/src/query/test_index.rs +++ b/packages/rs-drive/src/query/test_index.rs @@ -7,7 +7,8 @@ mod tests { use serde_json::json; use crate::contract::Contract; - use crate::error::{query::QueryError, Error}; + use crate::drive::config::DriveConfig; + use crate::error::{query::QuerySyntaxError, Error}; use crate::query::DriveQuery; fn construct_indexed_document_type() -> DocumentType { @@ -84,8 +85,13 @@ mod tests { }); let where_cbor = cbor_serializer::serializable_value_to_cbor(&query_value, None) .expect("expected to serialize to cbor"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, &document_type) - .expect("query should be valid"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + &document_type, + &DriveConfig::default(), + ) + .expect("query should be valid"); let index = query.find_best_index().expect("expected to find index"); assert_eq!(index, document_type.indices.get(2).unwrap()); @@ -96,8 +102,13 @@ mod tests { }); let where_cbor = cbor_serializer::serializable_value_to_cbor(&query_value, None) .expect("expected to serialize to cbor"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, &document_type) - .expect("query should be valid"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + &document_type, + &DriveConfig::default(), + ) + .expect("query should be valid"); let index = query.find_best_index().expect("expected to find index"); assert_eq!(index, document_type.indices.get(0).unwrap()); } @@ -114,13 +125,18 @@ mod tests { }); let where_cbor = cbor_serializer::serializable_value_to_cbor(&query_value, None) .expect("expected to serialize to cbor"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, &document_type) - .expect("query should be valid"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + &document_type, + &DriveConfig::default(), + ) + .expect("query should be valid"); let error = query .find_best_index() .expect_err("expected to not find index"); assert!( - matches!(error, Error::Query(QueryError::WhereClauseOnNonIndexedProperty(message)) if message == "query must be for valid indexes") + matches!(error, Error::Query(QuerySyntaxError::WhereClauseOnNonIndexedProperty(message)) if message == "query must be for valid indexes") ) } } diff --git a/packages/rs-drive/tests/query_tests.rs b/packages/rs-drive/tests/query_tests.rs index 4b18cf4d14..2210dcbaa6 100644 --- a/packages/rs-drive/tests/query_tests.rs +++ b/packages/rs-drive/tests/query_tests.rs @@ -76,7 +76,7 @@ use drive::drive::object_size_info::{DocumentAndContractInfo, OwnedDocumentInfo} #[cfg(feature = "full")] use drive::drive::Drive; #[cfg(feature = "full")] -use drive::error::{query::QueryError, Error}; +use drive::error::{query::QuerySyntaxError, Error}; #[cfg(feature = "full")] use drive::query::DriveQuery; #[cfg(feature = "full")] @@ -837,8 +837,13 @@ fn test_reference_proof_single_index() { .document_types .get("person") .expect("contract should have a person document type"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, person_document_type) - .expect("query should be built"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + person_document_type, + &drive.config, + ) + .expect("query should be built"); let (results, _, _) = query .execute_raw_results_no_proof(&drive, None, Some(&db_transaction)) .expect("proof should be executed"); @@ -879,8 +884,13 @@ fn test_non_existence_reference_proof_single_index() { .document_types .get("person") .expect("contract should have a person document type"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, person_document_type) - .expect("query should be built"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + person_document_type, + &drive.config, + ) + .expect("query should be built"); let (results, _, _) = query .execute_raw_results_no_proof(&drive, None, Some(&db_transaction)) .expect("proof should be executed"); @@ -941,8 +951,13 @@ fn test_family_basic_queries() { .document_types .get("person") .expect("contract should have a person document type"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, person_document_type) - .expect("query should be built"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + person_document_type, + &drive.config, + ) + .expect("query should be built"); let (results, _, _) = query .execute_raw_results_no_proof(&drive, None, Some(&db_transaction)) .expect("proof should be executed"); @@ -1256,8 +1271,13 @@ fn test_family_basic_queries() { .document_types .get("person") .expect("contract should have a person document type"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, person_document_type) - .expect("query should be built"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + person_document_type, + &drive.config, + ) + .expect("query should be built"); let (results, _, _) = query .execute_raw_results_no_proof(&drive, None, None) .expect("proof should be executed"); @@ -1308,8 +1328,13 @@ fn test_family_basic_queries() { .document_types .get("person") .expect("contract should have a person document type"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, person_document_type) - .expect("query should be built"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + person_document_type, + &drive.config, + ) + .expect("query should be built"); let (results, _, _) = query .execute_raw_results_no_proof(&drive, None, None) .expect("proof should be executed"); @@ -1355,8 +1380,13 @@ fn test_family_basic_queries() { .document_types .get("person") .expect("contract should have a person document type"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, person_document_type) - .expect("query should be built"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + person_document_type, + &drive.config, + ) + .expect("query should be built"); let (results, _, _) = query .execute_raw_results_no_proof(&drive, None, None) .expect("proof should be executed"); @@ -1403,8 +1433,13 @@ fn test_family_basic_queries() { .document_types .get("person") .expect("contract should have a person document type"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, person_document_type) - .expect("query should be built"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + person_document_type, + &drive.config, + ) + .expect("query should be built"); let (results, _, _) = query .execute_raw_results_no_proof(&drive, None, None) .expect("proof should be executed"); @@ -1459,8 +1494,13 @@ fn test_family_basic_queries() { .document_types .get("person") .expect("contract should have a person document type"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, person_document_type) - .expect("query should be built"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + person_document_type, + &drive.config, + ) + .expect("query should be built"); let (results, _, _) = query .execute_raw_results_no_proof(&drive, None, None) .expect("proof should be executed"); @@ -1503,8 +1543,13 @@ fn test_family_basic_queries() { .document_types .get("person") .expect("contract should have a person document type"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, person_document_type) - .expect("query should be built"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + person_document_type, + &drive.config, + ) + .expect("query should be built"); let (results, _, _) = query .execute_raw_results_no_proof(&drive, None, None) .expect("proof should be executed"); @@ -1559,8 +1604,13 @@ fn test_family_basic_queries() { .document_types .get("person") .expect("contract should have a person document type"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, person_document_type) - .expect("query should be built"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + person_document_type, + &drive.config, + ) + .expect("query should be built"); let (results, _, _) = query .execute_raw_results_no_proof(&drive, None, None) .expect("proof should be executed"); @@ -1614,8 +1664,13 @@ fn test_family_basic_queries() { .document_types .get("person") .expect("contract should have a person document type"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, person_document_type) - .expect("query should be built"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + person_document_type, + &drive.config, + ) + .expect("query should be built"); let (results, _, _) = query .execute_raw_results_no_proof(&drive, None, None) .expect("proof should be executed"); @@ -2111,7 +2166,7 @@ fn test_family_basic_queries() { ); assert!( - matches!(result, Err(Error::Query(QueryError::StartDocumentNotFound(message))) if message == "startAt document not found") + matches!(result, Err(Error::Query(QuerySyntaxError::StartDocumentNotFound(message))) if message == "startAt document not found") ); // using non existing document in startAfter @@ -2141,7 +2196,7 @@ fn test_family_basic_queries() { ); assert!( - matches!(result, Err(Error::Query(QueryError::StartDocumentNotFound(message))) if message == "startAfter document not found") + matches!(result, Err(Error::Query(QuerySyntaxError::StartDocumentNotFound(message))) if message == "startAfter document not found") ); // validate eventual root hash @@ -2213,8 +2268,13 @@ fn test_family_starts_at_queries() { .document_types .get("person") .expect("contract should have a person document type"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, person_document_type) - .expect("query should be built"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + person_document_type, + &drive.config, + ) + .expect("query should be built"); let (results, _, _) = query .execute_raw_results_no_proof(&drive, None, None) .expect("proof should be executed"); @@ -2268,8 +2328,13 @@ fn test_family_starts_at_queries() { .document_types .get("person") .expect("contract should have a person document type"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, person_document_type) - .expect("query should be built"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + person_document_type, + &drive.config, + ) + .expect("query should be built"); let (results, _, _) = query .execute_raw_results_no_proof(&drive, None, None) .expect("proof should be executed"); @@ -2317,8 +2382,13 @@ fn test_family_starts_at_queries() { .document_types .get("person") .expect("contract should have a person document type"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, person_document_type) - .expect("query should be built"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + person_document_type, + &drive.config, + ) + .expect("query should be built"); let (results, _, _) = query .execute_raw_results_no_proof(&drive, None, None) .expect("proof should be executed"); @@ -2372,8 +2442,13 @@ fn test_family_starts_at_queries() { .document_types .get("person") .expect("contract should have a person document type"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, person_document_type) - .expect("query should be built"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + person_document_type, + &drive.config, + ) + .expect("query should be built"); let (results, _, _) = query .execute_raw_results_no_proof(&drive, None, None) .expect("proof should be executed"); @@ -2412,7 +2487,7 @@ fn test_family_sql_query() { // These helpers confirm that sql statements produce the same drive query // as their json counterparts, helpers above confirm that the json queries // produce the correct result set - let (_, contract) = setup_family_tests(10, 73509); + let (drive, contract) = setup_family_tests(10, 73509); let person_document_type = contract .document_types .get("person") @@ -2430,11 +2505,17 @@ fn test_family_sql_query() { None, ) .expect("expected to serialize to cbor"); - let query1 = DriveQuery::from_cbor(query_cbor.as_slice(), &contract, person_document_type) - .expect("should build query"); + let query1 = DriveQuery::from_cbor( + query_cbor.as_slice(), + &contract, + person_document_type, + &drive.config, + ) + .expect("should build query"); let sql_string = "select * from person order by firstName asc limit 100"; - let query2 = DriveQuery::from_sql_expr(sql_string, &contract).expect("should build query"); + let query2 = DriveQuery::from_sql_expr(sql_string, &contract, &DriveConfig::default()) + .expect("should build query"); assert_eq!(query1, query2); @@ -2448,11 +2529,17 @@ fn test_family_sql_query() { None, ) .expect("expected to serialize to cbor"); - let query1 = DriveQuery::from_cbor(query_cbor.as_slice(), &contract, person_document_type) - .expect("should build query"); + let query1 = DriveQuery::from_cbor( + query_cbor.as_slice(), + &contract, + person_document_type, + &drive.config, + ) + .expect("should build query"); let sql_string = "select * from person where firstName = 'Chris'"; - let query2 = DriveQuery::from_sql_expr(sql_string, &contract).expect("should build query"); + let query2 = DriveQuery::from_sql_expr(sql_string, &contract, &DriveConfig::default()) + .expect("should build query"); assert_eq!(query1, query2); @@ -2470,12 +2557,18 @@ fn test_family_sql_query() { None, ) .expect("expected to serialize to cbor"); - let query1 = DriveQuery::from_cbor(query_cbor.as_slice(), &contract, person_document_type) - .expect("should build query"); + let query1 = DriveQuery::from_cbor( + query_cbor.as_slice(), + &contract, + person_document_type, + &drive.config, + ) + .expect("should build query"); let sql_string = "select * from person where firstName < 'Chris' order by firstName asc limit 100"; - let query2 = DriveQuery::from_sql_expr(sql_string, &contract).expect("should build query"); + let query2 = DriveQuery::from_sql_expr(sql_string, &contract, &DriveConfig::default()) + .expect("should build query"); assert_eq!(query1, query2); @@ -2493,12 +2586,18 @@ fn test_family_sql_query() { None, ) .expect("expected to serialize to cbor"); - let query1 = DriveQuery::from_cbor(query_cbor.as_slice(), &contract, person_document_type) - .expect("should build query"); + let query1 = DriveQuery::from_cbor( + query_cbor.as_slice(), + &contract, + person_document_type, + &drive.config, + ) + .expect("should build query"); let sql_string = "select * from person where firstName like 'C%' order by firstName asc limit 100"; - let query2 = DriveQuery::from_sql_expr(sql_string, &contract).expect("should build query"); + let query2 = DriveQuery::from_sql_expr(sql_string, &contract, &DriveConfig::default()) + .expect("should build query"); assert_eq!(query1, query2); @@ -2517,11 +2616,17 @@ fn test_family_sql_query() { None, ) .expect("expected to serialize to cbor"); - let query1 = DriveQuery::from_cbor(query_cbor.as_slice(), &contract, person_document_type) - .expect("should build query"); + let query1 = DriveQuery::from_cbor( + query_cbor.as_slice(), + &contract, + person_document_type, + &drive.config, + ) + .expect("should build query"); let sql_string = "select * from person where firstName > 'Chris' and firstName <= 'Noellyn' order by firstName asc limit 100"; - let query2 = DriveQuery::from_sql_expr(sql_string, &contract).expect("should build query"); + let query2 = DriveQuery::from_sql_expr(sql_string, &contract, &DriveConfig::default()) + .expect("should build query"); assert_eq!(query1, query2); @@ -2540,12 +2645,18 @@ fn test_family_sql_query() { None, ) .expect("expected to serialize to cbor"); - let query1 = DriveQuery::from_cbor(query_cbor.as_slice(), &contract, person_document_type) - .expect("should build query"); + let query1 = DriveQuery::from_cbor( + query_cbor.as_slice(), + &contract, + person_document_type, + &drive.config, + ) + .expect("should build query"); let sql_string = "select * from person where firstName in ('a', 'b') order by firstName limit 100"; - let query2 = DriveQuery::from_sql_expr(sql_string, &contract).expect("should build query"); + let query2 = DriveQuery::from_sql_expr(sql_string, &contract, &DriveConfig::default()) + .expect("should build query"); assert_eq!(query1, query2); } @@ -2599,8 +2710,13 @@ fn test_family_with_nulls_query() { .document_types .get("person") .expect("contract should have a person document type"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, person_document_type) - .expect("query should be built"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + person_document_type, + &drive.config, + ) + .expect("query should be built"); let (results, _, _) = query .execute_raw_results_no_proof(&drive, None, Some(&db_transaction)) .expect("proof should be executed"); @@ -2776,8 +2892,13 @@ fn test_dpns_query() { .document_types .get("domain") .expect("contract should have a domain document type"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, domain_document_type) - .expect("query should be built"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + domain_document_type, + &drive.config, + ) + .expect("query should be built"); let (results, _, _) = query .execute_raw_results_no_proof(&drive, None, Some(&db_transaction)) .expect("proof should be executed"); @@ -2823,8 +2944,13 @@ fn test_dpns_query() { .document_types .get("domain") .expect("contract should have a domain document type"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, domain_document_type) - .expect("query should be built"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + domain_document_type, + &drive.config, + ) + .expect("query should be built"); let (results, _, _) = query .execute_raw_results_no_proof(&drive, None, Some(&db_transaction)) .expect("proof should be executed"); @@ -2898,8 +3024,13 @@ fn test_dpns_query() { .document_types .get("domain") .expect("contract should have a domain document type"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, domain_document_type) - .expect("query should be built"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + domain_document_type, + &drive.config, + ) + .expect("query should be built"); let (results, _, _) = query .execute_raw_results_no_proof(&drive, None, Some(&db_transaction)) .expect("proof should be executed"); @@ -2952,8 +3083,13 @@ fn test_dpns_query() { .document_types .get("domain") .expect("contract should have a domain document type"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, domain_document_type) - .expect("query should be built"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + domain_document_type, + &drive.config, + ) + .expect("query should be built"); let (results, _, _) = query .execute_raw_results_no_proof(&drive, None, Some(&db_transaction)) .expect("proof should be executed"); @@ -3023,8 +3159,13 @@ fn test_dpns_query() { .document_types .get("domain") .expect("contract should have a domain document type"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, domain_document_type) - .expect("query should be built"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + domain_document_type, + &drive.config, + ) + .expect("query should be built"); let (results, _, _) = query .execute_raw_results_no_proof(&drive, None, Some(&db_transaction)) .expect("proof should be executed"); @@ -3075,8 +3216,13 @@ fn test_dpns_query() { .document_types .get("domain") .expect("contract should have a domain document type"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, domain_document_type) - .expect("query should be built"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + domain_document_type, + &drive.config, + ) + .expect("query should be built"); let (results, _, _) = query .execute_raw_results_no_proof(&drive, None, Some(&db_transaction)) .expect("proof should be executed"); @@ -3119,8 +3265,13 @@ fn test_dpns_query() { .document_types .get("domain") .expect("contract should have a domain document type"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, domain_document_type) - .expect("query should be built"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + domain_document_type, + &drive.config, + ) + .expect("query should be built"); let (results, _, _) = query .execute_raw_results_no_proof(&drive, None, Some(&db_transaction)) .expect("proof should be executed"); @@ -3296,8 +3447,13 @@ fn test_dpns_query_start_at() { .document_types .get("domain") .expect("contract should have a domain document type"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, domain_document_type) - .expect("query should be built"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + domain_document_type, + &drive.config, + ) + .expect("query should be built"); let (results, _, _) = query .execute_raw_results_no_proof(&drive, None, Some(&db_transaction)) .expect("proof should be executed"); @@ -3384,8 +3540,13 @@ fn test_dpns_query_start_after() { .document_types .get("domain") .expect("contract should have a domain document type"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, domain_document_type) - .expect("query should be built"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + domain_document_type, + &drive.config, + ) + .expect("query should be built"); let (results, _, _) = query .execute_raw_results_no_proof(&drive, None, Some(&db_transaction)) .expect("proof should be executed"); @@ -3472,8 +3633,13 @@ fn test_dpns_query_start_at_desc() { .document_types .get("domain") .expect("contract should have a domain document type"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, domain_document_type) - .expect("query should be built"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + domain_document_type, + &drive.config, + ) + .expect("query should be built"); let (results, _, _) = query .execute_raw_results_no_proof(&drive, None, Some(&db_transaction)) .expect("proof should be executed"); @@ -3560,8 +3726,13 @@ fn test_dpns_query_start_after_desc() { .document_types .get("domain") .expect("contract should have a domain document type"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, domain_document_type) - .expect("query should be built"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + domain_document_type, + &drive.config, + ) + .expect("query should be built"); let (results, _, _) = query .execute_raw_results_no_proof(&drive, None, Some(&db_transaction)) .expect("proof should be executed"); @@ -3746,8 +3917,13 @@ fn test_dpns_query_start_at_with_null_id() { .document_types .get("domain") .expect("contract should have a domain document type"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, domain_document_type) - .expect("query should be built"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + domain_document_type, + &drive.config, + ) + .expect("query should be built"); let (results, _, _) = query .execute_raw_results_no_proof(&drive, None, Some(&db_transaction)) @@ -3947,8 +4123,13 @@ fn test_dpns_query_start_after_with_null_id() { .document_types .get("domain") .expect("contract should have a domain document type"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, domain_document_type) - .expect("query should be built"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + domain_document_type, + &drive.config, + ) + .expect("query should be built"); // We are commenting this out on purpose to make it easier to find // let mut query_operations: Vec = vec![]; @@ -4160,8 +4341,13 @@ fn test_dpns_query_start_after_with_null_id_desc() { .document_types .get("domain") .expect("contract should have a domain document type"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, domain_document_type) - .expect("query should be built"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + domain_document_type, + &drive.config, + ) + .expect("query should be built"); let (results, _, _) = query .execute_raw_results_no_proof(&drive, None, Some(&db_transaction)) .expect("proof should be executed"); @@ -4209,8 +4395,13 @@ fn test_dpns_query_start_after_with_null_id_desc() { .document_types .get("domain") .expect("contract should have a domain document type"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, domain_document_type) - .expect("query should be built"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + domain_document_type, + &drive.config, + ) + .expect("query should be built"); let (results, _, _) = query .execute_raw_results_no_proof(&drive, None, Some(&db_transaction)) .expect("proof should be executed"); @@ -4258,8 +4449,13 @@ fn test_dpns_query_start_after_with_null_id_desc() { .document_types .get("domain") .expect("contract should have a domain document type"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, domain_document_type) - .expect("query should be built"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + domain_document_type, + &drive.config, + ) + .expect("query should be built"); let (results, _, _) = query .execute_raw_results_no_proof(&drive, None, Some(&db_transaction)) .expect("proof should be executed"); @@ -4523,8 +4719,13 @@ fn test_query_documents_by_created_at() { .document_type_for_name("indexedDocument") .expect("should get document type"); - let query = DriveQuery::from_cbor(&query_bytes, &contract, document_type) - .expect("should create a query from cbor"); + let query = DriveQuery::from_cbor( + &query_bytes, + &contract, + document_type, + &DriveConfig::default(), + ) + .expect("should create a query from cbor"); assert_eq!( query.internal_clauses.equal_clauses.get("$createdAt"), diff --git a/packages/rs-drive/tests/query_tests_history.rs b/packages/rs-drive/tests/query_tests_history.rs index 6039b54d95..99d3efb113 100644 --- a/packages/rs-drive/tests/query_tests_history.rs +++ b/packages/rs-drive/tests/query_tests_history.rs @@ -73,7 +73,7 @@ use drive::drive::object_size_info::{DocumentAndContractInfo, OwnedDocumentInfo} #[cfg(feature = "full")] use drive::drive::Drive; #[cfg(feature = "full")] -use drive::error::{query::QueryError, Error}; +use drive::error::{query::QuerySyntaxError, Error}; #[cfg(feature = "full")] use drive::query::DriveQuery; @@ -315,8 +315,13 @@ fn test_query_historical() { .document_types .get("person") .expect("contract should have a person document type"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, person_document_type) - .expect("query should be built"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + person_document_type, + &drive.config, + ) + .expect("query should be built"); let (results, _, _) = query .execute_raw_results_no_proof(&drive, None, Some(&db_transaction)) .expect("proof should be executed"); @@ -554,8 +559,13 @@ fn test_query_historical() { .document_types .get("person") .expect("contract should have a person document type"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, person_document_type) - .expect("query should be built"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + person_document_type, + &drive.config, + ) + .expect("query should be built"); let (results, _, _) = query .execute_raw_results_no_proof(&drive, None, None) .expect("proof should be executed"); @@ -600,8 +610,13 @@ fn test_query_historical() { .document_types .get("person") .expect("contract should have a person document type"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, person_document_type) - .expect("query should be built"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + person_document_type, + &drive.config, + ) + .expect("query should be built"); let (results, _, _) = query .execute_raw_results_no_proof(&drive, None, None) .expect("proof should be executed"); @@ -642,8 +657,13 @@ fn test_query_historical() { .document_types .get("person") .expect("contract should have a person document type"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, person_document_type) - .expect("query should be built"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + person_document_type, + &drive.config, + ) + .expect("query should be built"); let (results, _, _) = query .execute_raw_results_no_proof(&drive, None, None) .expect("proof should be executed"); @@ -718,8 +738,13 @@ fn test_query_historical() { .document_types .get("person") .expect("contract should have a person document type"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, person_document_type) - .expect("query should be built"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + person_document_type, + &drive.config, + ) + .expect("query should be built"); let (results, _, _) = query .execute_raw_results_no_proof(&drive, None, None) .expect("proof should be executed"); @@ -768,8 +793,13 @@ fn test_query_historical() { .document_types .get("person") .expect("contract should have a person document type"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, person_document_type) - .expect("query should be built"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + person_document_type, + &drive.config, + ) + .expect("query should be built"); let (results, _, _) = query .execute_raw_results_no_proof(&drive, None, None) .expect("proof should be executed"); @@ -812,8 +842,13 @@ fn test_query_historical() { .document_types .get("person") .expect("contract should have a person document type"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, person_document_type) - .expect("query should be built"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + person_document_type, + &drive.config, + ) + .expect("query should be built"); let (results, _, _) = query .execute_raw_results_no_proof(&drive, None, None) .expect("proof should be executed"); @@ -850,8 +885,13 @@ fn test_query_historical() { .document_types .get("person") .expect("contract should have a person document type"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, person_document_type) - .expect("query should be built"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + person_document_type, + &drive.config, + ) + .expect("query should be built"); let (results, _, _) = query .execute_raw_results_no_proof(&drive, None, None) .expect("proof should be executed"); @@ -921,8 +961,13 @@ fn test_query_historical() { .document_types .get("person") .expect("contract should have a person document type"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, person_document_type) - .expect("query should be built"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + person_document_type, + &drive.config, + ) + .expect("query should be built"); let (results, _, _) = query .execute_raw_results_no_proof(&drive, None, None) .expect("proof should be executed"); @@ -971,8 +1016,13 @@ fn test_query_historical() { .document_types .get("person") .expect("contract should have a person document type"); - let query = DriveQuery::from_cbor(where_cbor.as_slice(), &contract, person_document_type) - .expect("query should be built"); + let query = DriveQuery::from_cbor( + where_cbor.as_slice(), + &contract, + person_document_type, + &drive.config, + ) + .expect("query should be built"); let (results, _, _) = query .execute_raw_results_no_proof(&drive, None, None) .expect("proof should be executed"); @@ -1544,7 +1594,7 @@ fn test_query_historical() { ); assert!( - matches!(result, Err(Error::Query(QueryError::StartDocumentNotFound(message))) if message == "startAt document not found") + matches!(result, Err(Error::Query(QuerySyntaxError::StartDocumentNotFound(message))) if message == "startAt document not found") ); // using non existing document in startAfter @@ -1574,7 +1624,7 @@ fn test_query_historical() { ); assert!( - matches!(result, Err(Error::Query(QueryError::StartDocumentNotFound(message))) if message == "startAfter document not found") + matches!(result, Err(Error::Query(QuerySyntaxError::StartDocumentNotFound(message))) if message == "startAfter document not found") ); // validate eventual root hash diff --git a/packages/rs-platform-serialization/src/lib.rs b/packages/rs-platform-serialization/src/lib.rs index 691216e4d2..7c7a530ff7 100644 --- a/packages/rs-platform-serialization/src/lib.rs +++ b/packages/rs-platform-serialization/src/lib.rs @@ -3,8 +3,6 @@ extern crate proc_macro; use proc_macro::TokenStream; use quote::quote; -use syn::parse::Parser; -use syn::spanned::Spanned; use syn::{parse_macro_input, DeriveInput, Expr, Lit, Meta}; #[proc_macro_derive( diff --git a/packages/rs-platform-value/src/btreemap_extensions/btreemap_removal_extensions.rs b/packages/rs-platform-value/src/btreemap_extensions/btreemap_removal_extensions.rs index ce507cb336..645ec9f5f8 100644 --- a/packages/rs-platform-value/src/btreemap_extensions/btreemap_removal_extensions.rs +++ b/packages/rs-platform-value/src/btreemap_extensions/btreemap_removal_extensions.rs @@ -44,9 +44,41 @@ pub trait BTreeValueRemoveFromMapHelper { fn remove_bytes_32(&mut self, key: &str) -> Result; fn remove_optional_bytes_20(&mut self, key: &str) -> Result, Error>; fn remove_bytes_20(&mut self, key: &str) -> Result; + fn remove_optional_hash256s(&mut self, key: &str) -> Result>, Error>; + fn remove_hash256s(&mut self, key: &str) -> Result, Error>; + fn remove_identifiers(&mut self, key: &str) -> Result, Error>; + fn remove_optional_identifiers(&mut self, key: &str) -> Result>, Error>; } impl BTreeValueRemoveFromMapHelper for BTreeMap { + fn remove_optional_string(&mut self, key: &str) -> Result, Error> { + self.remove(key) + .and_then(|v| if v.is_null() { None } else { Some(v.to_text()) }) + .transpose() + } + + fn remove_string(&mut self, key: &str) -> Result { + self.remove_optional_string(key)? + .ok_or_else(|| Error::StructureError(format!("unable to remove string property {key}"))) + } + + fn remove_optional_float(&mut self, key: &str) -> Result, Error> { + self.remove(key) + .and_then(|v| { + if v.is_null() { + None + } else { + Some(v.to_float()) + } + }) + .transpose() + } + + fn remove_float(&mut self, key: &str) -> Result { + self.remove_optional_float(key)? + .ok_or_else(|| Error::StructureError(format!("unable to remove float property {key}"))) + } + fn remove_optional_integer(&mut self, key: &str) -> Result, Error> where T: TryFrom @@ -89,6 +121,52 @@ impl BTreeValueRemoveFromMapHelper for BTreeMap { }) } + fn remove_optional_hash256_bytes(&mut self, key: &str) -> Result, Error> { + self.remove(key) + .and_then(|v| { + if v.is_null() { + None + } else { + Some(v.to_hash256()) + } + }) + .transpose() + } + + fn remove_hash256_bytes(&mut self, key: &str) -> Result<[u8; 32], Error> { + self.remove_optional_hash256_bytes(key)?.ok_or_else(|| { + Error::StructureError(format!("unable to remove hash256 property {key}")) + }) + } + + fn remove_optional_bytes(&mut self, key: &str) -> Result>, Error> { + self.remove(key) + .and_then(|v| { + if v.is_null() { + None + } else { + Some(v.to_identifier_bytes()) + } + }) + .transpose() + } + + fn remove_bytes(&mut self, key: &str) -> Result, Error> { + self.remove_optional_bytes(key)? + .ok_or_else(|| Error::StructureError(format!("unable to remove bytes property {key}"))) + } + + fn remove_optional_bool(&mut self, key: &str) -> Result, Error> { + self.remove(key) + .and_then(|v| if v.is_null() { None } else { Some(v.to_bool()) }) + .transpose() + } + + fn remove_bool(&mut self, key: &str) -> Result { + self.remove_optional_bool(key)? + .ok_or_else(|| Error::StructureError(format!("unable to remove float property {key}"))) + } + fn remove_optional_identifier(&mut self, key: &str) -> Result, Error> { self.remove(key) .and_then(|v| { @@ -107,24 +185,24 @@ impl BTreeValueRemoveFromMapHelper for BTreeMap { }) } - fn remove_optional_bytes_20(&mut self, key: &str) -> Result, Error> { + fn remove_binary_data(&mut self, key: &str) -> Result { + self.remove_optional_binary_data(key)?.ok_or_else(|| { + Error::StructureError(format!("unable to remove binary data property {key}")) + }) + } + + fn remove_optional_binary_data(&mut self, key: &str) -> Result, Error> { self.remove(key) .and_then(|v| { if v.is_null() { None } else { - Some(v.to_bytes_20()) + Some(v.to_binary_data()) } }) .transpose() } - fn remove_bytes_20(&mut self, key: &str) -> Result { - self.remove_optional_bytes_20(key)?.ok_or_else(|| { - Error::StructureError(format!("unable to remove binary bytes 20 property {key}")) - }) - } - fn remove_optional_bytes_32(&mut self, key: &str) -> Result, Error> { self.remove(key) .and_then(|v| { @@ -143,100 +221,105 @@ impl BTreeValueRemoveFromMapHelper for BTreeMap { }) } - fn remove_optional_hash256_bytes(&mut self, key: &str) -> Result, Error> { + fn remove_optional_bytes_20(&mut self, key: &str) -> Result, Error> { self.remove(key) .and_then(|v| { if v.is_null() { None } else { - Some(v.to_hash256()) + Some(v.to_bytes_20()) } }) .transpose() } - fn remove_hash256_bytes(&mut self, key: &str) -> Result<[u8; 32], Error> { - self.remove_optional_hash256_bytes(key)?.ok_or_else(|| { - Error::StructureError(format!("unable to remove hash256 property {key}")) + fn remove_bytes_20(&mut self, key: &str) -> Result { + self.remove_optional_bytes_20(key)?.ok_or_else(|| { + Error::StructureError(format!("unable to remove binary bytes 20 property {key}")) }) } - fn remove_optional_bytes(&mut self, key: &str) -> Result>, Error> { + fn remove_optional_hash256s(&mut self, key: &str) -> Result>, Error> { self.remove(key) .and_then(|v| { if v.is_null() { None + } else if let Value::Array(array) = v { + Some( + array + .into_iter() + .map(|item| item.clone().into_hash256()) + .collect(), + ) } else { - Some(v.to_identifier_bytes()) + None } }) .transpose() } - fn remove_bytes(&mut self, key: &str) -> Result, Error> { - self.remove_optional_bytes(key)? - .ok_or_else(|| Error::StructureError(format!("unable to remove bytes property {key}"))) - } - - fn remove_optional_string(&mut self, key: &str) -> Result, Error> { - self.remove(key) - .and_then(|v| if v.is_null() { None } else { Some(v.to_text()) }) - .transpose() + fn remove_hash256s(&mut self, key: &str) -> Result, Error> { + self.remove_optional_hash256s(key)?.ok_or_else(|| { + Error::StructureError(format!("unable to remove identifier property {key}")) + }) } - fn remove_string(&mut self, key: &str) -> Result { - self.remove_optional_string(key)? - .ok_or_else(|| Error::StructureError(format!("unable to remove string property {key}"))) + fn remove_identifiers(&mut self, key: &str) -> Result, Error> { + self.remove_optional_identifiers(key)?.ok_or_else(|| { + Error::StructureError(format!("unable to remove identifier property {key}")) + }) } - fn remove_optional_float(&mut self, key: &str) -> Result, Error> { + fn remove_optional_identifiers(&mut self, key: &str) -> Result>, Error> { self.remove(key) .and_then(|v| { if v.is_null() { None + } else if let Value::Array(array) = v { + Some(array.iter().map(|item| item.to_identifier()).collect()) } else { - Some(v.to_float()) + None } }) .transpose() } +} - fn remove_float(&mut self, key: &str) -> Result { - self.remove_optional_float(key)? - .ok_or_else(|| Error::StructureError(format!("unable to remove float property {key}"))) - } - - fn remove_optional_bool(&mut self, key: &str) -> Result, Error> { +impl BTreeValueRemoveFromMapHelper for BTreeMap { + fn remove_optional_string(&mut self, key: &str) -> Result, Error> { self.remove(key) - .and_then(|v| if v.is_null() { None } else { Some(v.to_bool()) }) + .and_then(|v| { + if v.is_null() { + None + } else { + Some(v.into_text()) + } + }) .transpose() } - fn remove_bool(&mut self, key: &str) -> Result { - self.remove_optional_bool(key)? - .ok_or_else(|| Error::StructureError(format!("unable to remove float property {key}"))) - } - - fn remove_binary_data(&mut self, key: &str) -> Result { - self.remove_optional_binary_data(key)?.ok_or_else(|| { - Error::StructureError(format!("unable to remove binary data property {key}")) - }) + fn remove_string(&mut self, key: &str) -> Result { + self.remove_optional_string(key)? + .ok_or_else(|| Error::StructureError(format!("unable to remove string property {key}"))) } - fn remove_optional_binary_data(&mut self, key: &str) -> Result, Error> { + fn remove_optional_float(&mut self, key: &str) -> Result, Error> { self.remove(key) .and_then(|v| { if v.is_null() { None } else { - Some(v.to_binary_data()) + Some(v.into_float()) } }) .transpose() } -} -impl BTreeValueRemoveFromMapHelper for BTreeMap { + fn remove_float(&mut self, key: &str) -> Result { + self.remove_optional_float(key)? + .ok_or_else(|| Error::StructureError(format!("unable to remove float property {key}"))) + } + fn remove_optional_integer(&mut self, key: &str) -> Result, Error> where T: TryFrom @@ -279,160 +362,171 @@ impl BTreeValueRemoveFromMapHelper for BTreeMap { }) } - fn remove_optional_identifier(&mut self, key: &str) -> Result, Error> { + fn remove_optional_hash256_bytes(&mut self, key: &str) -> Result, Error> { self.remove(key) .and_then(|v| { if v.is_null() { None } else { - Some(v.into_identifier()) + Some(v.into_hash256()) } }) .transpose() } - fn remove_identifier(&mut self, key: &str) -> Result { - self.remove_optional_identifier(key)?.ok_or_else(|| { - Error::StructureError(format!("unable to remove identifier property {key}")) + fn remove_hash256_bytes(&mut self, key: &str) -> Result<[u8; 32], Error> { + self.remove_optional_hash256_bytes(key)?.ok_or_else(|| { + Error::StructureError(format!("unable to remove hash256 property {key}")) }) } - fn remove_optional_bytes_20(&mut self, key: &str) -> Result, Error> { + fn remove_optional_bytes(&mut self, key: &str) -> Result>, Error> { self.remove(key) .and_then(|v| { if v.is_null() { None } else { - Some(v.into_bytes_20()) + Some(v.into_identifier_bytes()) } }) .transpose() } - fn remove_bytes_20(&mut self, key: &str) -> Result { - self.remove_optional_bytes_20(key)?.ok_or_else(|| { - Error::StructureError(format!("unable to remove binary bytes 20 property {key}")) - }) + fn remove_bytes(&mut self, key: &str) -> Result, Error> { + self.remove_optional_bytes(key)? + .ok_or_else(|| Error::StructureError(format!("unable to remove bytes property {key}"))) } - fn remove_optional_bytes_32(&mut self, key: &str) -> Result, Error> { + fn remove_optional_bool(&mut self, key: &str) -> Result, Error> { self.remove(key) .and_then(|v| { if v.is_null() { None } else { - Some(v.into_bytes_32()) + Some(v.into_bool()) } }) .transpose() } - fn remove_bytes_32(&mut self, key: &str) -> Result { - self.remove_optional_bytes_32(key)?.ok_or_else(|| { - Error::StructureError(format!("unable to remove binary bytes 32 property {key}")) - }) + fn remove_bool(&mut self, key: &str) -> Result { + self.remove_optional_bool(key)? + .ok_or_else(|| Error::StructureError(format!("unable to remove float property {key}"))) } - fn remove_optional_hash256_bytes(&mut self, key: &str) -> Result, Error> { + fn remove_optional_identifier(&mut self, key: &str) -> Result, Error> { self.remove(key) .and_then(|v| { if v.is_null() { None } else { - Some(v.into_hash256()) + Some(v.into_identifier()) } }) .transpose() } - fn remove_hash256_bytes(&mut self, key: &str) -> Result<[u8; 32], Error> { - self.remove_optional_hash256_bytes(key)?.ok_or_else(|| { - Error::StructureError(format!("unable to remove hash256 property {key}")) + fn remove_identifier(&mut self, key: &str) -> Result { + self.remove_optional_identifier(key)?.ok_or_else(|| { + Error::StructureError(format!("unable to remove identifier property {key}")) }) } - fn remove_optional_bytes(&mut self, key: &str) -> Result>, Error> { + fn remove_binary_data(&mut self, key: &str) -> Result { + self.remove_optional_binary_data(key)? + .ok_or_else(|| Error::StructureError(format!("unable to remove bytes property {key}"))) + } + + fn remove_optional_binary_data(&mut self, key: &str) -> Result, Error> { self.remove(key) .and_then(|v| { if v.is_null() { None } else { - Some(v.into_identifier_bytes()) + Some(v.into_binary_data()) } }) .transpose() } - fn remove_bytes(&mut self, key: &str) -> Result, Error> { - self.remove_optional_bytes(key)? - .ok_or_else(|| Error::StructureError(format!("unable to remove bytes property {key}"))) - } - - fn remove_optional_binary_data(&mut self, key: &str) -> Result, Error> { + fn remove_optional_bytes_32(&mut self, key: &str) -> Result, Error> { self.remove(key) .and_then(|v| { if v.is_null() { None } else { - Some(v.into_binary_data()) + Some(v.into_bytes_32()) } }) .transpose() } - fn remove_binary_data(&mut self, key: &str) -> Result { - self.remove_optional_binary_data(key)? - .ok_or_else(|| Error::StructureError(format!("unable to remove bytes property {key}"))) + fn remove_bytes_32(&mut self, key: &str) -> Result { + self.remove_optional_bytes_32(key)?.ok_or_else(|| { + Error::StructureError(format!("unable to remove binary bytes 32 property {key}")) + }) } - fn remove_optional_string(&mut self, key: &str) -> Result, Error> { + fn remove_optional_bytes_20(&mut self, key: &str) -> Result, Error> { self.remove(key) .and_then(|v| { if v.is_null() { None } else { - Some(v.into_text()) + Some(v.into_bytes_20()) } }) .transpose() } - fn remove_string(&mut self, key: &str) -> Result { - self.remove_optional_string(key)? - .ok_or_else(|| Error::StructureError(format!("unable to remove string property {key}"))) + fn remove_bytes_20(&mut self, key: &str) -> Result { + self.remove_optional_bytes_20(key)?.ok_or_else(|| { + Error::StructureError(format!("unable to remove binary bytes 20 property {key}")) + }) } - fn remove_optional_float(&mut self, key: &str) -> Result, Error> { + fn remove_optional_hash256s(&mut self, key: &str) -> Result>, Error> { self.remove(key) .and_then(|v| { if v.is_null() { None + } else if let Value::Array(array) = v { + Some(array.into_iter().map(|item| item.into_hash256()).collect()) } else { - Some(v.into_float()) + None } }) .transpose() } - fn remove_float(&mut self, key: &str) -> Result { - self.remove_optional_float(key)? - .ok_or_else(|| Error::StructureError(format!("unable to remove float property {key}"))) + fn remove_hash256s(&mut self, key: &str) -> Result, Error> { + self.remove_optional_hash256s(key)?.ok_or_else(|| { + Error::StructureError(format!("unable to remove identifier property {key}")) + }) } - fn remove_optional_bool(&mut self, key: &str) -> Result, Error> { + fn remove_identifiers(&mut self, key: &str) -> Result, Error> { + self.remove_optional_identifiers(key)?.ok_or_else(|| { + Error::StructureError(format!("unable to remove identifier property {key}")) + }) + } + + fn remove_optional_identifiers(&mut self, key: &str) -> Result>, Error> { self.remove(key) .and_then(|v| { if v.is_null() { None + } else if let Value::Array(array) = v { + Some( + array + .into_iter() + .map(|item| item.into_identifier()) + .collect(), + ) } else { - Some(v.into_bool()) + None } }) .transpose() } - - fn remove_bool(&mut self, key: &str) -> Result { - self.remove_optional_bool(key)? - .ok_or_else(|| Error::StructureError(format!("unable to remove float property {key}"))) - } } diff --git a/packages/rs-platform-value/src/types/identifier.rs b/packages/rs-platform-value/src/types/identifier.rs index 48a8396c6b..856ca9af68 100644 --- a/packages/rs-platform-value/src/types/identifier.rs +++ b/packages/rs-platform-value/src/types/identifier.rs @@ -4,7 +4,7 @@ use rand::Rng; use std::convert::{TryFrom, TryInto}; use std::fmt; -use serde::de::{Error as SerdeDeError, Visitor}; +use serde::de::Visitor; use serde::{Deserialize, Serialize}; use serde_json::Value as JsonValue;