From 835c17c9612b184208c72c15a3ca0c815057ccf3 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 3 Oct 2017 11:39:34 +0300 Subject: Add zeroEx.getLogsAsync --- src/0x.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/0x.ts b/src/0x.ts index e6fdf68e1..ae29b8d70 100644 --- a/src/0x.ts +++ b/src/0x.ts @@ -31,6 +31,8 @@ import { DecodedLogArgs, TransactionReceiptWithDecodedLogs, LogWithDecodedArgs, + FilterObject, + RawLog, } from './types'; import {zeroExConfigSchema} from './schemas/zero_ex_config_schema'; @@ -321,6 +323,15 @@ export class ZeroEx { }); return txReceiptPromise; } + /** + * Gets historical logs without creating a subscription + * @param filter Filter object + * @return Array of logs that match the filter + */ + public async getLogsAsync(filter: FilterObject): Promise { + const logs = await this._web3Wrapper.getLogsAsync(filter); + return logs; + } /* * HACK: `TokenWrapper` needs a token transfer proxy address. `TokenTransferProxy` address is fetched from * an `ExchangeWrapper`. `ExchangeWrapper` needs `TokenWrapper` to validate orders, creating a dependency cycle. -- cgit