Fix encodeTx implementation, Connection.identifier now works

This commit is contained in:
Ethan Frey 2020-02-03 21:31:46 +01:00
parent 449a83120a
commit 0031d6860d
2 changed files with 3 additions and 2 deletions

View File

@ -140,7 +140,8 @@ export class RestClient {
}
// encodeTx returns the amino-encoding of the transaction
public async encodeTx(tx: StdTx): Promise<Uint8Array> {
public async encodeTx(stdTx: StdTx): Promise<Uint8Array> {
const tx = {"type": "cosmos-sdk/StdTx", "value": stdTx};
const responseData = await this.post("/txs/encode", tx);
if (!(responseData as any).tx) {
throw new Error("Unexpected response data format");

View File

@ -71,7 +71,7 @@ export declare class RestClient {
nodeInfo(): Promise<NodeInfoResponse>;
blocksLatest(): Promise<BlocksResponse>;
blocks(height: number): Promise<BlocksResponse>;
encodeTx(tx: StdTx): Promise<Uint8Array>;
encodeTx(stdTx: StdTx): Promise<Uint8Array>;
authAccounts(address: string, height?: string): Promise<AuthAccountsResponse>;
txs(query: string): Promise<SearchTxsResponse>;
txsById(id: string): Promise<TxsResponse>;