Remove misleading PostTxsParams
which is not for postTx()
This commit is contained in:
parent
728a29a072
commit
72e7638c19
@ -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");
|
||||
|
||||
3
packages/sdk/types/restclient.d.ts
vendored
3
packages/sdk/types/restclient.d.ts
vendored
@ -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>;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user