UNPKG

airgap-coin-lib

Version:

The airgap-coin-lib is a protocol agnostic library to prepare, sign and broadcast cryptocurrency transactions.

23 lines 1.18 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var SCALEDecoder_1 = require("../scale/SCALEDecoder"); var SCALEInt_1 = require("../scale/type/SCALEInt"); var SubstrateSlashingSpans = /** @class */ (function () { function SubstrateSlashingSpans(spanIndex, lastStart, lastNonzeroSlash, prior) { this.spanIndex = spanIndex; this.lastStart = lastStart; this.lastNonzeroSlash = lastNonzeroSlash; this.prior = prior; } SubstrateSlashingSpans.decode = function (network, runtimeVersion, raw) { var decoder = new SCALEDecoder_1.SCALEDecoder(network, raw); var spanIndex = decoder.decodeNextInt(32); var lastStart = decoder.decodeNextInt(32); var lastNonzeroSlash = decoder.decodeNextInt(32); var prior = decoder.decodeNextArray(function (_, hex) { return SCALEInt_1.SCALEInt.decode(hex, 32); }); return new SubstrateSlashingSpans(spanIndex.decoded, lastStart.decoded, lastNonzeroSlash.decoded, prior.decoded); }; return SubstrateSlashingSpans; }()); exports.SubstrateSlashingSpans = SubstrateSlashingSpans; //# sourceMappingURL=SubstrateSlashingSpans.js.map