Remove misleading PostTxsParams

which is not for postTx()
This commit is contained in:
Simon Warta 2020-03-11 12:39:29 +01:00
parent 728a29a072
commit 72e7638c19
2 changed files with 4 additions and 6 deletions

View File

@ -1,4 +1,4 @@
import { Encoding } from "@iov/encoding";
import { Encoding, isNonNullObject } from "@iov/encoding";
import axios, { AxiosError, AxiosInstance } from "axios";
import { Coin, CosmosSdkTx, Model, parseWasmData, StdTx, WasmData } from "./types";
@ -138,8 +138,6 @@ interface SearchTxsResponse {
readonly txs: readonly TxsResponse[];
}
interface PostTxsParams {}
export interface PostTxsResponse {
readonly height: string;
readonly txhash: string;
@ -295,7 +293,8 @@ export class RestClient {
return data;
}
public async post(path: string, params: PostTxsParams): Promise<RestClientResponse> {
public async post(path: string, params: any): Promise<RestClientResponse> {
if (!isNonNullObject(params)) throw new Error("Got unexpected type of params. Expected object.");
const { data } = await this.client.post(path, params).catch(parseAxiosError);
if (data === null) {
throw new Error("Received null response from server");

View File

@ -110,7 +110,6 @@ interface SearchTxsResponse {
readonly limit: string;
readonly txs: readonly TxsResponse[];
}
interface PostTxsParams {}
export interface PostTxsResponse {
readonly height: string;
readonly txhash: string;
@ -192,7 +191,7 @@ export declare class RestClient {
*/
constructor(apiUrl: string, broadcastMode?: BroadcastMode);
get(path: string): Promise<RestClientResponse>;
post(path: string, params: PostTxsParams): Promise<RestClientResponse>;
post(path: string, params: any): Promise<RestClientResponse>;
authAccounts(address: string): Promise<AuthAccountsResponse>;
blocksLatest(): Promise<BlockResponse>;
blocks(height: number): Promise<BlockResponse>;