UNPKG

airgap-coin-lib

Version:

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

38 lines 1.97 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); var SCALEDecoder_1 = require("../../../scale/SCALEDecoder"); var MetadataV11Module_1 = require("../../v11/module/MetadataV11Module"); var MetadataV12Module = /** @class */ (function (_super) { __extends(MetadataV12Module, _super); function MetadataV12Module(name, storage, calls, events, constants, errors, index) { var _this = _super.call(this, name, storage, calls, events, constants, errors) || this; _this.index = index; _this.scaleFields = [_this.name, _this.storage, _this.calls, _this.events, _this.constants, _this.errors, _this.index]; return _this; } MetadataV12Module.decode = function (network, raw) { var decoder = new SCALEDecoder_1.SCALEDecoder(network, raw); var v11 = decoder.decodeNextObject(MetadataV11Module_1.MetadataV11Module.decode); var index = decoder.decodeNextInt(8); return { bytesDecoded: v11.bytesDecoded + index.bytesDecoded, decoded: new MetadataV12Module(v11.decoded.name, v11.decoded.storage, v11.decoded.calls, v11.decoded.events, v11.decoded.constants, v11.decoded.errors, index.decoded) }; }; return MetadataV12Module; }(MetadataV11Module_1.MetadataV11Module)); exports.MetadataV12Module = MetadataV12Module; //# sourceMappingURL=MetadataV12Module.js.map