diff --git a/packages/tendermint-rpc/src/rpcclients/http.ts b/packages/tendermint-rpc/src/rpcclients/http.ts index 1d389504bd..0bc9849afe 100644 --- a/packages/tendermint-rpc/src/rpcclients/http.ts +++ b/packages/tendermint-rpc/src/rpcclients/http.ts @@ -40,9 +40,14 @@ export async function http( headers: Record | undefined, request?: any, ): Promise { + const timeout = Number( + //@ts-ignore + 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 +60,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 bc8d2051b3..2bbd3d1d0a 100644 --- a/packages/tendermint-rpc/src/tendermint34/adaptor/responses.ts +++ b/packages/tendermint-rpc/src/tendermint34/adaptor/responses.ts @@ -723,6 +723,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 8db6e3cb38..c694550259 100644 --- a/packages/tendermint-rpc/src/tendermint37/adaptor/responses.ts +++ b/packages/tendermint-rpc/src/tendermint37/adaptor/responses.ts @@ -724,6 +724,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)),