aboutsummaryrefslogtreecommitdiffstats
path: root/src/types.ts
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-10-26 17:50:02 +0800
committerFabio Berger <me@fabioberger.com>2017-10-31 00:49:16 +0800
commitf53472e7170798f56ea4837c310cfd4188326af8 (patch)
tree64f4151571e0fc91df67ee07e2ce286a298e0aba /src/types.ts
parent7fa5d34c45f58ebdf729e9f7a500627ab72fb5c8 (diff)
downloaddexon-sol-tools-f53472e7170798f56ea4837c310cfd4188326af8.tar
dexon-sol-tools-f53472e7170798f56ea4837c310cfd4188326af8.tar.gz
dexon-sol-tools-f53472e7170798f56ea4837c310cfd4188326af8.tar.bz2
dexon-sol-tools-f53472e7170798f56ea4837c310cfd4188326af8.tar.lz
dexon-sol-tools-f53472e7170798f56ea4837c310cfd4188326af8.tar.xz
dexon-sol-tools-f53472e7170798f56ea4837c310cfd4188326af8.tar.zst
dexon-sol-tools-f53472e7170798f56ea4837c310cfd4188326af8.zip
Add initial mempool watching implememtation
Diffstat (limited to 'src/types.ts')
-rw-r--r--src/types.ts24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/types.ts b/src/types.ts
index 9ac726ef8..1b32ccdf9 100644
--- a/src/types.ts
+++ b/src/types.ts
@@ -37,12 +37,17 @@ export type OrderAddresses = [string, string, string, string, string];
export type OrderValues = [BigNumber, BigNumber, BigNumber,
BigNumber, BigNumber, BigNumber];
-export interface LogEvent<ArgsType> extends LogWithDecodedArgs<ArgsType> {
- removed: boolean;
-}
-export type EventCallbackAsync<ArgsType> = (log: LogEvent<ArgsType>) => Promise<void>;
-export type EventCallbackSync<ArgsType> = (log: LogEvent<ArgsType>) => void;
+export type LogEvent = Web3.LogEntryEvent;
+export type DecodedLogEvent<ArgsType> = Web3.DecodedLogEntryEvent<ArgsType>;
+
+export type EventCallbackAsync<ArgsType> = (log: DecodedLogEvent<ArgsType>) => Promise<void>;
+export type EventCallbackSync<ArgsType> = (log: DecodedLogEvent<ArgsType>) => void;
export type EventCallback<ArgsType> = EventCallbackSync<ArgsType>|EventCallbackAsync<ArgsType>;
+
+export type MempoolEventCallbackSync = (log: LogEvent) => void;
+export type MempoolEventCallbackAsync = (log: LogEvent) => Promise<void>;
+export type MempoolEventCallback = MempoolEventCallbackSync|MempoolEventCallbackAsync;
+
export interface ExchangeContract extends Web3.ContractInstance {
isValidSignature: {
callAsync: (signerAddressHex: string, dataHex: string, v: number, r: string, s: string,
@@ -394,12 +399,14 @@ export interface JSONRPCPayload {
* exchangeContractAddress: The address of an exchange contract to use
* tokenRegistryContractAddress: The address of a token registry contract to use
* etherTokenContractAddress: The address of an ether token contract to use
+ * mempoolPollingIntervalMs: How often to check for new mempool events
*/
export interface ZeroExConfig {
gasPrice?: BigNumber; // Gas price to use with every transaction
exchangeContractAddress?: string;
tokenRegistryContractAddress?: string;
etherTokenContractAddress?: string;
+ mempoolPollingIntervalMs?: number;
}
export type TransactionReceipt = Web3.TransactionReceipt;
@@ -415,12 +422,7 @@ export interface DecodedLogArgs {
[argName: string]: ContractEventArg;
}
-export interface DecodedArgs<ArgsType> {
- args: ArgsType;
- event: string;
-}
-
-export interface LogWithDecodedArgs<ArgsType> extends Web3.LogEntry, DecodedArgs<ArgsType> {}
+export interface LogWithDecodedArgs<ArgsType> extends Web3.DecodedLogEntry<ArgsType> {}
export interface TransactionReceiptWithDecodedLogs extends Web3.TransactionReceipt {
logs: Array<LogWithDecodedArgs<DecodedLogArgs>|Web3.LogEntry>;