diff --git a/packages/sdk/src/restclient.ts b/packages/sdk/src/restclient.ts index e3794ee1..b89e7fcb 100644 --- a/packages/sdk/src/restclient.ts +++ b/packages/sdk/src/restclient.ts @@ -140,7 +140,8 @@ export class RestClient { } // encodeTx returns the amino-encoding of the transaction - public async encodeTx(tx: StdTx): Promise { + public async encodeTx(stdTx: StdTx): Promise { + 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"); diff --git a/packages/sdk/types/restclient.d.ts b/packages/sdk/types/restclient.d.ts index 02c0fa53..b818be1e 100644 --- a/packages/sdk/types/restclient.d.ts +++ b/packages/sdk/types/restclient.d.ts @@ -71,7 +71,7 @@ export declare class RestClient { nodeInfo(): Promise; blocksLatest(): Promise; blocks(height: number): Promise; - encodeTx(tx: StdTx): Promise; + encodeTx(stdTx: StdTx): Promise; authAccounts(address: string, height?: string): Promise; txs(query: string): Promise; txsById(id: string): Promise;