UNPKG

opnet

Version:

The perfect library for building Bitcoin-based applications.

13 lines (10 loc) 439 B
import { stringToBuffer } from '../utils/StringToBuffer.js'; import { IEpochTemplate, RawEpochTemplate } from './interfaces/IEpoch.js'; export class EpochTemplate implements IEpochTemplate { public readonly epochNumber: bigint; public readonly epochTarget: Buffer; constructor(data: RawEpochTemplate) { this.epochNumber = BigInt(data.epochNumber); this.epochTarget = stringToBuffer(data.epochTarget); } }