Move Decoder, Encoder out of adaptor
This commit is contained in:
parent
99217b1437
commit
efdf1983e6
@ -1,3 +1,2 @@
|
||||
export { Params } from "./requests";
|
||||
export { Responses } from "./responses";
|
||||
export { Decoder, Encoder } from "./types";
|
||||
|
||||
@ -1,10 +0,0 @@
|
||||
import { JsonRpcRequest, JsonRpcSuccessResponse } from "@cosmjs/json-rpc";
|
||||
|
||||
import * as requests from "../requests";
|
||||
import * as responses from "../responses";
|
||||
|
||||
// Encoder is a generic that matches all methods of Params
|
||||
export type Encoder<T extends requests.Request> = (req: T) => JsonRpcRequest;
|
||||
|
||||
// Decoder is a generic that matches all methods of Responses
|
||||
export type Decoder<T extends responses.Response> = (res: JsonRpcSuccessResponse) => T;
|
||||
@ -1,3 +1,4 @@
|
||||
import { JsonRpcRequest, JsonRpcSuccessResponse } from "@cosmjs/json-rpc";
|
||||
import { Stream } from "xstream";
|
||||
|
||||
import { createJsonRpcRequest } from "../jsonrpc";
|
||||
@ -9,10 +10,16 @@ import {
|
||||
SubscriptionEvent,
|
||||
WebsocketClient,
|
||||
} from "../rpcclients";
|
||||
import { Decoder, Encoder, Params, Responses } from "./adaptor";
|
||||
import { Params, Responses } from "./adaptor";
|
||||
import * as requests from "./requests";
|
||||
import * as responses from "./responses";
|
||||
|
||||
// Encoder is a generic that matches all methods of Params
|
||||
type Encoder<T extends requests.Request> = (req: T) => JsonRpcRequest;
|
||||
|
||||
// Decoder is a generic that matches all methods of Responses
|
||||
type Decoder<T extends responses.Response> = (res: JsonRpcSuccessResponse) => T;
|
||||
|
||||
export class Comet38Client {
|
||||
/**
|
||||
* Creates a new Tendermint client for the given endpoint.
|
||||
|
||||
@ -1,3 +1,2 @@
|
||||
export { Params } from "./requests";
|
||||
export { Responses } from "./responses";
|
||||
export { Decoder, Encoder } from "./types";
|
||||
|
||||
@ -1,10 +0,0 @@
|
||||
import { JsonRpcRequest, JsonRpcSuccessResponse } from "@cosmjs/json-rpc";
|
||||
|
||||
import * as requests from "../requests";
|
||||
import * as responses from "../responses";
|
||||
|
||||
// Encoder is a generic that matches all methods of Params
|
||||
export type Encoder<T extends requests.Request> = (req: T) => JsonRpcRequest;
|
||||
|
||||
// Decoder is a generic that matches all methods of Responses
|
||||
export type Decoder<T extends responses.Response> = (res: JsonRpcSuccessResponse) => T;
|
||||
@ -1,3 +1,4 @@
|
||||
import { JsonRpcRequest, JsonRpcSuccessResponse } from "@cosmjs/json-rpc";
|
||||
import { Stream } from "xstream";
|
||||
|
||||
import { createJsonRpcRequest } from "../jsonrpc";
|
||||
@ -9,10 +10,16 @@ import {
|
||||
SubscriptionEvent,
|
||||
WebsocketClient,
|
||||
} from "../rpcclients";
|
||||
import { Decoder, Encoder, Params, Responses } from "./adaptor";
|
||||
import { Params, Responses } from "./adaptor";
|
||||
import * as requests from "./requests";
|
||||
import * as responses from "./responses";
|
||||
|
||||
// Encoder is a generic that matches all methods of Params
|
||||
type Encoder<T extends requests.Request> = (req: T) => JsonRpcRequest;
|
||||
|
||||
// Decoder is a generic that matches all methods of Responses
|
||||
type Decoder<T extends responses.Response> = (res: JsonRpcSuccessResponse) => T;
|
||||
|
||||
export class Tendermint34Client {
|
||||
/**
|
||||
* Creates a new Tendermint client for the given endpoint.
|
||||
|
||||
@ -1,3 +1,2 @@
|
||||
export { Params } from "./requests";
|
||||
export { Responses } from "./responses";
|
||||
export { Decoder, Encoder } from "./types";
|
||||
|
||||
@ -1,10 +0,0 @@
|
||||
import { JsonRpcRequest, JsonRpcSuccessResponse } from "@cosmjs/json-rpc";
|
||||
|
||||
import * as requests from "../requests";
|
||||
import * as responses from "../responses";
|
||||
|
||||
// Encoder is a generic that matches all methods of Params
|
||||
export type Encoder<T extends requests.Request> = (req: T) => JsonRpcRequest;
|
||||
|
||||
// Decoder is a generic that matches all methods of Responses
|
||||
export type Decoder<T extends responses.Response> = (res: JsonRpcSuccessResponse) => T;
|
||||
@ -1,3 +1,4 @@
|
||||
import { JsonRpcRequest, JsonRpcSuccessResponse } from "@cosmjs/json-rpc";
|
||||
import { Stream } from "xstream";
|
||||
|
||||
import { createJsonRpcRequest } from "../jsonrpc";
|
||||
@ -9,10 +10,16 @@ import {
|
||||
SubscriptionEvent,
|
||||
WebsocketClient,
|
||||
} from "../rpcclients";
|
||||
import { Decoder, Encoder, Params, Responses } from "./adaptor";
|
||||
import { Params, Responses } from "./adaptor";
|
||||
import * as requests from "./requests";
|
||||
import * as responses from "./responses";
|
||||
|
||||
// Encoder is a generic that matches all methods of Params
|
||||
type Encoder<T extends requests.Request> = (req: T) => JsonRpcRequest;
|
||||
|
||||
// Decoder is a generic that matches all methods of Responses
|
||||
type Decoder<T extends responses.Response> = (res: JsonRpcSuccessResponse) => T;
|
||||
|
||||
export class Tendermint37Client {
|
||||
/**
|
||||
* Creates a new Tendermint client for the given endpoint.
|
||||
|
||||
Loading…
Reference in New Issue
Block a user