@@ -3,9 +3,9 @@ import assert from 'assert';
33import http from 'http' ;
44import { combineLatest , defer , from , fromEvent , interval , Observable , of , Subscription , throwError , timer } from 'rxjs' ;
55import { catchError , distinctUntilChanged , filter , mergeMap , mergeMapTo , pluck , take , timeout } from 'rxjs/operators' ;
6+ import { BalanceAlertEvent } from '../alerts/types' ;
67import { SwapClientType , SwapRole , SwapState } from '../constants/enums' ;
78import { CurrencyInstance } from '../db/types' ;
8- import { Alert } from '../alerts/types' ;
99import Logger from '../Logger' ;
1010import swapErrors from '../swaps/errors' ;
1111import SwapClient , {
@@ -51,15 +51,15 @@ interface ConnextClient {
5151 on ( event : 'htlcAccepted' , listener : ( rHash : string , amount : number , currency : string ) => void ) : this;
5252 on ( event : 'connectionVerified' , listener : ( swapClientInfo : SwapClientInfo ) => void ) : this;
5353 on ( event : 'depositConfirmed' , listener : ( hash : string ) => void ) : this;
54- on ( event : 'lowTradingBalance' , listener : ( alert : Alert ) => void ) : this;
54+ on ( event : 'lowTradingBalance' , listener : ( alert : BalanceAlertEvent ) => void ) : this;
5555 once ( event : 'initialized' , listener : ( ) => void ) : this;
5656 emit ( event : 'htlcAccepted' , rHash : string , amount : number , currency : string ) : boolean ;
5757 emit ( event : 'connectionVerified' , swapClientInfo : SwapClientInfo ) : boolean ;
5858 emit ( event : 'initialized' ) : boolean ;
5959 emit ( event : 'preimage' , preimageRequest : ProvidePreimageEvent ) : void ;
6060 emit ( event : 'transferReceived' , transferReceivedRequest : TransferReceivedEvent ) : void ;
6161 emit ( event : 'depositConfirmed' , hash : string ) : void ;
62- emit ( event : 'lowTradingBalance' , alert : Alert ) : boolean ;
62+ emit ( event : 'lowTradingBalance' , alert : BalanceAlertEvent ) : boolean ;
6363}
6464
6565const getRouterNodeIdentifier = ( network : string ) : string => {
@@ -343,7 +343,7 @@ class ConnextClient extends SwapClient {
343343 const totalBalance = remoteBalance + localBalance ;
344344 const alertThreshold = totalBalance * 0.1 ;
345345
346- this . checkLowBalance ( remoteBalance , localBalance , totalBalance , alertThreshold , currency , this . emit . bind ( this ) ) ;
346+ this . checkLowBalance ( remoteBalance , localBalance , totalBalance , alertThreshold , currency ) ;
347347 }
348348 } catch ( e ) {
349349 this . logger . error ( 'failed to update total outbound capacity' , e ) ;
0 commit comments