diff --git a/packages/node/src/proto/rpc.proto b/packages/node/src/proto/rpc.proto index 8936edc1..65f70a67 100644 --- a/packages/node/src/proto/rpc.proto +++ b/packages/node/src/proto/rpc.proto @@ -3,7 +3,7 @@ package topology.node; service TopologyRpc { rpc subscribeCro (SubscribeCroRequest ) returns (SubscribeCroResponse ); - rpc unsubscribeCro (UnsubscribeCroRequest ) returns (UnsubscribeCroRequest ); + rpc unsubscribeCro (UnsubscribeCroRequest ) returns (UnsubscribeCroResponse ); rpc getCroHashGraph (GetCroHashGraphRequest ) returns (GetCroHashGraphResponse ); } diff --git a/packages/node/src/proto/rpc_grpc_pb.js b/packages/node/src/proto/rpc_grpc_pb.js index 11303b9a..fbb71865 100644 --- a/packages/node/src/proto/rpc_grpc_pb.js +++ b/packages/node/src/proto/rpc_grpc_pb.js @@ -45,6 +45,15 @@ function deserialize_topology_node_UnsubscribeCroRequest(buffer_arg) { return node_src_proto_rpc_pb.UnsubscribeCroRequest.decode(new Uint8Array(buffer_arg)); } +function serialize_topology_node_UnsubscribeCroResponse(arg) { + let encoded = node_src_proto_rpc_pb.UnsubscribeCroResponse.encode(arg).finish() + return Buffer.from(encoded); +} + +function deserialize_topology_node_UnsubscribeCroResponse(buffer_arg) { + return node_src_proto_rpc_pb.UnsubscribeCroResponse.decode(new Uint8Array(buffer_arg)); +} + export const TopologyRpcService = { subscribeCro: { path: '/topology.node.TopologyRpc/subscribeCro', @@ -62,11 +71,11 @@ export const TopologyRpcService = { requestStream: false, responseStream: false, requestType: node_src_proto_rpc_pb.UnsubscribeCroRequest, - responseType: node_src_proto_rpc_pb.UnsubscribeCroRequest, + responseType: node_src_proto_rpc_pb.UnsubscribeCroResponse, requestSerialize: serialize_topology_node_UnsubscribeCroRequest, requestDeserialize: deserialize_topology_node_UnsubscribeCroRequest, - responseSerialize: serialize_topology_node_UnsubscribeCroRequest, - responseDeserialize: deserialize_topology_node_UnsubscribeCroRequest, + responseSerialize: serialize_topology_node_UnsubscribeCroResponse, + responseDeserialize: deserialize_topology_node_UnsubscribeCroResponse, }, getCroHashGraph: { path: '/topology.node.TopologyRpc/getCroHashGraph', diff --git a/packages/node/src/proto/rpc_pb.ts b/packages/node/src/proto/rpc_pb.ts index ab6ad9ba..76d35e63 100644 --- a/packages/node/src/proto/rpc_pb.ts +++ b/packages/node/src/proto/rpc_pb.ts @@ -10,430 +10,430 @@ import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; export const protobufPackage = "topology.node"; export interface SubscribeCroRequest { - croId: string; + croId: string; } export interface SubscribeCroResponse { - /** can return error codes if different than 0 */ - returnCode: number; + /** can return error codes if different than 0 */ + returnCode: number; } export interface UnsubscribeCroRequest { - croId: string; + croId: string; } export interface UnsubscribeCroResponse { - /** can return error codes if different than 0 */ - returnCode: number; + /** can return error codes if different than 0 */ + returnCode: number; } export interface GetCroHashGraphRequest { - croId: string; + croId: string; } export interface GetCroHashGraphResponse { - /** linearized vertices hashes */ - verticesHashes: string[]; + /** linearized vertices hashes */ + verticesHashes: string[]; } function createBaseSubscribeCroRequest(): SubscribeCroRequest { - return { croId: "" }; + return { croId: "" }; } export const SubscribeCroRequest = { - encode(message: SubscribeCroRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.croId !== "") { - writer.uint32(10).string(message.croId); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): SubscribeCroRequest { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSubscribeCroRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.croId = reader.string(); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): SubscribeCroRequest { - return { croId: isSet(object.croId) ? globalThis.String(object.croId) : "" }; - }, - - toJSON(message: SubscribeCroRequest): unknown { - const obj: any = {}; - if (message.croId !== "") { - obj.croId = message.croId; - } - return obj; - }, - - create, I>>(base?: I): SubscribeCroRequest { - return SubscribeCroRequest.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): SubscribeCroRequest { - const message = createBaseSubscribeCroRequest(); - message.croId = object.croId ?? ""; - return message; - }, + encode(message: SubscribeCroRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.croId !== "") { + writer.uint32(10).string(message.croId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SubscribeCroRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubscribeCroRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.croId = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SubscribeCroRequest { + return { croId: isSet(object.croId) ? globalThis.String(object.croId) : "" }; + }, + + toJSON(message: SubscribeCroRequest): unknown { + const obj: any = {}; + if (message.croId !== "") { + obj.croId = message.croId; + } + return obj; + }, + + create, I>>(base?: I): SubscribeCroRequest { + return SubscribeCroRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): SubscribeCroRequest { + const message = createBaseSubscribeCroRequest(); + message.croId = object.croId ?? ""; + return message; + }, }; function createBaseSubscribeCroResponse(): SubscribeCroResponse { - return { returnCode: 0 }; + return { returnCode: 0 }; } export const SubscribeCroResponse = { - encode(message: SubscribeCroResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.returnCode !== 0) { - writer.uint32(8).int32(message.returnCode); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): SubscribeCroResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSubscribeCroResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 8) { - break; - } - - message.returnCode = reader.int32(); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): SubscribeCroResponse { - return { returnCode: isSet(object.returnCode) ? globalThis.Number(object.returnCode) : 0 }; - }, - - toJSON(message: SubscribeCroResponse): unknown { - const obj: any = {}; - if (message.returnCode !== 0) { - obj.returnCode = Math.round(message.returnCode); - } - return obj; - }, - - create, I>>(base?: I): SubscribeCroResponse { - return SubscribeCroResponse.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): SubscribeCroResponse { - const message = createBaseSubscribeCroResponse(); - message.returnCode = object.returnCode ?? 0; - return message; - }, + encode(message: SubscribeCroResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.returnCode !== 0) { + writer.uint32(8).int32(message.returnCode); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): SubscribeCroResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSubscribeCroResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.returnCode = reader.int32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): SubscribeCroResponse { + return { returnCode: isSet(object.returnCode) ? globalThis.Number(object.returnCode) : 0 }; + }, + + toJSON(message: SubscribeCroResponse): unknown { + const obj: any = {}; + if (message.returnCode !== 0) { + obj.returnCode = Math.round(message.returnCode); + } + return obj; + }, + + create, I>>(base?: I): SubscribeCroResponse { + return SubscribeCroResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): SubscribeCroResponse { + const message = createBaseSubscribeCroResponse(); + message.returnCode = object.returnCode ?? 0; + return message; + }, }; function createBaseUnsubscribeCroRequest(): UnsubscribeCroRequest { - return { croId: "" }; + return { croId: "" }; } export const UnsubscribeCroRequest = { - encode(message: UnsubscribeCroRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.croId !== "") { - writer.uint32(10).string(message.croId); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): UnsubscribeCroRequest { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUnsubscribeCroRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.croId = reader.string(); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): UnsubscribeCroRequest { - return { croId: isSet(object.croId) ? globalThis.String(object.croId) : "" }; - }, - - toJSON(message: UnsubscribeCroRequest): unknown { - const obj: any = {}; - if (message.croId !== "") { - obj.croId = message.croId; - } - return obj; - }, - - create, I>>(base?: I): UnsubscribeCroRequest { - return UnsubscribeCroRequest.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): UnsubscribeCroRequest { - const message = createBaseUnsubscribeCroRequest(); - message.croId = object.croId ?? ""; - return message; - }, + encode(message: UnsubscribeCroRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.croId !== "") { + writer.uint32(10).string(message.croId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UnsubscribeCroRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUnsubscribeCroRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.croId = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): UnsubscribeCroRequest { + return { croId: isSet(object.croId) ? globalThis.String(object.croId) : "" }; + }, + + toJSON(message: UnsubscribeCroRequest): unknown { + const obj: any = {}; + if (message.croId !== "") { + obj.croId = message.croId; + } + return obj; + }, + + create, I>>(base?: I): UnsubscribeCroRequest { + return UnsubscribeCroRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): UnsubscribeCroRequest { + const message = createBaseUnsubscribeCroRequest(); + message.croId = object.croId ?? ""; + return message; + }, }; function createBaseUnsubscribeCroResponse(): UnsubscribeCroResponse { - return { returnCode: 0 }; + return { returnCode: 0 }; } export const UnsubscribeCroResponse = { - encode(message: UnsubscribeCroResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.returnCode !== 0) { - writer.uint32(8).int32(message.returnCode); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): UnsubscribeCroResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUnsubscribeCroResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 8) { - break; - } - - message.returnCode = reader.int32(); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): UnsubscribeCroResponse { - return { returnCode: isSet(object.returnCode) ? globalThis.Number(object.returnCode) : 0 }; - }, - - toJSON(message: UnsubscribeCroResponse): unknown { - const obj: any = {}; - if (message.returnCode !== 0) { - obj.returnCode = Math.round(message.returnCode); - } - return obj; - }, - - create, I>>(base?: I): UnsubscribeCroResponse { - return UnsubscribeCroResponse.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): UnsubscribeCroResponse { - const message = createBaseUnsubscribeCroResponse(); - message.returnCode = object.returnCode ?? 0; - return message; - }, + encode(message: UnsubscribeCroResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.returnCode !== 0) { + writer.uint32(8).int32(message.returnCode); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): UnsubscribeCroResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUnsubscribeCroResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 8) { + break; + } + + message.returnCode = reader.int32(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): UnsubscribeCroResponse { + return { returnCode: isSet(object.returnCode) ? globalThis.Number(object.returnCode) : 0 }; + }, + + toJSON(message: UnsubscribeCroResponse): unknown { + const obj: any = {}; + if (message.returnCode !== 0) { + obj.returnCode = Math.round(message.returnCode); + } + return obj; + }, + + create, I>>(base?: I): UnsubscribeCroResponse { + return UnsubscribeCroResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): UnsubscribeCroResponse { + const message = createBaseUnsubscribeCroResponse(); + message.returnCode = object.returnCode ?? 0; + return message; + }, }; function createBaseGetCroHashGraphRequest(): GetCroHashGraphRequest { - return { croId: "" }; + return { croId: "" }; } export const GetCroHashGraphRequest = { - encode(message: GetCroHashGraphRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - if (message.croId !== "") { - writer.uint32(10).string(message.croId); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): GetCroHashGraphRequest { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetCroHashGraphRequest(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.croId = reader.string(); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): GetCroHashGraphRequest { - return { croId: isSet(object.croId) ? globalThis.String(object.croId) : "" }; - }, - - toJSON(message: GetCroHashGraphRequest): unknown { - const obj: any = {}; - if (message.croId !== "") { - obj.croId = message.croId; - } - return obj; - }, - - create, I>>(base?: I): GetCroHashGraphRequest { - return GetCroHashGraphRequest.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): GetCroHashGraphRequest { - const message = createBaseGetCroHashGraphRequest(); - message.croId = object.croId ?? ""; - return message; - }, + encode(message: GetCroHashGraphRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + if (message.croId !== "") { + writer.uint32(10).string(message.croId); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): GetCroHashGraphRequest { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetCroHashGraphRequest(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.croId = reader.string(); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): GetCroHashGraphRequest { + return { croId: isSet(object.croId) ? globalThis.String(object.croId) : "" }; + }, + + toJSON(message: GetCroHashGraphRequest): unknown { + const obj: any = {}; + if (message.croId !== "") { + obj.croId = message.croId; + } + return obj; + }, + + create, I>>(base?: I): GetCroHashGraphRequest { + return GetCroHashGraphRequest.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): GetCroHashGraphRequest { + const message = createBaseGetCroHashGraphRequest(); + message.croId = object.croId ?? ""; + return message; + }, }; function createBaseGetCroHashGraphResponse(): GetCroHashGraphResponse { - return { verticesHashes: [] }; + return { verticesHashes: [] }; } export const GetCroHashGraphResponse = { - encode(message: GetCroHashGraphResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { - for (const v of message.verticesHashes) { - writer.uint32(10).string(v!); - } - return writer; - }, - - decode(input: BinaryReader | Uint8Array, length?: number): GetCroHashGraphResponse { - const reader = input instanceof BinaryReader ? input : new BinaryReader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGetCroHashGraphResponse(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (tag !== 10) { - break; - } - - message.verticesHashes.push(reader.string()); - continue; - } - if ((tag & 7) === 4 || tag === 0) { - break; - } - reader.skip(tag & 7); - } - return message; - }, - - fromJSON(object: any): GetCroHashGraphResponse { - return { - verticesHashes: globalThis.Array.isArray(object?.verticesHashes) - ? object.verticesHashes.map((e: any) => globalThis.String(e)) - : [], - }; - }, - - toJSON(message: GetCroHashGraphResponse): unknown { - const obj: any = {}; - if (message.verticesHashes?.length) { - obj.verticesHashes = message.verticesHashes; - } - return obj; - }, - - create, I>>(base?: I): GetCroHashGraphResponse { - return GetCroHashGraphResponse.fromPartial(base ?? ({} as any)); - }, - fromPartial, I>>(object: I): GetCroHashGraphResponse { - const message = createBaseGetCroHashGraphResponse(); - message.verticesHashes = object.verticesHashes?.map((e) => e) || []; - return message; - }, + encode(message: GetCroHashGraphResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter { + for (const v of message.verticesHashes) { + writer.uint32(10).string(v!); + } + return writer; + }, + + decode(input: BinaryReader | Uint8Array, length?: number): GetCroHashGraphResponse { + const reader = input instanceof BinaryReader ? input : new BinaryReader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGetCroHashGraphResponse(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (tag !== 10) { + break; + } + + message.verticesHashes.push(reader.string()); + continue; + } + if ((tag & 7) === 4 || tag === 0) { + break; + } + reader.skip(tag & 7); + } + return message; + }, + + fromJSON(object: any): GetCroHashGraphResponse { + return { + verticesHashes: globalThis.Array.isArray(object?.verticesHashes) + ? object.verticesHashes.map((e: any) => globalThis.String(e)) + : [], + }; + }, + + toJSON(message: GetCroHashGraphResponse): unknown { + const obj: any = {}; + if (message.verticesHashes?.length) { + obj.verticesHashes = message.verticesHashes; + } + return obj; + }, + + create, I>>(base?: I): GetCroHashGraphResponse { + return GetCroHashGraphResponse.fromPartial(base ?? ({} as any)); + }, + fromPartial, I>>(object: I): GetCroHashGraphResponse { + const message = createBaseGetCroHashGraphResponse(); + message.verticesHashes = object.verticesHashes?.map((e) => e) || []; + return message; + }, }; export interface TopologyRpc { - subscribeCro(request: SubscribeCroRequest): Promise; - unsubscribeCro(request: UnsubscribeCroRequest): Promise; - getCroHashGraph(request: GetCroHashGraphRequest): Promise; + subscribeCro(request: SubscribeCroRequest): Promise; + unsubscribeCro(request: UnsubscribeCroRequest): Promise; + getCroHashGraph(request: GetCroHashGraphRequest): Promise; } export const TopologyRpcServiceName = "topology.node.TopologyRpc"; export class TopologyRpcClientImpl implements TopologyRpc { - private readonly rpc: Rpc; - private readonly service: string; - constructor(rpc: Rpc, opts?: { service?: string }) { - this.service = opts?.service || TopologyRpcServiceName; - this.rpc = rpc; - this.subscribeCro = this.subscribeCro.bind(this); - this.unsubscribeCro = this.unsubscribeCro.bind(this); - this.getCroHashGraph = this.getCroHashGraph.bind(this); - } - subscribeCro(request: SubscribeCroRequest): Promise { - const data = SubscribeCroRequest.encode(request).finish(); - const promise = this.rpc.request(this.service, "subscribeCro", data); - return promise.then((data) => SubscribeCroResponse.decode(new BinaryReader(data))); - } - - unsubscribeCro(request: UnsubscribeCroRequest): Promise { - const data = UnsubscribeCroRequest.encode(request).finish(); - const promise = this.rpc.request(this.service, "unsubscribeCro", data); - return promise.then((data) => UnsubscribeCroRequest.decode(new BinaryReader(data))); - } - - getCroHashGraph(request: GetCroHashGraphRequest): Promise { - const data = GetCroHashGraphRequest.encode(request).finish(); - const promise = this.rpc.request(this.service, "getCroHashGraph", data); - return promise.then((data) => GetCroHashGraphResponse.decode(new BinaryReader(data))); - } + private readonly rpc: Rpc; + private readonly service: string; + constructor(rpc: Rpc, opts?: { service?: string }) { + this.service = opts?.service || TopologyRpcServiceName; + this.rpc = rpc; + this.subscribeCro = this.subscribeCro.bind(this); + this.unsubscribeCro = this.unsubscribeCro.bind(this); + this.getCroHashGraph = this.getCroHashGraph.bind(this); + } + subscribeCro(request: SubscribeCroRequest): Promise { + const data = SubscribeCroRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, "subscribeCro", data); + return promise.then((data) => SubscribeCroResponse.decode(new BinaryReader(data))); + } + + unsubscribeCro(request: UnsubscribeCroRequest): Promise { + const data = UnsubscribeCroRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, "unsubscribeCro", data); + return promise.then((data) => UnsubscribeCroResponse.decode(new BinaryReader(data))); + } + + getCroHashGraph(request: GetCroHashGraphRequest): Promise { + const data = GetCroHashGraphRequest.encode(request).finish(); + const promise = this.rpc.request(this.service, "getCroHashGraph", data); + return promise.then((data) => GetCroHashGraphResponse.decode(new BinaryReader(data))); + } } interface Rpc { - request(service: string, method: string, data: Uint8Array): Promise; + request(service: string, method: string, data: Uint8Array): Promise; } type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; export type DeepPartial = T extends Builtin ? T - : T extends globalThis.Array ? globalThis.Array> - : T extends ReadonlyArray ? ReadonlyArray> - : T extends {} ? { [K in keyof T]?: DeepPartial } - : Partial; + : T extends globalThis.Array ? globalThis.Array> + : T extends ReadonlyArray ? ReadonlyArray> + : T extends {} ? { [K in keyof T]?: DeepPartial } + : Partial; type KeysOfUnion = T extends T ? keyof T : never; export type Exact = P extends Builtin ? P - : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; + : P & { [K in keyof P]: Exact } & { [K in Exclude>]: never }; function isSet(value: any): boolean { - return value !== null && value !== undefined; + return value !== null && value !== undefined; }