UNPKG

@zlattice/lattice-js

Version:

Lattice blockchain TypeScript SDK with dual module support (CJS + ESM)

50 lines 1.65 kB
import { ZERO_HASH } from "../constants.js"; export class LatestBlock { constructor(currentTBlockNumber, currentTBlockHash, currentDBlockHash) { this.currentTBlockNumber = currentTBlockNumber; this.currentTBlockHash = currentTBlockHash; this.currentDBlockHash = currentDBlockHash; } /** * Create an empty latest block * * @returns The empty latest block */ static emptyBlock() { return new LatestBlock(0, ZERO_HASH, ZERO_HASH); } } export class Anchor { constructor(number, hash, owner) { this.number = number; this.hash = hash; this.owner = owner; } } export class DBlock { constructor(hash, parentHash, ledgerHash, receiptsHash, coinbase, signer, contracts, difficulty, number, lastedDBNumber, extra, reward, pow, timestamp, size, td, ttd, version, txHashList, receipts, anchors) { this.txHashList = []; this.hash = hash; this.parentHash = parentHash; this.ledgerHash = ledgerHash; this.receiptsHash = receiptsHash; this.coinbase = coinbase; this.signer = signer; this.contracts = contracts; this.difficulty = difficulty; this.number = number; this.lastedDBNumber = lastedDBNumber; this.extra = extra; this.reward = reward; this.pow = pow; this.timestamp = timestamp; this.size = size; this.td = td; this.ttd = ttd; this.version = version; this.txHashList = txHashList; this.receipts = receipts; this.anchors = anchors; } } //# sourceMappingURL=block.js.map