UNPKG

@node-lightning/graph

Version:
23 lines 810 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.channelFromMessage = void 0; const channel_1 = require("../channel"); /** * Constructs an incomplete channel from a node announcement message. The channel does * not include outpoint, capacity, or per node settings found in channel_update * messages. These values need to be set elsewhere. */ function channelFromMessage(msg) { const c = new channel_1.Channel(); c.shortChannelId = msg.shortChannelId; c.features = msg.features; c.nodeId1 = msg.nodeId1; c.nodeId2 = msg.nodeId2; if ("outpoint" in msg) { c.channelPoint = msg.outpoint; c.capacity = msg.capacity; } return c; } exports.channelFromMessage = channelFromMessage; //# sourceMappingURL=channel-from-message.js.map