UNPKG

airgap-coin-lib

Version:

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

42 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 SCALEClass_1 = require("../../../scale/type/SCALEClass"); var SCALEString_1 = require("../../../scale/type/SCALEString"); var MetadataV11Event = /** @class */ (function (_super) { __extends(MetadataV11Event, _super); function MetadataV11Event(name, args, docs) { var _this = _super.call(this) || this; _this.name = name; _this.args = args; _this.docs = docs; _this.scaleFields = [_this.name, _this.args, _this.docs]; return _this; } MetadataV11Event.decode = function (network, raw) { var decoder = new SCALEDecoder_1.SCALEDecoder(network, raw); var name = decoder.decodeNextString(); var args = decoder.decodeNextArray(function (_, hex) { return SCALEString_1.SCALEString.decode(hex); }); var docs = decoder.decodeNextArray(function (_, hex) { return SCALEString_1.SCALEString.decode(hex); }); return { bytesDecoded: name.bytesDecoded + args.bytesDecoded + docs.bytesDecoded, decoded: new MetadataV11Event(name.decoded, args.decoded, docs.decoded) }; }; return MetadataV11Event; }(SCALEClass_1.SCALEClass)); exports.MetadataV11Event = MetadataV11Event; //# sourceMappingURL=MetadataV11Event.js.map