UNPKG

@node-lightning/graph

Version:
22 lines 932 B
"use strict"; /* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/no-unsafe-assignment */ Object.defineProperty(exports, "__esModule", { value: true }); exports.channelSettingsFromJson = void 0; const channel_settings_1 = require("../channel-settings"); /** * Parses ChannelSettings from JSON serialization. */ function channelSettingsFromJson(text) { const t = JSON.parse(text); const s = new channel_settings_1.ChannelSettings(); s.timestamp = t.timestamp; s.htlcMinimumMsat = BigInt(t.htlcMinimumMsat); s.htlcMaximumMsat = t.htlcMaximumMsat ? BigInt(s.htlcMaximumMsat) : undefined; s.feeBaseMsat = parseInt(t.feeBaseMsat); s.feeProportionalMillionths = parseInt(t.feeProportionalMillionths); s.disabled = t.disabled; return s; } exports.channelSettingsFromJson = channelSettingsFromJson; //# sourceMappingURL=channel-settings-from-json.js.map