opnet
Version:
The perfect library for building Bitcoin-based applications.
26 lines (25 loc) • 778 B
JavaScript
export class BlockGasParameters {
blockNumber;
gasUsed;
targetGasLimit;
ema;
baseGas;
gasPerSat;
bitcoin;
constructor(data) {
this.blockNumber = BigInt(data.blockNumber);
this.gasUsed = BigInt(data.gasUsed);
this.targetGasLimit = BigInt(data.targetGasLimit);
this.ema = BigInt(data.ema);
this.baseGas = BigInt(data.baseGas);
this.gasPerSat = BigInt(data.gasPerSat);
this.bitcoin = {
conservative: Number(data.bitcoin.conservative),
recommended: {
low: Number(data.bitcoin.recommended.low),
medium: Number(data.bitcoin.recommended.medium),
high: Number(data.bitcoin.recommended.high),
},
};
}
}