import * as BigNumber from 'bignumber.js' ; import { PaymentChannel } from '../PaymentChannel' ; import ChannelId from '../ChannelId' ; export default interface IChannelsDatabase { save ( paymentChannel ) : Promise < void > ; saveOrUpdate ( paymentChannel ) : Promise < void > ; deposit ( channelId , value ) : Promise < void > ; firstById ( channelId ) : Promise < PaymentChannel | null > ; spend ( channelId , spent ) : Promise < void > ; all ( ) : Promise < Array < PaymentChannel > > ; allOpen ( ) : Promise < PaymentChannel [ ] > ; allSettling ( ) : Promise < PaymentChannel [ ] > ; findUsable ( sender , receiver , amount ) : Promise < PaymentChannel | null > ; findBySenderReceiver ( sender , receiver ) : Promise < Array < PaymentChannel > > ; findBySenderReceiverChannelId ( sender , receiver , channelId ) : Promise < PaymentChannel | null > ; updateState ( channelId , state ) : Promise < void > ; updateSettlingUntil ( channelId , settlingUntil ) : Promise < void > ; }