UNPKG

@rsksmart/rif-storage-pinning

Version:

Application for providing your storage space to other to use in exchange of RIF Tokens

36 lines (35 loc) 1.11 kB
import { Model } from 'sequelize-typescript'; import BigNumber from 'bignumber.js'; import JobModel from './job.model'; export default class Agreement extends Model { agreementReference: string; dataReference: string; consumer: string; size: BigNumber; isActive: boolean; /** * Billing period IN SECONDS */ billingPeriod: BigNumber; billingPrice: BigNumber; tokenAddress: string; availableFunds: BigNumber; lastPayout: Date; expiredAtBlockNumber: number | null; jobs: JobModel[]; periodPrice(): BigNumber; getPeriodsSinceLastPayout(floor?: boolean): BigNumber; getToBePayedOut(floor?: boolean): BigNumber; get numberOfPrepaidPeriods(): BigNumber; get periodsSinceLastPayout(): BigNumber; get toBePayedOut(): BigNumber; /** * Helper which specifies if the Agreement has at the moment of the call * sufficient funds for at least one more period. */ get hasSufficientFunds(): boolean; /** * Field represents the time (in seconds) until the agreement expires */ get expiresIn(): BigNumber; }