diff --git a/packages/stargate/src/stargateclient.ts b/packages/stargate/src/stargateclient.ts index d5d6c6b334..12c6a6dd53 100644 --- a/packages/stargate/src/stargateclient.ts +++ b/packages/stargate/src/stargateclient.ts @@ -503,6 +503,7 @@ export class StargateClient { return results.txs.map((tx): IndexedTx => { const txMsgData = TxMsgData.decode(tx.result.data ?? new Uint8Array()); return { + ...tx, height: tx.height, txIndex: tx.index, hash: toHex(tx.hash).toUpperCase(), diff --git a/packages/tendermint-rpc/src/rpcclients/http.ts b/packages/tendermint-rpc/src/rpcclients/http.ts index 1d389504bd..48576b2182 100644 --- a/packages/tendermint-rpc/src/rpcclients/http.ts +++ b/packages/tendermint-rpc/src/rpcclients/http.ts @@ -40,9 +40,13 @@ export async function http( headers: Record | undefined, request?: any, ): Promise { + const timeout = Number( + process.env.HTTP_TIMEOUT || 30000, + ); if (typeof fetch === "function" && !isExperimental(fetch)) { const settings = { method: method, + signal: timeout, body: request ? JSON.stringify(request) : undefined, headers: { // eslint-disable-next-line @typescript-eslint/naming-convention @@ -55,7 +59,7 @@ export async function http( .then((res: any) => res.json()); } else { return axios - .request({ url: url, method: method, data: request, headers: headers }) + .request({ url: url, method: method, data: request, headers: headers, timeout }) .then((res) => res.data); } } diff --git a/packages/tendermint-rpc/src/tendermint34/adaptor/responses.ts b/packages/tendermint-rpc/src/tendermint34/adaptor/responses.ts index 48acab2aab..0614917a26 100644 --- a/packages/tendermint-rpc/src/tendermint34/adaptor/responses.ts +++ b/packages/tendermint-rpc/src/tendermint34/adaptor/responses.ts @@ -712,6 +712,7 @@ interface RpcTxResponse { function decodeTxResponse(data: RpcTxResponse): responses.TxResponse { return { + ...data, tx: fromBase64(assertNotEmpty(data.tx)), result: decodeTxData(assertObject(data.tx_result)), height: apiToSmallInt(assertNotEmpty(data.height)), diff --git a/packages/tendermint-rpc/src/tendermint37/adaptor/responses.ts b/packages/tendermint-rpc/src/tendermint37/adaptor/responses.ts index 3b1f10e3a4..12013615df 100644 --- a/packages/tendermint-rpc/src/tendermint37/adaptor/responses.ts +++ b/packages/tendermint-rpc/src/tendermint37/adaptor/responses.ts @@ -713,6 +713,7 @@ interface RpcTxResponse { function decodeTxResponse(data: RpcTxResponse): responses.TxResponse { return { + ...data, tx: fromBase64(assertNotEmpty(data.tx)), result: decodeTxData(assertObject(data.tx_result)), height: apiToSmallInt(assertNotEmpty(data.height)),