File tree Expand file tree Collapse file tree 1 file changed +35
-1
lines changed Expand file tree Collapse file tree 1 file changed +35
-1
lines changed Original file line number Diff line number Diff line change @@ -113,10 +113,44 @@ const subscribeForMinedCancelEvents = () => {
113113}
114114
115115
116+ const subscribeForMinedWithdrawEvents = ( ) => {
117+ log . debug ( "Subscribing for mined cancel events." ) ;
118+
119+ const withdrawEvent = escrowContract . LogWithdraw ( ) ;
120+
121+ withdrawEvent . watch ( async ( error , result ) => {
122+ try {
123+ log . debug ( "Got mined withdraw event" ) ;
124+ console . log ( result ) ;
125+
126+ const event = {
127+ txStatus : 'success' ,
128+ txHash : result . transactionHash ,
129+ eventName : 'withdraw' ,
130+ } ;
131+ const transferFilterParams = {
132+ senderAddress : result . args . sender ,
133+ transitAddress : result . args . transitAddress
134+ } ;
135+
136+ await TransferService . addEvent ( {
137+ transferStatus : 'completed' ,
138+ event,
139+ transferFilterParams
140+ } ) ;
141+
142+ } catch ( err ) {
143+ log . debug ( err ) ;
144+ }
145+ } ) ;
146+ }
147+
148+
116149const start = ( ) => {
117150 subscribeForPendingEvents ( ) ;
118151 subscribeForMinedDepositEvents ( ) ;
119- subscribeForMinedCancelEvents ( ) ;
152+ subscribeForMinedCancelEvents ( ) ;
153+ subscribeForMinedWithdrawEvents ( ) ;
120154}
121155
122156
You can’t perform that action at this time.
0 commit comments