Add zeroEx.getLogsAsync

This commit is contained in:
Leonid Logvinov
2017-10-03 11:39:34 +03:00
parent 7b545aa0e0
commit 835c17c961

View File

@@ -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<RawLog[]> {
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.