@clonegod/ttd-base-common 1.0.12 → 1.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -68,7 +68,7 @@ class UniswapV2AmmPoolEventsSubscriber {
|
|
|
68
68
|
this.eventCallbacks[eventType.toLowerCase()] = callback;
|
|
69
69
|
if (eventType.toLowerCase() === 'sync') {
|
|
70
70
|
this.poolContract.on('Sync', (reserve0, reserve1, event) => {
|
|
71
|
-
const
|
|
71
|
+
const event_data = {
|
|
72
72
|
pool_address: this.poolAddress,
|
|
73
73
|
type: 'sync',
|
|
74
74
|
event_time: Date.now(),
|
|
@@ -85,12 +85,12 @@ class UniswapV2AmmPoolEventsSubscriber {
|
|
|
85
85
|
liquidity: BigInt(0),
|
|
86
86
|
}
|
|
87
87
|
};
|
|
88
|
-
callback(
|
|
88
|
+
callback(event_data);
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
91
|
else if (eventType.toLowerCase() === 'mint') {
|
|
92
92
|
this.poolContract.on('Mint', (sender, amount0, amount1, event) => {
|
|
93
|
-
const
|
|
93
|
+
const event_data = {
|
|
94
94
|
pool_address: this.poolAddress,
|
|
95
95
|
type: 'mint',
|
|
96
96
|
event_time: Date.now(),
|
|
@@ -107,12 +107,12 @@ class UniswapV2AmmPoolEventsSubscriber {
|
|
|
107
107
|
liquidity: BigInt(0),
|
|
108
108
|
}
|
|
109
109
|
};
|
|
110
|
-
event_filter_1.EventFilter.filterEvent(this.poolAddress, event.blockNumber, 'mint', callback,
|
|
110
|
+
event_filter_1.EventFilter.filterEvent(this.poolAddress, event.blockNumber, 'mint', callback, event_data);
|
|
111
111
|
});
|
|
112
112
|
}
|
|
113
113
|
else if (eventType.toLowerCase() === 'burn') {
|
|
114
114
|
this.poolContract.on('Burn', (sender, amount0, amount1, to, event) => {
|
|
115
|
-
const
|
|
115
|
+
const event_data = {
|
|
116
116
|
pool_address: this.poolAddress,
|
|
117
117
|
type: 'burn',
|
|
118
118
|
event_time: Date.now(),
|
|
@@ -129,7 +129,7 @@ class UniswapV2AmmPoolEventsSubscriber {
|
|
|
129
129
|
liquidity: BigInt(0),
|
|
130
130
|
}
|
|
131
131
|
};
|
|
132
|
-
event_filter_1.EventFilter.filterEvent(this.poolAddress, event.blockNumber, 'burn', callback,
|
|
132
|
+
event_filter_1.EventFilter.filterEvent(this.poolAddress, event.blockNumber, 'burn', callback, event_data);
|
|
133
133
|
});
|
|
134
134
|
}
|
|
135
135
|
}
|
|
@@ -68,7 +68,7 @@ class UniswapV3PoolEventsSubscriber {
|
|
|
68
68
|
this.eventCallbacks[eventType.toLowerCase()] = callback;
|
|
69
69
|
if (eventType.toLowerCase() === 'swap') {
|
|
70
70
|
this.poolContract.on('Swap', (sender, recipient, amount0, amount1, sqrtPriceX96, liquidity, tick, event) => {
|
|
71
|
-
const
|
|
71
|
+
const event_data = {
|
|
72
72
|
pool_address: this.poolAddress,
|
|
73
73
|
type: 'swap',
|
|
74
74
|
event_time: Date.now(),
|
|
@@ -85,12 +85,12 @@ class UniswapV3PoolEventsSubscriber {
|
|
|
85
85
|
liquidity: liquidity.toString(),
|
|
86
86
|
}
|
|
87
87
|
};
|
|
88
|
-
callback(
|
|
88
|
+
callback(event_data);
|
|
89
89
|
});
|
|
90
90
|
}
|
|
91
91
|
else if (eventType.toLowerCase() === 'mint') {
|
|
92
92
|
this.poolContract.on('Mint', (sender, owner, tickLower, tickUpper, amount, amount0, amount1, event) => {
|
|
93
|
-
const
|
|
93
|
+
const event_data = {
|
|
94
94
|
pool_address: this.poolAddress,
|
|
95
95
|
type: 'mint',
|
|
96
96
|
event_time: Date.now(),
|
|
@@ -107,12 +107,12 @@ class UniswapV3PoolEventsSubscriber {
|
|
|
107
107
|
liquidity: BigInt(0),
|
|
108
108
|
}
|
|
109
109
|
};
|
|
110
|
-
event_filter_1.EventFilter.filterEvent(this.poolAddress, event.blockNumber, 'mint', callback,
|
|
110
|
+
event_filter_1.EventFilter.filterEvent(this.poolAddress, event.blockNumber, 'mint', callback, event_data);
|
|
111
111
|
});
|
|
112
112
|
}
|
|
113
113
|
else if (eventType.toLowerCase() === 'burn') {
|
|
114
114
|
this.poolContract.on('Burn', (owner, tickLower, tickUpper, amount, amount0, amount1, event) => {
|
|
115
|
-
const
|
|
115
|
+
const event_data = {
|
|
116
116
|
pool_address: this.poolAddress,
|
|
117
117
|
type: 'burn',
|
|
118
118
|
event_time: Date.now(),
|
|
@@ -129,7 +129,7 @@ class UniswapV3PoolEventsSubscriber {
|
|
|
129
129
|
liquidity: BigInt(0),
|
|
130
130
|
}
|
|
131
131
|
};
|
|
132
|
-
event_filter_1.EventFilter.filterEvent(this.poolAddress, event.blockNumber, 'burn', callback,
|
|
132
|
+
event_filter_1.EventFilter.filterEvent(this.poolAddress, event.blockNumber, 'burn', callback, event_data);
|
|
133
133
|
});
|
|
134
134
|
}
|
|
135
135
|
}
|