UNPKG

@btc-vision/transaction

Version:

OPNet transaction library allows you to create and sign transactions for the OPNet network.

19 lines (18 loc) 1.04 kB
import { IChallengeSolution, RawChallenge } from '../interfaces/IChallengeSolution.js'; export declare class EpochValidator { private static readonly BLOCKS_PER_EPOCH; static bufferToUint8Array(buffer: Buffer): Uint8Array; static uint8ArrayToBuffer(array: Uint8Array): Buffer; static sha1(data: Uint8Array | Buffer): Buffer; static calculatePreimage(checksumRoot: Buffer, publicKey: Buffer, salt: Buffer): Buffer; static countMatchingBits(hash1: Buffer, hash2: Buffer): number; static verifySolution(challenge: IChallengeSolution, log?: boolean): boolean; static getMiningTargetBlock(epochNumber: bigint): bigint | null; static validateEpochWinner(epochData: RawChallenge): boolean; static validateChallengeSolution(challenge: IChallengeSolution): boolean; static calculateSolution(targetChecksum: Buffer, publicKey: Buffer, salt: Buffer): Buffer; static checkDifficulty(solution: Buffer, targetHash: Buffer, minDifficulty: number): { valid: boolean; difficulty: number; }; }