UNPKG

airgap-coin-lib

Version:

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

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