@injectivelabs/exchange-api
Version:
Injective Exchange API client with generated gRPC bindings.
257 lines (237 loc) • 11.8 kB
TypeScript
// package: injective_explorer_rpc
// file: injective_explorer_rpc.proto
import * as injective_explorer_rpc_pb from "./injective_explorer_rpc_pb";
import {grpc} from "@improbable-eng/grpc-web";
type InjectiveExplorerRPCGetAccountTxs = {
readonly methodName: string;
readonly service: typeof InjectiveExplorerRPC;
readonly requestStream: false;
readonly responseStream: false;
readonly requestType: typeof injective_explorer_rpc_pb.GetAccountTxsRequest;
readonly responseType: typeof injective_explorer_rpc_pb.GetAccountTxsResponse;
};
type InjectiveExplorerRPCGetBlocks = {
readonly methodName: string;
readonly service: typeof InjectiveExplorerRPC;
readonly requestStream: false;
readonly responseStream: false;
readonly requestType: typeof injective_explorer_rpc_pb.GetBlocksRequest;
readonly responseType: typeof injective_explorer_rpc_pb.GetBlocksResponse;
};
type InjectiveExplorerRPCGetBlock = {
readonly methodName: string;
readonly service: typeof InjectiveExplorerRPC;
readonly requestStream: false;
readonly responseStream: false;
readonly requestType: typeof injective_explorer_rpc_pb.GetBlockRequest;
readonly responseType: typeof injective_explorer_rpc_pb.GetBlockResponse;
};
type InjectiveExplorerRPCGetValidator = {
readonly methodName: string;
readonly service: typeof InjectiveExplorerRPC;
readonly requestStream: false;
readonly responseStream: false;
readonly requestType: typeof injective_explorer_rpc_pb.GetValidatorRequest;
readonly responseType: typeof injective_explorer_rpc_pb.GetValidatorResponse;
};
type InjectiveExplorerRPCGetValidatorUptime = {
readonly methodName: string;
readonly service: typeof InjectiveExplorerRPC;
readonly requestStream: false;
readonly responseStream: false;
readonly requestType: typeof injective_explorer_rpc_pb.GetValidatorUptimeRequest;
readonly responseType: typeof injective_explorer_rpc_pb.GetValidatorUptimeResponse;
};
type InjectiveExplorerRPCGetTxs = {
readonly methodName: string;
readonly service: typeof InjectiveExplorerRPC;
readonly requestStream: false;
readonly responseStream: false;
readonly requestType: typeof injective_explorer_rpc_pb.GetTxsRequest;
readonly responseType: typeof injective_explorer_rpc_pb.GetTxsResponse;
};
type InjectiveExplorerRPCGetTxByTxHash = {
readonly methodName: string;
readonly service: typeof InjectiveExplorerRPC;
readonly requestStream: false;
readonly responseStream: false;
readonly requestType: typeof injective_explorer_rpc_pb.GetTxByTxHashRequest;
readonly responseType: typeof injective_explorer_rpc_pb.GetTxByTxHashResponse;
};
type InjectiveExplorerRPCStreamTxs = {
readonly methodName: string;
readonly service: typeof InjectiveExplorerRPC;
readonly requestStream: false;
readonly responseStream: true;
readonly requestType: typeof injective_explorer_rpc_pb.StreamTxsRequest;
readonly responseType: typeof injective_explorer_rpc_pb.StreamTxsResponse;
};
type InjectiveExplorerRPCStreamBlocks = {
readonly methodName: string;
readonly service: typeof InjectiveExplorerRPC;
readonly requestStream: false;
readonly responseStream: true;
readonly requestType: typeof injective_explorer_rpc_pb.StreamBlocksRequest;
readonly responseType: typeof injective_explorer_rpc_pb.StreamBlocksResponse;
};
type InjectiveExplorerRPCGetPeggyDepositTxs = {
readonly methodName: string;
readonly service: typeof InjectiveExplorerRPC;
readonly requestStream: false;
readonly responseStream: false;
readonly requestType: typeof injective_explorer_rpc_pb.GetPeggyDepositTxsRequest;
readonly responseType: typeof injective_explorer_rpc_pb.GetPeggyDepositTxsResponse;
};
type InjectiveExplorerRPCGetPeggyWithdrawalTxs = {
readonly methodName: string;
readonly service: typeof InjectiveExplorerRPC;
readonly requestStream: false;
readonly responseStream: false;
readonly requestType: typeof injective_explorer_rpc_pb.GetPeggyWithdrawalTxsRequest;
readonly responseType: typeof injective_explorer_rpc_pb.GetPeggyWithdrawalTxsResponse;
};
type InjectiveExplorerRPCGetIBCTransferTxs = {
readonly methodName: string;
readonly service: typeof InjectiveExplorerRPC;
readonly requestStream: false;
readonly responseStream: false;
readonly requestType: typeof injective_explorer_rpc_pb.GetIBCTransferTxsRequest;
readonly responseType: typeof injective_explorer_rpc_pb.GetIBCTransferTxsResponse;
};
export class InjectiveExplorerRPC {
static readonly serviceName: string;
static readonly GetAccountTxs: InjectiveExplorerRPCGetAccountTxs;
static readonly GetBlocks: InjectiveExplorerRPCGetBlocks;
static readonly GetBlock: InjectiveExplorerRPCGetBlock;
static readonly GetValidator: InjectiveExplorerRPCGetValidator;
static readonly GetValidatorUptime: InjectiveExplorerRPCGetValidatorUptime;
static readonly GetTxs: InjectiveExplorerRPCGetTxs;
static readonly GetTxByTxHash: InjectiveExplorerRPCGetTxByTxHash;
static readonly StreamTxs: InjectiveExplorerRPCStreamTxs;
static readonly StreamBlocks: InjectiveExplorerRPCStreamBlocks;
static readonly GetPeggyDepositTxs: InjectiveExplorerRPCGetPeggyDepositTxs;
static readonly GetPeggyWithdrawalTxs: InjectiveExplorerRPCGetPeggyWithdrawalTxs;
static readonly GetIBCTransferTxs: InjectiveExplorerRPCGetIBCTransferTxs;
}
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 InjectiveExplorerRPCClient {
readonly serviceHost: string;
constructor(serviceHost: string, options?: grpc.RpcOptions);
getAccountTxs(
requestMessage: injective_explorer_rpc_pb.GetAccountTxsRequest,
metadata: grpc.Metadata,
callback: (error: ServiceError|null, responseMessage: injective_explorer_rpc_pb.GetAccountTxsResponse|null) => void
): UnaryResponse;
getAccountTxs(
requestMessage: injective_explorer_rpc_pb.GetAccountTxsRequest,
callback: (error: ServiceError|null, responseMessage: injective_explorer_rpc_pb.GetAccountTxsResponse|null) => void
): UnaryResponse;
getBlocks(
requestMessage: injective_explorer_rpc_pb.GetBlocksRequest,
metadata: grpc.Metadata,
callback: (error: ServiceError|null, responseMessage: injective_explorer_rpc_pb.GetBlocksResponse|null) => void
): UnaryResponse;
getBlocks(
requestMessage: injective_explorer_rpc_pb.GetBlocksRequest,
callback: (error: ServiceError|null, responseMessage: injective_explorer_rpc_pb.GetBlocksResponse|null) => void
): UnaryResponse;
getBlock(
requestMessage: injective_explorer_rpc_pb.GetBlockRequest,
metadata: grpc.Metadata,
callback: (error: ServiceError|null, responseMessage: injective_explorer_rpc_pb.GetBlockResponse|null) => void
): UnaryResponse;
getBlock(
requestMessage: injective_explorer_rpc_pb.GetBlockRequest,
callback: (error: ServiceError|null, responseMessage: injective_explorer_rpc_pb.GetBlockResponse|null) => void
): UnaryResponse;
getValidator(
requestMessage: injective_explorer_rpc_pb.GetValidatorRequest,
metadata: grpc.Metadata,
callback: (error: ServiceError|null, responseMessage: injective_explorer_rpc_pb.GetValidatorResponse|null) => void
): UnaryResponse;
getValidator(
requestMessage: injective_explorer_rpc_pb.GetValidatorRequest,
callback: (error: ServiceError|null, responseMessage: injective_explorer_rpc_pb.GetValidatorResponse|null) => void
): UnaryResponse;
getValidatorUptime(
requestMessage: injective_explorer_rpc_pb.GetValidatorUptimeRequest,
metadata: grpc.Metadata,
callback: (error: ServiceError|null, responseMessage: injective_explorer_rpc_pb.GetValidatorUptimeResponse|null) => void
): UnaryResponse;
getValidatorUptime(
requestMessage: injective_explorer_rpc_pb.GetValidatorUptimeRequest,
callback: (error: ServiceError|null, responseMessage: injective_explorer_rpc_pb.GetValidatorUptimeResponse|null) => void
): UnaryResponse;
getTxs(
requestMessage: injective_explorer_rpc_pb.GetTxsRequest,
metadata: grpc.Metadata,
callback: (error: ServiceError|null, responseMessage: injective_explorer_rpc_pb.GetTxsResponse|null) => void
): UnaryResponse;
getTxs(
requestMessage: injective_explorer_rpc_pb.GetTxsRequest,
callback: (error: ServiceError|null, responseMessage: injective_explorer_rpc_pb.GetTxsResponse|null) => void
): UnaryResponse;
getTxByTxHash(
requestMessage: injective_explorer_rpc_pb.GetTxByTxHashRequest,
metadata: grpc.Metadata,
callback: (error: ServiceError|null, responseMessage: injective_explorer_rpc_pb.GetTxByTxHashResponse|null) => void
): UnaryResponse;
getTxByTxHash(
requestMessage: injective_explorer_rpc_pb.GetTxByTxHashRequest,
callback: (error: ServiceError|null, responseMessage: injective_explorer_rpc_pb.GetTxByTxHashResponse|null) => void
): UnaryResponse;
streamTxs(requestMessage: injective_explorer_rpc_pb.StreamTxsRequest, metadata?: grpc.Metadata): ResponseStream<injective_explorer_rpc_pb.StreamTxsResponse>;
streamBlocks(requestMessage: injective_explorer_rpc_pb.StreamBlocksRequest, metadata?: grpc.Metadata): ResponseStream<injective_explorer_rpc_pb.StreamBlocksResponse>;
getPeggyDepositTxs(
requestMessage: injective_explorer_rpc_pb.GetPeggyDepositTxsRequest,
metadata: grpc.Metadata,
callback: (error: ServiceError|null, responseMessage: injective_explorer_rpc_pb.GetPeggyDepositTxsResponse|null) => void
): UnaryResponse;
getPeggyDepositTxs(
requestMessage: injective_explorer_rpc_pb.GetPeggyDepositTxsRequest,
callback: (error: ServiceError|null, responseMessage: injective_explorer_rpc_pb.GetPeggyDepositTxsResponse|null) => void
): UnaryResponse;
getPeggyWithdrawalTxs(
requestMessage: injective_explorer_rpc_pb.GetPeggyWithdrawalTxsRequest,
metadata: grpc.Metadata,
callback: (error: ServiceError|null, responseMessage: injective_explorer_rpc_pb.GetPeggyWithdrawalTxsResponse|null) => void
): UnaryResponse;
getPeggyWithdrawalTxs(
requestMessage: injective_explorer_rpc_pb.GetPeggyWithdrawalTxsRequest,
callback: (error: ServiceError|null, responseMessage: injective_explorer_rpc_pb.GetPeggyWithdrawalTxsResponse|null) => void
): UnaryResponse;
getIBCTransferTxs(
requestMessage: injective_explorer_rpc_pb.GetIBCTransferTxsRequest,
metadata: grpc.Metadata,
callback: (error: ServiceError|null, responseMessage: injective_explorer_rpc_pb.GetIBCTransferTxsResponse|null) => void
): UnaryResponse;
getIBCTransferTxs(
requestMessage: injective_explorer_rpc_pb.GetIBCTransferTxsRequest,
callback: (error: ServiceError|null, responseMessage: injective_explorer_rpc_pb.GetIBCTransferTxsResponse|null) => void
): UnaryResponse;
}