Fix encodeTx implementation, Connection.identifier now works
This commit is contained in:
parent
449a83120a
commit
0031d6860d
@ -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");
|
||||
|
||||
2
packages/sdk/types/restclient.d.ts
vendored
2
packages/sdk/types/restclient.d.ts
vendored
@ -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>;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user