@zlattice/lattice-js
Version:
Lattice blockchain TypeScript SDK with dual module support (CJS + ESM)
56 lines • 1.88 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DBlock = exports.Anchor = exports.LatestBlock = void 0;
const constants_1 = require("../constants.js");
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, constants_1.ZERO_HASH, constants_1.ZERO_HASH);
}
}
exports.LatestBlock = LatestBlock;
class Anchor {
constructor(number, hash, owner) {
this.number = number;
this.hash = hash;
this.owner = owner;
}
}
exports.Anchor = Anchor;
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;
}
}
exports.DBlock = DBlock;
//# sourceMappingURL=block.js.map