import Payment , { PaymentJSON , PaymentSerde } from '../payment' ; import { namespaced } from '../util/namespaced' ; import IEngine from './IEngine' ; import IPaymentsDatabase from './IPaymentsDatabase' ; import ChannelId from '../ChannelId' ; export default abstract class AbstractPaymentsDatabase < T extends IEngine > implements IPaymentsDatabase { kind : string ; engine : T ; constructor ( engine , namespace ) { this . kind = namespaced ( namespace , 'payment' ) ; this . engine = engine ; } inflatePayment ( json ) { if ( ! json ) { return null ; } return PaymentSerde . instance . deserialize ( json ) ; } abstract save ( token , payment ) ; abstract firstMaximum ( channelId ) ; abstract findByToken ( token ) ; }