aboutsummaryrefslogtreecommitdiffstats
path: root/src/web3_wrapper.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/web3_wrapper.ts')
-rw-r--r--src/web3_wrapper.ts15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/web3_wrapper.ts b/src/web3_wrapper.ts
index 9de75c809..ff5d25d9c 100644
--- a/src/web3_wrapper.ts
+++ b/src/web3_wrapper.ts
@@ -107,11 +107,24 @@ export class Web3Wrapper {
return addresses;
}
public async getLogsAsync(filter: Web3.FilterObject): Promise<Web3.LogEntry[]> {
+ let fromBlock = filter.fromBlock;
+ if (_.isNumber(fromBlock)) {
+ fromBlock = this.web3.toHex(fromBlock);
+ }
+ let toBlock = filter.toBlock;
+ if (_.isNumber(toBlock)) {
+ toBlock = this.web3.toHex(toBlock);
+ }
+ const serializedFilter = {
+ ...filter,
+ fromBlock,
+ toBlock,
+ };
const payload = {
jsonrpc: '2.0',
id: this.jsonRpcRequestId++,
method: 'eth_getLogs',
- params: [filter],
+ params: [serializedFilter],
};
const logs = await this.sendRawPayloadAsync(payload);
return logs;