@routerprotocol/chain-api
Version:
Router Chain API Query client with generated gRPC bindings.
102 lines (91 loc) • 4.11 kB
TypeScript
// package: ethermint.feemarket.v1
// file: ethermint/feemarket/v1/query.proto
import * as ethermint_feemarket_v1_query_pb from "../../../ethermint/feemarket/v1/query_pb";
import {grpc} from "@improbable-eng/grpc-web";
type QueryParams = {
readonly methodName: string;
readonly service: typeof Query;
readonly requestStream: false;
readonly responseStream: false;
readonly requestType: typeof ethermint_feemarket_v1_query_pb.QueryParamsRequest;
readonly responseType: typeof ethermint_feemarket_v1_query_pb.QueryParamsResponse;
};
type QueryBaseFee = {
readonly methodName: string;
readonly service: typeof Query;
readonly requestStream: false;
readonly responseStream: false;
readonly requestType: typeof ethermint_feemarket_v1_query_pb.QueryBaseFeeRequest;
readonly responseType: typeof ethermint_feemarket_v1_query_pb.QueryBaseFeeResponse;
};
type QueryBlockGas = {
readonly methodName: string;
readonly service: typeof Query;
readonly requestStream: false;
readonly responseStream: false;
readonly requestType: typeof ethermint_feemarket_v1_query_pb.QueryBlockGasRequest;
readonly responseType: typeof ethermint_feemarket_v1_query_pb.QueryBlockGasResponse;
};
export class Query {
static readonly serviceName: string;
static readonly Params: QueryParams;
static readonly BaseFee: QueryBaseFee;
static readonly BlockGas: QueryBlockGas;
}
export type ServiceError = { message: string, code: number; metadata: grpc.Metadata }
export type Status = { details: string, code: number; metadata: grpc.Metadata }
interface UnaryResponse {
cancel(): void;
}
interface ResponseStream<T> {
cancel(): void;
on(type: 'data', handler: (message: T) => void): ResponseStream<T>;
on(type: 'end', handler: (status?: Status) => void): ResponseStream<T>;
on(type: 'status', handler: (status: Status) => void): ResponseStream<T>;
}
interface RequestStream<T> {
write(message: T): RequestStream<T>;
end(): void;
cancel(): void;
on(type: 'end', handler: (status?: Status) => void): RequestStream<T>;
on(type: 'status', handler: (status: Status) => void): RequestStream<T>;
}
interface BidirectionalStream<ReqT, ResT> {
write(message: ReqT): BidirectionalStream<ReqT, ResT>;
end(): void;
cancel(): void;
on(type: 'data', handler: (message: ResT) => void): BidirectionalStream<ReqT, ResT>;
on(type: 'end', handler: (status?: Status) => void): BidirectionalStream<ReqT, ResT>;
on(type: 'status', handler: (status: Status) => void): BidirectionalStream<ReqT, ResT>;
}
export class QueryClient {
readonly serviceHost: string;
constructor(serviceHost: string, options?: grpc.RpcOptions);
params(
requestMessage: ethermint_feemarket_v1_query_pb.QueryParamsRequest,
metadata: grpc.Metadata,
callback: (error: ServiceError|null, responseMessage: ethermint_feemarket_v1_query_pb.QueryParamsResponse|null) => void
): UnaryResponse;
params(
requestMessage: ethermint_feemarket_v1_query_pb.QueryParamsRequest,
callback: (error: ServiceError|null, responseMessage: ethermint_feemarket_v1_query_pb.QueryParamsResponse|null) => void
): UnaryResponse;
baseFee(
requestMessage: ethermint_feemarket_v1_query_pb.QueryBaseFeeRequest,
metadata: grpc.Metadata,
callback: (error: ServiceError|null, responseMessage: ethermint_feemarket_v1_query_pb.QueryBaseFeeResponse|null) => void
): UnaryResponse;
baseFee(
requestMessage: ethermint_feemarket_v1_query_pb.QueryBaseFeeRequest,
callback: (error: ServiceError|null, responseMessage: ethermint_feemarket_v1_query_pb.QueryBaseFeeResponse|null) => void
): UnaryResponse;
blockGas(
requestMessage: ethermint_feemarket_v1_query_pb.QueryBlockGasRequest,
metadata: grpc.Metadata,
callback: (error: ServiceError|null, responseMessage: ethermint_feemarket_v1_query_pb.QueryBlockGasResponse|null) => void
): UnaryResponse;
blockGas(
requestMessage: ethermint_feemarket_v1_query_pb.QueryBlockGasRequest,
callback: (error: ServiceError|null, responseMessage: ethermint_feemarket_v1_query_pb.QueryBlockGasResponse|null) => void
): UnaryResponse;
}