UNPKG

airgap-coin-lib

Version:

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

23 lines 1.2 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var SCALEDecoder_1 = require("../scale/SCALEDecoder"); var SCALEAccountId_1 = require("../scale/type/SCALEAccountId"); var SCALEInt_1 = require("../scale/type/SCALEInt"); var SCALETuple_1 = require("../scale/type/SCALETuple"); var SubstrateEraRewardPoints = /** @class */ (function () { function SubstrateEraRewardPoints(total, individual) { this.total = total; this.individual = individual; } SubstrateEraRewardPoints.decode = function (network, runtimeVersion, raw) { var decoder = new SCALEDecoder_1.SCALEDecoder(network, raw); var total = decoder.decodeNextInt(32); var individual = decoder.decodeNextArray(function (network, hex) { return SCALETuple_1.SCALETuple.decode(network, hex, SCALEAccountId_1.SCALEAccountId.decode, function (_, second) { return SCALEInt_1.SCALEInt.decode(second, 32); }); }); return new SubstrateEraRewardPoints(total.decoded, individual.decoded); }; return SubstrateEraRewardPoints; }()); exports.SubstrateEraRewardPoints = SubstrateEraRewardPoints; //# sourceMappingURL=SubstrateEraRewardPoints.js.map