UNPKG

opnet

Version:

The perfect library for building Bitcoin-based applications.

19 lines (18 loc) 568 B
import { stringToBuffer } from '../utils/StringToBuffer.js'; export class SubmittedEpoch { epochNumber; submissionHash; difficulty; timestamp; status; message; constructor(data) { this.epochNumber = BigInt(data.epochNumber); this.submissionHash = stringToBuffer(data.submissionHash); this.difficulty = data.difficulty; this.timestamp = typeof data.timestamp === 'number' ? new Date(data.timestamp) : data.timestamp; this.status = data.status; this.message = data.message; } }