From 30efccdbf3656babce5f353caf6c60acc8c9ff74 Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Wed, 18 Nov 2020 17:41:01 -0800 Subject: [PATCH 01/38] forward boost sats to original msg poster if tribe admin, receiveBoost and send boost --- dist/src/constants.js | 1 + dist/src/constants.js.map | 2 +- dist/src/controllers/index.js | 1 + dist/src/controllers/index.js.map | 2 +- dist/src/controllers/messages.js | 54 +++++++++++++++++++++++---- dist/src/controllers/messages.js.map | 2 +- dist/src/network/receive.js | 33 ++++++++++++++-- dist/src/network/receive.js.map | 2 +- src/constants.ts | 1 + src/controllers/index.ts | 1 + src/controllers/messages.ts | 56 ++++++++++++++++++++++++---- src/network/receive.ts | 32 ++++++++++++++-- 12 files changed, 161 insertions(+), 26 deletions(-) diff --git a/dist/src/constants.js b/dist/src/constants.js index 30db15d..b2ed1b9 100644 --- a/dist/src/constants.js +++ b/dist/src/constants.js @@ -58,6 +58,7 @@ const constants = { "heartbeat": 26, "heartbeat_confirmation": 27, "keysend": 28, + "boost": 29, }, payment_errors: { "timeout": "Timed Out", diff --git a/dist/src/constants.js.map b/dist/src/constants.js.map index 95c17db..55bf24d 100644 --- a/dist/src/constants.js.map +++ b/dist/src/constants.js.map @@ -1 +1 @@ -{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":";;AAAA,MAAM,SAAS,GAAG;IAChB,cAAc,EAAE,CAAC;IACjB,eAAe,EAAE;QACf,SAAS,EAAE,CAAC;QACZ,OAAO,EAAE,CAAC;QACV,WAAW,EAAE,CAAC;QACd,aAAa,EAAE,CAAC;QAChB,UAAU,EAAE,CAAC;QACb,SAAS,EAAE,CAAC;QACZ,iBAAiB,EAAE,CAAC;KACrB;IACD,gBAAgB,EAAE;QAChB,SAAS,EAAE,CAAC;QACZ,WAAW,EAAE,CAAC;KACf;IACD,QAAQ,EAAE;QACR,SAAS,EAAE,CAAC;QACZ,WAAW,EAAE,CAAC;QACd,WAAW,EAAE,CAAC;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D,UAAU,EAAE;QACV,GAAG,EAAE,CAAC;QACN,OAAO,EAAE,CAAC;QACV,OAAO,EAAE,CAAC;QACV,KAAK,EAAE,CAAC;QACR,QAAQ,EAAE,CAAC;QACX,QAAQ,EAAE,CAAC;KACZ;CACF,CAAA;AAED,kBAAe,SAAS,CAAA"} \ No newline at end of file +{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":";;AAAA,MAAM,SAAS,GAAG;IAChB,cAAc,EAAE,CAAC;IACjB,eAAe,EAAE;QACf,SAAS,EAAE,CAAC;QACZ,OAAO,EAAE,CAAC;QACV,WAAW,EAAE,CAAC;QACd,aAAa,EAAE,CAAC;QAChB,UAAU,EAAE,CAAC;QACb,SAAS,EAAE,CAAC;QACZ,iBAAiB,EAAE,CAAC;KACrB;IACD,gBAAgB,EAAE;QAChB,SAAS,EAAE,CAAC;QACZ,WAAW,EAAE,CAAC;KACf;IACD,QAAQ,EAAE;QACR,SAAS,EAAE,CAAC;QACZ,WAAW,EAAE,CAAC;QACd,WAAW,EAAE,CAAC;QACd,UAAU,EAAE,CAAC;QACb,QAAQ,EAAE,CAAC;QACX,SAAS,EAAE,CAAC;KACb;IACD,aAAa,EAAE;QACb,UAAU,EAAE,CAAC;QACb,SAAS,EAAE,CAAC;QACZ,UAAU,EAAE,CAAC;KACd;IACD,aAAa,EAAE;QACb,SAAS,EAAE,CAAC;QACZ,cAAc,EAAE,CAAC;QACjB,SAAS,EAAE,CAAC;QACZ,SAAS,EAAE,CAAC;QACZ,cAAc,EAAE,CAAC;QACjB,gBAAgB,EAAE,CAAC;QACnB,YAAY,EAAE,CAAC;QACf,UAAU,EAAE,CAAC;QACb,iBAAiB,EAAE,CAAC;QACpB,eAAe,EAAE,CAAC;QAClB,aAAa,EAAE,EAAE;QACjB,0BAA0B,EAAE,EAAE;QAC9B,cAAc,EAAE,EAAE;QAClB,cAAc,EAAE,EAAE;QAClB,YAAY,EAAE,EAAE;QAChB,aAAa,EAAE,EAAE;QACjB,YAAY,EAAE,EAAE;QAChB,QAAQ,EAAE,EAAE;QACZ,WAAW,EAAE,EAAE;QACf,gBAAgB,EAAE,EAAE;QACpB,gBAAgB,EAAE,EAAE;QACpB,eAAe,EAAE,EAAE;QACnB,cAAc,EAAE,EAAE;QAClB,aAAa,EAAE,EAAE;QACjB,SAAS,EAAE,EAAE;QACb,SAAS,EAAE,EAAE;QACb,WAAW,EAAE,EAAE;QACf,wBAAwB,EAAE,EAAE;QAC5B,SAAS,EAAE,EAAE;QACb,OAAO,EAAE,EAAE;KACZ;IACD,cAAc,EAAE;QACd,SAAS,EAAE,WAAW;QACtB,UAAU,EAAE,sBAAsB;QAClC,OAAO,EAAE,OAAO;QAChB,2BAA2B,EAAE,2BAA2B;QACxD,SAAS,EAAE,SAAS;KACrB;IACD,UAAU,EAAE;QACV,cAAc,EAAE,CAAC;QACjB,OAAO,EAAE,CAAC;QACV,OAAO,EAAE,CAAC;KACX;IACD,SAAS,EAAE;QACT,SAAS,EAAE,CAAC;QACZ,OAAO,EAAE,CAAC;QACV,QAAQ,EAAE,CAAC;KACZ;IACD,UAAU,EAAE;QACV,GAAG,EAAE,CAAC;QACN,OAAO,EAAE,CAAC;QACV,OAAO,EAAE,CAAC;QACV,KAAK,EAAE,CAAC;QACR,QAAQ,EAAE,CAAC;QACX,QAAQ,EAAE,CAAC;KACZ;CACF,CAAA;AAED,kBAAe,SAAS,CAAA"} \ No newline at end of file diff --git a/dist/src/controllers/index.js b/dist/src/controllers/index.js index a486f3f..7a5104c 100644 --- a/dist/src/controllers/index.js +++ b/dist/src/controllers/index.js @@ -150,5 +150,6 @@ exports.ACTIONS = { [msgtypes.bot_res]: bots.receiveBotRes, [msgtypes.heartbeat]: confirmations.receiveHeartbeat, [msgtypes.heartbeat_confirmation]: confirmations.receiveHeartbeatConfirmation, + [msgtypes.boost]: messages.receiveBoost, }; //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/src/controllers/index.js.map b/dist/src/controllers/index.js.map index 3c665e2..1190557 100644 --- a/dist/src/controllers/index.js.map +++ b/dist/src/controllers/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/controllers/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,iCAAgC;AAChC,2CAA0C;AAC1C,+BAA8B;AAC9B,qCAAoC;AACpC,uCAAsC;AACtC,qCAAoC;AACpC,uCAAsC;AACtC,iCAAgC;AAChC,uCAAsC;AACtC,sCAAqC;AACrC,gDAA+C;AAC/C,qCAAoC;AACpC,iDAAgD;AAChD,iCAAgC;AAChC,8CAAyC;AACzC,0CAAyC;AACzC,0CAAyC;AACzC,4CAAoC;AACpC,+BAA8B;AAE9B,SAAsB,GAAG,CAAC,GAAG;;QAE5B,WAAW,CAAC,IAAI,EAAE,CAAA;QAElB,IAAG,eAAM,IAAI,eAAM,CAAC,YAAY,EAAC;YAChC,YAAY,CAAC,kBAAkB,EAAE,CAAA;SACjC;QACD,IAAG;YACF,MAAM,KAAK,CAAC,eAAe,EAAE,CAAA;SAC7B;QAAC,OAAM,CAAC,EAAE;YACV,OAAO,CAAC,GAAG,CAAC,qCAAqC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAA;SAC7D;QAED,MAAM,CAAC,YAAY,EAAE,CAAA;QAErB,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAA;QACjC,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,eAAe,CAAC,CAAA;QACzC,GAAG,CAAC,GAAG,CAAC,YAAY,EAAE,KAAK,CAAC,UAAU,CAAC,CAAA;QACvC,GAAG,CAAC,IAAI,CAAC,8BAA8B,EAAE,KAAK,CAAC,IAAI,CAAC,CAAA;QACpD,GAAG,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,CAAC,UAAU,CAAC,CAAA;QACzC,GAAG,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK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AI,CAAC,aAAa;IACtC,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,aAAa;IACtC,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,aAAa,CAAC,gBAAgB;IACpD,CAAC,QAAQ,CAAC,sBAAsB,CAAC,EAAE,aAAa,CAAC,4BAA4B;CAC7E,CAAA"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/controllers/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,iCAAgC;AAChC,2CAA0C;AAC1C,+BAA8B;AAC9B,qCAAoC;AACpC,uCAAsC;AACtC,qCAAoC;AACpC,uCAAsC;AACtC,iCAAgC;AAChC,uCAAsC;AACtC,sCAAqC;AACrC,gDAA+C;AAC/C,qCAAoC;AACpC,iDAAgD;AAChD,iCAAgC;AAChC,8CAAyC;AACzC,0CAAyC;AACzC,0CAAyC;AACzC,4CAAoC;AACpC,+BAA8B;AAE9B,SAAsB,GAAG,CAAC,GAAG;;QAE5B,WAAW,CAAC,IAAI,EAAE,CAAA;QAElB,IAAG,eAAM,IAAI,eAAM,CAAC,YAAY,EAAC;YAChC,YAAY,CAAC,kBAAkB,EAAE,CAAA;SACjC;QACD,IAAG;YACF,MAAM,KAAK,CAAC,eAAe,EAAE,CAAA;SAC7B;QAAC,OAAM,CAAC,EAAE;YACV,OAAO,CAAC,GAAG,CAAC,qCAAqC,EAAE,CAAC,CAAC,OAAO,CAAC,CAAA;SAC7D;QAED,MAAM,CAAC,YAAY,EAAE,CAAA;QAErB,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAA;QACjC,GAAG,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,eAAe,CAAC,CAAA;QACzC,GAAG,CAAC,GAAG,CAAC,YAAY,EAAE,KAAK,CAAC,UAAU,CAAC,CAAA;QACvC,GAAG,CAAC,IAAI,CAAC,8BAA8B,EAAE,KAA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Y,CAAC,EAAE,UAAU,CAAC,kBAAkB;IACtD,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC,iBAAiB;IAC9C,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,aAAa;IACtC,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,aAAa;IACtC,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,aAAa,CAAC,gBAAgB;IACpD,CAAC,QAAQ,CAAC,sBAAsB,CAAC,EAAE,aAAa,CAAC,4BAA4B;IAC7E,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,YAAY;CACvC,CAAA"} \ No newline at end of file diff --git a/dist/src/controllers/messages.js b/dist/src/controllers/messages.js index c36c38a..6dd0caf 100644 --- a/dist/src/controllers/messages.js +++ b/dist/src/controllers/messages.js @@ -139,7 +139,10 @@ exports.sendMessage = (req, res) => __awaiter(void 0, void 0, void 0, function* // } catch(e) { // return failure(res, e.message) // } - const { contact_id, text, remote_text, chat_id, remote_text_map, amount, reply_uuid, } = req.body; + const { contact_id, text, remote_text, chat_id, remote_text_map, amount, reply_uuid, boost, } = req.body; + let msgtype = constants_1.default.message_types.message; + if (boost) + msgtype = constants_1.default.message_types.boost; var date = new Date(); date.setMilliseconds(0); const owner = yield models_1.models.Contact.findOne({ where: { isOwner: true } }); @@ -152,7 +155,7 @@ exports.sendMessage = (req, res) => __awaiter(void 0, void 0, void 0, function* const msg = { chatId: chat.id, uuid: short.generate(), - type: constants_1.default.message_types.message, + type: msgtype, sender: owner.id, amount: amount || 0, date: date, @@ -178,18 +181,17 @@ exports.sendMessage = (req, res) => __awaiter(void 0, void 0, void 0, function* chat: chat, sender: owner, amount: amount || 0, - type: constants_1.default.message_types.message, + type: msgtype, message: msgToSend, }); }); exports.receiveMessage = (payload) => __awaiter(void 0, void 0, void 0, function* () { // console.log('received message', { payload }) - const total_spent = 1; - const { owner, sender, chat, content, remote_content, msg_id, chat_type, sender_alias, msg_uuid, date_string, reply_uuid } = yield helpers.parseReceiveParams(payload); + const { owner, sender, chat, content, remote_content, msg_id, chat_type, sender_alias, msg_uuid, date_string, reply_uuid, amount } = yield helpers.parseReceiveParams(payload); if (!owner || !sender || !chat) { return console.log('=> no group chat!'); } - const text = content; + const text = content || ''; var date = new Date(); date.setMilliseconds(0); if (date_string) @@ -198,9 +200,9 @@ exports.receiveMessage = (payload) => __awaiter(void 0, void 0, void 0, function chatId: chat.id, uuid: msg_uuid, type: constants_1.default.message_types.message, - asciiEncodedTotal: total_spent, sender: sender.id, date: date, + amount: amount || 0, messageContent: text, createdAt: date, updatedAt: date, @@ -215,7 +217,6 @@ exports.receiveMessage = (payload) => __awaiter(void 0, void 0, void 0, function if (reply_uuid) msg.replyUuid = reply_uuid; const message = yield models_1.models.Message.create(msg); - // console.log('saved message', message.dataValues) socket.sendJson({ type: 'message', response: jsonUtils.messageToJson(message, chat, sender) @@ -224,6 +225,43 @@ exports.receiveMessage = (payload) => __awaiter(void 0, void 0, void 0, function const theChat = Object.assign(Object.assign({}, chat.dataValues), { contactIds: [sender.id] }); confirmations_1.sendConfirmation({ chat: theChat, sender: owner, msg_id }); }); +exports.receiveBoost = (payload) => __awaiter(void 0, void 0, void 0, function* () { + console.log('received boost', { payload }); + const { owner, sender, chat, content, remote_content, chat_type, sender_alias, msg_uuid, date_string, reply_uuid, amount } = yield helpers.parseReceiveParams(payload); + if (!owner || !sender || !chat) { + return console.log('=> no group chat!'); + } + const text = content; + var date = new Date(); + date.setMilliseconds(0); + if (date_string) + date = new Date(date_string); + const msg = { + chatId: chat.id, + uuid: msg_uuid, + type: constants_1.default.message_types.boost, + sender: sender.id, + date: date, + amount: amount || 0, + messageContent: text, + createdAt: date, + updatedAt: date, + status: constants_1.default.statuses.received + }; + const isTribe = chat_type === constants_1.default.chat_types.tribe; + if (isTribe) { + msg.senderAlias = sender_alias; + if (remote_content) + msg.remoteMessageContent = remote_content; + } + if (reply_uuid) + msg.replyUuid = reply_uuid; + const message = yield models_1.models.Message.create(msg); + socket.sendJson({ + type: 'boost', + response: jsonUtils.messageToJson(message, chat, sender) + }); +}); exports.receiveDeleteMessage = (payload) => __awaiter(void 0, void 0, void 0, function* () { console.log('=> received delete message'); const { owner, sender, chat, chat_type, msg_uuid } = yield helpers.parseReceiveParams(payload); diff --git a/dist/src/controllers/messages.js.map b/dist/src/controllers/messages.js.map index 940fa1c..dc69a3a 100644 --- a/dist/src/controllers/messages.js.map +++ b/dist/src/controllers/messages.js.map @@ -1 +1 @@ -{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/controllers/messages.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,yCAA8B;AAC9B,2CAAoC;AACpC,gCAAyC;AACzC,0CAAyC;AACzC,2CAA0C;AAC1C,sCAAqC;AACrC,sCAA+C;AAC/C,0CAAyC;AACzC,mDAAgD;AAChD,sCAAqC;AACrC,oCAAmC;AACnC,4CAAoC;AAEvB,QAAA,WAAW,GAAG,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;IAC7C,MAAM,YAAY,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;IAEpC,IAAI,CAAC,YAAY,EAAE;QAClB,OAAO,sBAAc,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;KAC/B;IACD,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;IACzB,MAAM,KAAK,GAAG,MAAM,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,CAAA;IACxE,mCAAmC;IAEnC,IAAI,gBAAgB,GAAG;QACtB,IAAI,EAAE,EAAE,CAAC,cAAE,CAAC,GAAG,CAAC,EAAE,YAAY,EAAE;QAChC,CAAC,cAAE,CAAC,EAAE,CAAC,EAAE;YACR,EAAC,QAAQ,EAAE,KAAK,CAAC,EAAE,EAAC;YACpB,EAAC,QAAQ,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,sBAAgB,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;QACnC,MAAM,CAAC,QAAQ,CAAC;YACf,IAAI,EAAE,WAAW;YACjB,QAAQ,EAAE,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC;SACpC,CAAC,CAAA;KACF;SAAM;QACN,aAAO,CAAC,GAAG,EAAE,SAAS,CAAC,CAAA;KACvB;AACF,CAAC,CAAA,CAAA;AAEY,QAAA,aAAa,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IACzC,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;IAErD,aAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;AACjB,CAAC,CAAA"} \ No newline at end of file +{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/controllers/messages.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,yCAA8B;AAC9B,2CAAoC;AACpC,gCAAyC;AACzC,0CAAyC;AACzC,2CAA0C;AAC1C,sCAAqC;AACrC,sCAA+C;AAC/C,0CAAyC;AACzC,mDAAgD;AAChD,sCAAqC;AACrC,oCAAmC;AACnC,4CAAoC;AAEvB,QAAA,WAAW,GAAG,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;IAC7C,MAAM,YAAY,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;IAEpC,IAAI,CAAC,YAAY,EAAE;QAClB,OAAO,sBAAc,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;KAC/B;IACD,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;IACzB,MAAM,KAAK,GAAG,MAAM,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,CAAA;IACxE,mCAAmC;IAEnC,IAAI,gBAAgB,GAAG;QACt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E,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAC,CAAC,CAAA;IAEvE,MAAM,eAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;QAC3C,KAAK,EAAE;YACL,MAAM,EAAE;gBACT,CAAC,cAAE,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE;aACf;YACD,MAAM,EAAE,OAAO;SAChB;KACD,CAAC,CAAC;IACH,MAAM,IAAI,GAAG,MAAM,eAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,CAAA;IAClE,IAAG,IAAI,EAAE;QACR,MAAM,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAClC,aAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;QAChB,sBAAgB,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;QACnC,MAAM,CAAC,QAAQ,CAAC;YACf,IAAI,EAAE,WAAW;YACjB,QAAQ,EAAE,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC;SACpC,CAAC,CAAA;KACF;SAAM;QACN,aAAO,CAAC,GAAG,EAAE,SAAS,CAAC,CAAA;KACvB;AACF,CAAC,CAAA,CAAA;AAEY,QAAA,aAAa,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IACzC,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;IAErD,aAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;AACjB,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/src/network/receive.js b/dist/src/network/receive.js index 08a08bb..f26240c 100644 --- a/dist/src/network/receive.js +++ b/dist/src/network/receive.js @@ -33,13 +33,13 @@ in receiveDeleteMessage check the deleter is og sender? const msgtypes = constants_1.default.message_types; exports.typesToForward = [ msgtypes.message, msgtypes.group_join, msgtypes.group_leave, - msgtypes.attachment, msgtypes.delete, + msgtypes.attachment, msgtypes.delete, msgtypes.boost, ]; const typesToModify = [ msgtypes.attachment ]; const typesThatNeedPricePerMessage = [ - msgtypes.message, msgtypes.attachment + msgtypes.message, msgtypes.attachment, msgtypes.boost ]; exports.typesToReplay = [ msgtypes.message, @@ -135,6 +135,18 @@ function onReceive(payload) { doAction = true; } } + // forward boost sats to recipient + if (payload.type === msgtypes.boost && payload.message.replyUuid) { + const ogMsg = yield models_1.models.Message.findOne({ where: { + uuid: payload.message.replyUuid, + } }); + if (ogMsg) { + const amtToForward = payload.message.amount - (chat.pricePerMessage || 0) - (chat.escrowAmount || 0); + if (amtToForward > 0) { + forwardSatsToContact(chat, ogMsg.sender, amtToForward, payload.message.replyUuid); + } + } + } if (doAction) forwardMessageToTribe(payload, senderContact); else @@ -170,7 +182,8 @@ function onReceive(payload) { function doTheAction(data) { return __awaiter(this, void 0, void 0, function* () { let payload = data; - if (payload.isTribeOwner) { + if (payload.isTribeOwner) { // this is only for storing locally, my own messages as tribe owner + // actual encryption for tribe happens in personalizeMessage const ogContent = data.message && data.message.content; // const ogMediaKey = data.message && data.message.mediaKey /* decrypt and re-encrypt with phone's pubkey for storage */ @@ -190,6 +203,20 @@ function doTheAction(data) { } }); } +function forwardSatsToContact(chat, contactId, amount, theuuid) { + return __awaiter(this, void 0, void 0, function* () { + const owner = yield models_1.models.Contact.findOne({ where: { isOwner: true } }); + send_1.sendMessage({ + chat: Object.assign(Object.assign({}, chat.dataValues), { contactIds: [contactId] }), + sender: owner, + type: constants_1.default.message_types.keysend, + amount: amount, + message: { content: '!' }, + success: () => { }, + failure: () => { } + }); + }); +} function forwardMessageToTribe(ogpayload, sender) { return __awaiter(this, void 0, void 0, function* () { // console.log('forwardMessageToTribe') diff --git a/dist/src/network/receive.js.map b/dist/src/network/receive.js.map index f29802f..7428fc1 100644 --- a/dist/src/network/receive.js.map +++ b/dist/src/network/receive.js.map @@ -1 +1 @@ -{"version":3,"file":"receive.js","sourceRoot":"","sources":["../../../src/network/receive.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAqC;AACrC,kDAA0C;AAC1C,gDAAsC;AACtC,0CAAyC;AACzC,kDAA2D;AAC3D,0CAAyC;AACzC,sCAAkC;AAClC,iCAAkC;AAClC,qCAA8G;AAC9G,sCAAiE;AACjE,yCAA8B;AAC9B,0CAAyC;AACzC,0CAAyC;AACzC,gCAAyC;AACzC,4CAAoC;AACpC,2CAA0C;AAE1C;;;;EAIE;AAEF,MAAM,QAAQ,GAAG,mBAAS,CAAC,aAAa,CAAA;AAE3B,QAAA,cAAc,GAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,WAAW;IAC3D,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,MAAM;CACpC,CAAA;AACD,MAAM,aAAa,GAAC;IACnB,QAAQ,CAAC,UAAU;CACnB,CAAA;AACD,MAAM,4BAA4B,GAAG;IACpC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,UAAU;CACrC,CAAA;AACY,QAAA,aAAa,GAAC;IAC1B,QAAQ,CAAC,OAAO;IAChB,QAAQ,CAAC,UAAU;IACnB,QAAQ,CAAC,WAAW;IACpB,QAAQ,CAAC,OAAO;CAChB,CAAA;AACD,MAAM,QAAQ,GAAC;IACd,mBAAS,CAAC,aAAa,CAAC,WAAW;IACnC,mBAAS,CAAC,aAAa,CAAC,OAAO;IAC/B,mBAAS,CAAC,aAAa,CAAC,OAAO;CAC/B,CAAA;AACD,MAAM,aAAa,GAAC;IACnB,mBAAS,CAAC,aAAa,CAAC,WAAW;IACnC,mBAAS,CAAC,aAAa,CAAC,OAAO;CAC/B,CAAA;AACD,SAAe,SAAS,CAAC,OAAO;;QAC/B,+DAA+D;QAC/D,IAAG,CAAC,CAAC,OAAO,CAAC,IA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CAAA;IAChB,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAA;IACf,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAA;IACf,MAAM,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAC,CAAC,EAAC,EAAE,CAAA,CAAC,GAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACzC,MAAM,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,EAAE,CAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,CAAA;IAC9D,IAAG,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,KAAG,QAAQ,CAAC,CAAC,CAAC,EAAC;QAClC,cAAc;QACd,MAAM,GAAG,GAAG,MAAM,CAAC,EAAE,CAAC,CAAA;QACtB,IAAI,OAAO,GAAG,EAAE,CAAA;QAChB,GAAG,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAC,CAAC,EAAC,EAAE,CAAA,CAAC,CAAC,CAAC,GAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAA,EAAE;YAC7C,OAAO,IAAI,GAAG,CAAC,CAAC,CAAA;QACjB,CAAC,CAAC,CAAA;QACF,OAAO,MAAM,CAAC,EAAE,CAAC,CAAA;QACjB,OAAO,OAAO,CAAA;KACd;AACF,CAAC"} \ No newline at end of file +{"version":3,"file":"receive.js","sourceRoot":"","sources":["../../../src/network/receive.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAqC;AACrC,kDAA0C;AAC1C,gDAAsC;AACtC,0CAAyC;AACzC,kDAA2D;AAC3D,0CAAyC;AACzC,sCAAkC;AAClC,iCAAkC;AAClC,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C,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACzC,MAAM,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,EAAE,CAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,CAAA;IAC9D,IAAG,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,KAAG,QAAQ,CAAC,CAAC,CAAC,EAAC;QAClC,cAAc;QACd,MAAM,GAAG,GAAG,MAAM,CAAC,EAAE,CAAC,CAAA;QACtB,IAAI,OAAO,GAAG,EAAE,CAAA;QAChB,GAAG,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAC,CAAC,EAAC,EAAE,CAAA,CAAC,CAAC,CAAC,GAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAA,EAAE;YAC7C,OAAO,IAAI,GAAG,CAAC,CAAC,CAAA;QACjB,CAAC,CAAC,CAAA;QACF,OAAO,MAAM,CAAC,EAAE,CAAC,CAAA;QACjB,OAAO,OAAO,CAAA;KACd;AACF,CAAC"} \ No newline at end of file diff --git a/src/constants.ts b/src/constants.ts index f24bb37..5a43ed7 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -56,6 +56,7 @@ const constants = { "heartbeat": 26, "heartbeat_confirmation": 27, "keysend": 28, // no e2e + "boost": 29, }, payment_errors: { "timeout": "Timed Out", diff --git a/src/controllers/index.ts b/src/controllers/index.ts index bfe8d5b..94e9132 100644 --- a/src/controllers/index.ts +++ b/src/controllers/index.ts @@ -151,4 +151,5 @@ export const ACTIONS = { [msgtypes.bot_res]: bots.receiveBotRes, [msgtypes.heartbeat]: confirmations.receiveHeartbeat, [msgtypes.heartbeat_confirmation]: confirmations.receiveHeartbeatConfirmation, + [msgtypes.boost]: messages.receiveBoost, } diff --git a/src/controllers/messages.ts b/src/controllers/messages.ts index 5becb2c..f0ab7e7 100644 --- a/src/controllers/messages.ts +++ b/src/controllers/messages.ts @@ -157,8 +157,12 @@ export const sendMessage = async (req, res) => { remote_text_map, amount, reply_uuid, + boost, } = req.body + let msgtype = constants.message_types.message + if(boost) msgtype = constants.message_types.boost + var date = new Date() date.setMilliseconds(0) @@ -173,7 +177,7 @@ export const sendMessage = async (req, res) => { const msg:{[k:string]:any}={ chatId: chat.id, uuid: short.generate(), - type: constants.message_types.message, + type: msgtype, sender: owner.id, amount: amount||0, date: date, @@ -199,7 +203,7 @@ export const sendMessage = async (req, res) => { chat: chat, sender: owner, amount: amount||0, - type: constants.message_types.message, + type: msgtype, message: msgToSend, }) } @@ -207,12 +211,11 @@ export const sendMessage = async (req, res) => { export const receiveMessage = async (payload) => { // console.log('received message', { payload }) - const total_spent = 1 - const {owner, sender, chat, content, remote_content, msg_id, chat_type, sender_alias, msg_uuid, date_string, reply_uuid} = await helpers.parseReceiveParams(payload) + const {owner, sender, chat, content, remote_content, msg_id, chat_type, sender_alias, msg_uuid, date_string, reply_uuid, amount} = await helpers.parseReceiveParams(payload) if(!owner || !sender || !chat) { return console.log('=> no group chat!') } - const text = content + const text = content||'' var date = new Date(); date.setMilliseconds(0) @@ -222,9 +225,9 @@ export const receiveMessage = async (payload) => { chatId: chat.id, uuid: msg_uuid, type: constants.message_types.message, - asciiEncodedTotal: total_spent, sender: sender.id, date: date, + amount: amount||0, messageContent: text, createdAt: date, updatedAt: date, @@ -238,8 +241,6 @@ export const receiveMessage = async (payload) => { if(reply_uuid) msg.replyUuid = reply_uuid const message = await models.Message.create(msg) - // console.log('saved message', message.dataValues) - socket.sendJson({ type: 'message', response: jsonUtils.messageToJson(message, chat, sender) @@ -251,6 +252,45 @@ export const receiveMessage = async (payload) => { sendConfirmation({ chat:theChat, sender: owner, msg_id }) } +export const receiveBoost = async (payload) => { + console.log('received boost', { payload }) + + const {owner, sender, chat, content, remote_content, chat_type, sender_alias, msg_uuid, date_string, reply_uuid, amount} = await helpers.parseReceiveParams(payload) + if(!owner || !sender || !chat) { + return console.log('=> no group chat!') + } + const text = content + + var date = new Date(); + date.setMilliseconds(0) + if(date_string) date=new Date(date_string) + + const msg:{[k:string]:any} = { + chatId: chat.id, + uuid: msg_uuid, + type: constants.message_types.boost, + sender: sender.id, + date: date, + amount: amount||0, + messageContent: text, + createdAt: date, + updatedAt: date, + status: constants.statuses.received + } + const isTribe = chat_type===constants.chat_types.tribe + if(isTribe) { + msg.senderAlias = sender_alias + if(remote_content) msg.remoteMessageContent=remote_content + } + if(reply_uuid) msg.replyUuid = reply_uuid + const message = await models.Message.create(msg) + + socket.sendJson({ + type: 'boost', + response: jsonUtils.messageToJson(message, chat, sender) + }) +} + export const receiveDeleteMessage = async (payload) => { console.log('=> received delete message') const {owner, sender, chat, chat_type, msg_uuid} = await helpers.parseReceiveParams(payload) diff --git a/src/network/receive.ts b/src/network/receive.ts index 6ea0f38..c988a62 100644 --- a/src/network/receive.ts +++ b/src/network/receive.ts @@ -25,13 +25,13 @@ const msgtypes = constants.message_types export const typesToForward=[ msgtypes.message, msgtypes.group_join, msgtypes.group_leave, - msgtypes.attachment, msgtypes.delete, + msgtypes.attachment, msgtypes.delete, msgtypes.boost, ] const typesToModify=[ msgtypes.attachment ] const typesThatNeedPricePerMessage = [ - msgtypes.message, msgtypes.attachment + msgtypes.message, msgtypes.attachment, msgtypes.boost ] export const typesToReplay=[ // should match typesToForward msgtypes.message, @@ -121,6 +121,18 @@ async function onReceive(payload){ if(ogMsg) doAction = true } } + // forward boost sats to recipient + if(payload.type===msgtypes.boost && payload.message.replyUuid) { + const ogMsg = await models.Message.findOne({where:{ + uuid: payload.message.replyUuid, + }}) + if(ogMsg) { + const amtToForward = payload.message.amount - (chat.pricePerMessage||0) - (chat.escrowAmount||0) + if(amtToForward>0) { + forwardSatsToContact(chat,ogMsg.sender,amtToForward,payload.message.replyUuid) + } + } + } if(doAction) forwardMessageToTribe(payload, senderContact) else console.log('=> insufficient payment for this action') } @@ -152,7 +164,8 @@ async function onReceive(payload){ async function doTheAction(data){ let payload = data - if(payload.isTribeOwner) { + if(payload.isTribeOwner) { // this is only for storing locally, my own messages as tribe owner + // actual encryption for tribe happens in personalizeMessage const ogContent = data.message && data.message.content // const ogMediaKey = data.message && data.message.mediaKey /* decrypt and re-encrypt with phone's pubkey for storage */ @@ -170,6 +183,19 @@ async function doTheAction(data){ } } +async function forwardSatsToContact(chat,contactId:number,amount:number,theuuid) { + const owner = await models.Contact.findOne({where:{isOwner:true}}) + sendMessage({ + chat: {...chat.dataValues, contactIds:[contactId]}, + sender: owner, + type: constants.message_types.keysend, + amount: amount, + message: { content:'!' }, + success: ()=>{}, + failure: ()=>{} + }) +} + async function forwardMessageToTribe(ogpayload, sender){ // console.log('forwardMessageToTribe') const chat = await models.Chat.findOne({where:{uuid:ogpayload.chat.uuid}}) From fe548f174dd4b2f24e65ba300deae9be6f351f28 Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Thu, 19 Nov 2020 10:21:45 -0800 Subject: [PATCH 02/38] fix payment history query, dont print QR if already setup --- dist/src/controllers/payment.js | 24 +++++++++++++++--------- dist/src/controllers/payment.js.map | 2 +- dist/src/utils/nodeinfo.js | 1 + dist/src/utils/nodeinfo.js.map | 2 +- dist/src/utils/setup.js | 6 +++++- dist/src/utils/setup.js.map | 2 +- src/controllers/payment.ts | 24 +++++++++++++++--------- src/utils/nodeinfo.ts | 2 +- src/utils/setup.ts | 6 +++++- 9 files changed, 45 insertions(+), 24 deletions(-) diff --git a/dist/src/controllers/payment.js b/dist/src/controllers/payment.js index 23d1863..4ee77a0 100644 --- a/dist/src/controllers/payment.js +++ b/dist/src/controllers/payment.js @@ -156,15 +156,21 @@ exports.listPayments = (req, res) => __awaiter(void 0, void 0, void 0, function* try { const msgs = yield models_1.models.Message.findAll({ where: { - type: { [sequelize_1.Op.or]: [ - constants_1.default.message_types.message, - constants_1.default.message_types.payment, - constants_1.default.message_types.direct_payment, - constants_1.default.message_types.keysend, - ] }, - amount: { - [sequelize_1.Op.gt]: MIN_VAL // greater than - } + [sequelize_1.Op.or]: [ + { + type: { [sequelize_1.Op.or]: [ + constants_1.default.message_types.payment, + constants_1.default.message_types.direct_payment, + constants_1.default.message_types.keysend, + ] } + }, + { + type: constants_1.default.message_types.message, + amount: { + [sequelize_1.Op.gt]: MIN_VAL // greater than + } + } + ], }, order: [['createdAt', 'desc']], limit, diff --git a/dist/src/controllers/payment.js.map b/dist/src/controllers/payment.js.map index dfe06ac..99cc794 100644 --- a/dist/src/controllers/payment.js.map +++ b/dist/src/controllers/payment.js.map @@ -1 +1 @@ -{"version":3,"file":"payment.js","sourceRoot":"","sources":["../../../src/controllers/payment.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,gCAAyC;AACzC,0CAAyC;AACzC,2CAA0C;AAC1C,sCAAqC;AACrC,sCAA+C;AAC/C,wCAA4C;AAC5C,sCAAqC;AACrC,oCAAmC;AACnC,4CAAoC;AACpC,yCAA8B;AAC9B,iCAAuC;AAE1B,QAAA,WAAW,GAAG,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;IAC5C,MAAM,EACJ,MAAM,EACN,OAAO,EACP,UAAU,EACV,eAAe,EACf,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,WAAW,EACX,UAAU,EACV,eAAe,EACf,WAAW,EACX,UAAU,GACX,GAAG,GAAG,CAAC,IAAI,CAAA;IAEZ,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,GAAG,CAAC,IAAI,CAAC,CAAA;IAEvC,MAAM,KAAK,GAAG,MAAM,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAC,CAAC,CAAA;IAEvE,IAAI,eAAe,IAAI,CAAC,UAAU,IAAI,CAAC,OAAO,EAAE;QAC9C,uBAAgB,CAAC,KAAK,EA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AAA;IAEpE,MAAM,OAAO,GAAC,mBAAS,CAAC,cAAc,CAAA;IACtC,IAAI;QACF,MAAM,IAAI,GAAG,MAAM,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC;YACxC,KAAK,EAAC;gBACJ,IAAI,EAAE,EAAC,CAAC,cAAE,CAAC,EAAE,CAAC,EAAE;wBACd,mBAAS,CAAC,aAAa,CAAC,OAAO;wBAC/B,mBAAS,CAAC,aAAa,CAAC,OAAO;wBAC/B,mBAAS,CAAC,aAAa,CAAC,cAAc;wBACtC,mBAAS,CAAC,aAAa,CAAC,OAAO;qBAChC,EAAC;gBACF,MAAM,EAAE;oBACN,CAAC,cAAE,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,eAAe;iBACjC;aACF;YACD,KAAK,EAAE,CAAC,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;YAC9B,KAAK;YACL,MAAM;SACP,CAAC,CAAA;QACF,MAAM,GAAG,GAAG,IAAI,IAAE,EAAE,CAAA;QACpB,aAAO,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,OAAO,CAAA,EAAE,CAAC,SAAS,CAAC,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,CAAA;KACxE;IAAC,OAAM,CAAC,EAAE;QACT,aAAO,CAAC,GAAG,EAAE,oBAAoB,CAAC,CAAA;KACnC;AACH,CAAC,CAAA,CAAC"} \ No newline at end of file +{"version":3,"file":"payment.js","sourceRoot":"","sources":["../../../src/controllers/payment.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,gCAAyC;AACzC,0CAAyC;AACzC,2CAA0C;AAC1C,sCAAqC;AACrC,sCAA+C;AAC/C,wCAA4C;AAC5C,sCAAqC;AACrC,oCAAmC;AACnC,4CAAoC;AACpC,yCAA8B;AAC9B,iCAAuC;AAE1B,QAAA,WAAW,GAAG,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;IAC5C,MAAM,EACJ,MAAM,EACN,O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AS,CAAC,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,CAAA;KACxE;IAAC,OAAM,CAAC,EAAE;QACT,aAAO,CAAC,GAAG,EAAE,oBAAoB,CAAC,CAAA;KACnC;AACH,CAAC,CAAA,CAAC"} \ No newline at end of file diff --git a/dist/src/utils/nodeinfo.js b/dist/src/utils/nodeinfo.js index 9da1612..b35fd96 100644 --- a/dist/src/utils/nodeinfo.js +++ b/dist/src/utils/nodeinfo.js @@ -128,6 +128,7 @@ function isClean() { return false; }); } +exports.isClean = isClean; function latestMessage() { return __awaiter(this, void 0, void 0, function* () { const lasts = yield models_1.models.Message.findAll({ diff --git a/dist/src/utils/nodeinfo.js.map b/dist/src/utils/nodeinfo.js.map index 9208f68..d98ffb3 100644 --- a/dist/src/utils/nodeinfo.js.map +++ b/dist/src/utils/nodeinfo.js.map @@ -1 +1 @@ -{"version":3,"file":"nodeinfo.js","sourceRoot":"","sources":["../../../src/utils/nodeinfo.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,kDAAyD;AACzD,sCAAqC;AACrC,8CAA0D;AAC1D,sCAAgC;AAEhC,SAAS,QAAQ;IACf,OAAO,IAAI,OAAO,CAAC,CAAO,OAAO,EAAE,MAAM,EAAC,EAAE;QAE1C,IAAI,KAAK,CAAA;QACT,IAAI;YACF,KAAK,GAAG,MAAM,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAC,CAAC,CAAA;SAClE;QAAC,OAAM,CAAC,EAAC;YACR,OAAM,CAAC,mCAAmC;SAC3C;QACD,IAAG,CAAC,KAAK;YAAE,OAAM;QAEjB,IAAI,UAAU,GAAG,KAAK,CAAC,UAAU,CAAA;QACjC,IAAG,CAAC,UAAU,EAAE;YACd,UAAU,GAAG,IAAI,IAAI,EAAE,CAAA;SACxB;QAED,IAAI;YACF,MAAM,mBAAO,EAAE,CAAA;SAChB;QAAC,OAAM,CAAC,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C,OAAO,CAAC;YACzC,KAAK,EAAE,CAAC;YACR,KAAK,EAAE,CAAC,CAAE,WAAW,EAAE,MAAM,CAAE,CAAC;SACjC,CAAC,CAAA;QACF,MAAM,IAAI,GAAG,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,CAAA;QAC9B,IAAG,IAAI,EAAE;YACP,OAAO,IAAI,CAAC,SAAS,CAAA;SACtB;aAAM;YACL,OAAO,EAAE,CAAA;SACV;IACH,CAAC;CAAA"} \ No newline at end of file +{"version":3,"file":"nodeinfo.js","sourceRoot":"","sources":["../../../src/utils/nodeinfo.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,kDAAyD;AACzD,sCAAqC;AACrC,8CAA0D;AAC1D,sCAAgC;AAEhC,SAAS,QAAQ;IACf,OAAO,IAAI,OAAO,CAAC,CAAO,OAAO,EAAE,MAAM,EAAC,EAAE;QAE1C,IAAI,KAAK,CAAA;QACT,IAAI;YACF,KAAK,GAAG,MAAM,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAC,CAAC,CAAA;SAClE;QAAC,OAAM,CAAC,EAAC;YACR,OAAM,CAAC,mCAAmC;SAC3C;QACD,IAAG,CAAC,KAAK;YAAE,OAAM;QAEjB,IAAI,UAAU,GAAG,KAAK,CAAC,UAAU,CAAA;QACjC,IAAG,CAAC,UAAU,EAAE;YACd,UAAU,GAAG,IAAI,IAAI,EAAE,CAAA;SACxB;QAED,IAAI;YACF,MAAM,mBAAO,EAAE,CAAA;SAChB;QAAC,OAAM,CAAC,EAAE,EAAE,SAAS;YACpB,MAAM,IAAI,GAAG;gBACX,MAAM,EAAE,KAAK,CAAC,SAAS;gBACvB,aAAa,EAAE,IAAI;gBACnB,WAAW,EAAE,UAAU;aACxB,CAAA;YACD,OAAO,CAAC,IAAI,CAAC,CAAA;YACb,OAAM;SACP;QAED,IAAI,SAAS,GAAG,EAAE,CAAA;QAClB,IAAI;YACF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SAAS,CAAA;SACtB;aAAM;YACL,OAAO,EAAE,CAAA;SACV;IACH,CAAC;CAAA"} \ No newline at end of file diff --git a/dist/src/utils/setup.js b/dist/src/utils/setup.js index 8096860..8049ec9 100644 --- a/dist/src/utils/setup.js +++ b/dist/src/utils/setup.js @@ -18,6 +18,7 @@ const password_1 = require("../utils/password"); const path = require("path"); const gitinfo_1 = require("../utils/gitinfo"); const fs = require("fs"); +const nodeinfo_1 = require("./nodeinfo"); const env = process.env.NODE_ENV || 'development'; const config = require(path.join(__dirname, '../../config/app.json'))[env]; const USER_VERSION = 7; @@ -29,7 +30,7 @@ const setupDatabase = () => __awaiter(void 0, void 0, void 0, function* () { console.log("=> [db] done syncing"); } catch (e) { - console.log("db sync failed", e); + // console.log("db sync failed", e) } yield migrate(); setupOwnerContact(); @@ -203,6 +204,9 @@ function printGitInfo() { } function printQR() { return __awaiter(this, void 0, void 0, function* () { + const clean = yield nodeinfo_1.isClean(); + if (!clean) + return; // skip it if already setup! let public_ip; const public_url = config.public_url; if (public_url) diff --git a/dist/src/utils/setup.js.map b/dist/src/utils/setup.js.map index ebc24d5..abf1647 100644 --- a/dist/src/utils/setup.js.map +++ b/dist/src/utils/setup.js.map @@ -1 +1 @@ -{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../../src/utils/setup.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,2CAA2C;AAC3C,sCAA6C;AAC7C,iDAAoC;AACpC,iCAAgC;AAChC,sCAAqC;AACrC,gDAAwC;AACxC,6BAA4B;AAC5B,8CAA4D;AAC5D,yBAAyB;AAEzB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,uBAAuB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AAE1E,MAAM,YAAY,GAAG,CAAC,CAAA;AAEtB,MAAM,aAAa,GAAG,GA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QAClB,CAAC,CAAC,CAAA;IACJ,CAAC;CAAA;AAED,SAAS,oBAAoB,CAAC,GAAU;IACtC,EAAE,CAAC,SAAS,CAAC,uBAAuB,EAAE,GAAG,EAAE,UAAU,GAAG;QACtD,IAAI,GAAG;YAAE,OAAO,CAAC,GAAG,CAAC,qCAAqC,EAAE,GAAG,CAAC,CAAC;IACnE,CAAC,CAAC,CAAC;AACL,CAAC"} \ No newline at end of file diff --git a/src/controllers/payment.ts b/src/controllers/payment.ts index 6479a94..08d37e2 100644 --- a/src/controllers/payment.ts +++ b/src/controllers/payment.ts @@ -172,15 +172,21 @@ export const listPayments = async (req, res) => { try { const msgs = await models.Message.findAll({ where:{ - type: {[Op.or]: [ - constants.message_types.message, // for example /loopout message - constants.message_types.payment, - constants.message_types.direct_payment, - constants.message_types.keysend, - ]}, - amount: { - [Op.gt]: MIN_VAL // greater than - } + [Op.or]: [ + { + type: {[Op.or]: [ + constants.message_types.payment, + constants.message_types.direct_payment, + constants.message_types.keysend, + ]} + }, + { + type: constants.message_types.message, // for example /loopout message + amount: { + [Op.gt]: MIN_VAL // greater than + } + } + ], }, order: [['createdAt', 'desc']], limit, diff --git a/src/utils/nodeinfo.ts b/src/utils/nodeinfo.ts index 6edac91..e4a8e76 100644 --- a/src/utils/nodeinfo.ts +++ b/src/utils/nodeinfo.ts @@ -109,7 +109,7 @@ function nodeinfo(){ export {nodeinfo} -async function isClean(){ +export async function isClean(){ // has owner but with no auth token const cleanOwner = await models.Contact.findOne({ where: { isOwner: true, authToken: null }}) const msgs = await models.Message.count() diff --git a/src/utils/setup.ts b/src/utils/setup.ts index 7b5ee97..0a68484 100644 --- a/src/utils/setup.ts +++ b/src/utils/setup.ts @@ -7,6 +7,7 @@ import password from '../utils/password' import * as path from 'path' import { checkTag, checkCommitHash } from '../utils/gitinfo' import * as fs from 'fs'; +import {isClean} from './nodeinfo' const env = process.env.NODE_ENV || 'development'; const config = require(path.join(__dirname, '../../config/app.json'))[env] @@ -20,7 +21,7 @@ const setupDatabase = async () => { await sequelize.sync() console.log("=> [db] done syncing") } catch (e) { - console.log("db sync failed", e) + // console.log("db sync failed", e) } await migrate() setupOwnerContact() @@ -202,6 +203,9 @@ async function printGitInfo() { async function printQR() { + const clean = await isClean() + if(!clean) return // skip it if already setup! + let public_ip const public_url = config.public_url From f01723a0ea13432586da28480bb95d9eb89b80a3 Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Thu, 19 Nov 2020 10:33:35 -0800 Subject: [PATCH 03/38] dont forward boost sats to self --- dist/src/network/receive.js | 2 +- dist/src/network/receive.js.map | 2 +- src/network/receive.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/src/network/receive.js b/dist/src/network/receive.js index f26240c..cfe66bc 100644 --- a/dist/src/network/receive.js +++ b/dist/src/network/receive.js @@ -140,7 +140,7 @@ function onReceive(payload) { const ogMsg = yield models_1.models.Message.findOne({ where: { uuid: payload.message.replyUuid, } }); - if (ogMsg) { + if (ogMsg && ogMsg.sender && ogMsg.sender !== 1) { const amtToForward = payload.message.amount - (chat.pricePerMessage || 0) - (chat.escrowAmount || 0); if (amtToForward > 0) { forwardSatsToContact(chat, ogMsg.sender, amtToForward, payload.message.replyUuid); diff --git a/dist/src/network/receive.js.map b/dist/src/network/receive.js.map index 7428fc1..edbacdd 100644 --- a/dist/src/network/receive.js.map +++ b/dist/src/network/receive.js.map @@ -1 +1 @@ -{"version":3,"file":"receive.js","sourceRoot":"","sources":["../../../src/network/receive.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAqC;AACrC,kDAA0C;AAC1C,gDAAsC;AACtC,0CAAyC;AACzC,kDAA2D;AAC3D,0CAAyC;AACzC,sCAAkC;AAClC,iCAAkC;AAClC,qCAA8G;AAC9G,sCAAiE;AACjE,yCAA8B;AAC9B,0CAAyC;AACzC,0CAAyC;AACzC,gCAAyC;AACzC,4CAAoC;AACpC,2CAA0C;AAE1C;;;;EAIE;AAEF,MAAM,QAAQ,GA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AAE,CAAC,CAAC,MAAM,KAAG,QAAQ,CAAC,CAAC,CAAC,EAAC;QAClC,cAAc;QACd,MAAM,GAAG,GAAG,MAAM,CAAC,EAAE,CAAC,CAAA;QACtB,IAAI,OAAO,GAAG,EAAE,CAAA;QAChB,GAAG,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAC,CAAC,EAAC,EAAE,CAAA,CAAC,CAAC,CAAC,GAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAA,EAAE;YAC7C,OAAO,IAAI,GAAG,CAAC,CAAC,CAAA;QACjB,CAAC,CAAC,CAAA;QACF,OAAO,MAAM,CAAC,EAAE,CAAC,CAAA;QACjB,OAAO,OAAO,CAAA;KACd;AACF,CAAC"} \ No newline at end of file diff --git a/src/network/receive.ts b/src/network/receive.ts index c988a62..031f0b1 100644 --- a/src/network/receive.ts +++ b/src/network/receive.ts @@ -126,7 +126,7 @@ async function onReceive(payload){ const ogMsg = await models.Message.findOne({where:{ uuid: payload.message.replyUuid, }}) - if(ogMsg) { + if(ogMsg && ogMsg.sender && ogMsg.sender!==1) { const amtToForward = payload.message.amount - (chat.pricePerMessage||0) - (chat.escrowAmount||0) if(amtToForward>0) { forwardSatsToContact(chat,ogMsg.sender,amtToForward,payload.message.replyUuid) From 9f01d46d3780c7dbf773953e2b23611b3e747825 Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Thu, 19 Nov 2020 10:36:00 -0800 Subject: [PATCH 04/38] cleanup --- dist/src/network/receive.js | 5 +++-- dist/src/network/receive.js.map | 2 +- src/network/receive.ts | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/dist/src/network/receive.js b/dist/src/network/receive.js index cfe66bc..7d30e4c 100644 --- a/dist/src/network/receive.js +++ b/dist/src/network/receive.js @@ -143,7 +143,7 @@ function onReceive(payload) { if (ogMsg && ogMsg.sender && ogMsg.sender !== 1) { const amtToForward = payload.message.amount - (chat.pricePerMessage || 0) - (chat.escrowAmount || 0); if (amtToForward > 0) { - forwardSatsToContact(chat, ogMsg.sender, amtToForward, payload.message.replyUuid); + forwardSatsToContact(chat, ogMsg.sender, amtToForward); } } } @@ -203,8 +203,9 @@ function doTheAction(data) { } }); } -function forwardSatsToContact(chat, contactId, amount, theuuid) { +function forwardSatsToContact(chat, contactId, amount) { return __awaiter(this, void 0, void 0, function* () { + console.log('=> forwardSatsToContact', contactId); const owner = yield models_1.models.Contact.findOne({ where: { isOwner: true } }); send_1.sendMessage({ chat: Object.assign(Object.assign({}, chat.dataValues), { contactIds: [contactId] }), diff --git a/dist/src/network/receive.js.map b/dist/src/network/receive.js.map index edbacdd..a63cbbc 100644 --- a/dist/src/network/receive.js.map +++ b/dist/src/network/receive.js.map @@ -1 +1 @@ -{"version":3,"file":"receive.js","sourceRoot":"","sources":["../../../src/network/receive.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAqC;AACrC,kDAA0C;AAC1C,gDAAsC;AACtC,0CAAyC;AACzC,kDAA2D;AAC3D,0CAAyC;AACzC,sCAAkC;AAClC,iCAAkC;AAClC,qCAA8G;AAC9G,sCAAiE;AACjE,yCAA8B;AAC9B,0CAAyC;AACzC,0CAAyC;AACzC,gCAAyC;AACzC,4CAAoC;AACpC,2CAA0C;AAE1C;;;;EAIE;AAEF,MAAM,QAAQ,GAAG,mBAAS,CAAC,aAAa,CAAA;AAE3B,QAAA,cAAc,GAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,WAAW;IAC3D,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,KAAK;CACpD,CAAA;AACD,MAAM,aAAa,GAAC;IACnB,QAAQ,CAAC,UAAU;CACnB,CAAA;AACD,MAAM,4BAA4B,GAAG;IACpC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,KAAK;CACrD,CAA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,GAAG,CAAA,EAAE;YAC7C,OAAO,IAAI,GAAG,CAAC,CAAC,CAAA;QACjB,CAAC,CAAC,CAAA;QACF,OAAO,MAAM,CAAC,EAAE,CAAC,CAAA;QACjB,OAAO,OAAO,CAAA;KACd;AACF,CAAC"} \ No newline at end of file diff --git a/src/network/receive.ts b/src/network/receive.ts index 031f0b1..69f70c8 100644 --- a/src/network/receive.ts +++ b/src/network/receive.ts @@ -129,7 +129,7 @@ async function onReceive(payload){ if(ogMsg && ogMsg.sender && ogMsg.sender!==1) { const amtToForward = payload.message.amount - (chat.pricePerMessage||0) - (chat.escrowAmount||0) if(amtToForward>0) { - forwardSatsToContact(chat,ogMsg.sender,amtToForward,payload.message.replyUuid) + forwardSatsToContact(chat,ogMsg.sender,amtToForward) } } } @@ -183,7 +183,8 @@ async function doTheAction(data){ } } -async function forwardSatsToContact(chat,contactId:number,amount:number,theuuid) { +async function forwardSatsToContact(chat,contactId:number,amount:number) { + console.log('=> forwardSatsToContact',contactId) const owner = await models.Contact.findOne({where:{isOwner:true}}) sendMessage({ chat: {...chat.dataValues, contactIds:[contactId]}, From 786be60fe5dffb8c047c9517d1514ea5a4d7530f Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Thu, 19 Nov 2020 10:54:27 -0800 Subject: [PATCH 05/38] log --- dist/src/network/receive.js | 3 +++ dist/src/network/receive.js.map | 2 +- src/network/receive.ts | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/dist/src/network/receive.js b/dist/src/network/receive.js index 7d30e4c..d6b36df 100644 --- a/dist/src/network/receive.js +++ b/dist/src/network/receive.js @@ -137,10 +137,13 @@ function onReceive(payload) { } // forward boost sats to recipient if (payload.type === msgtypes.boost && payload.message.replyUuid) { + console.log('===> OK!!!!!'); const ogMsg = yield models_1.models.Message.findOne({ where: { uuid: payload.message.replyUuid, } }); + console.log('===> ogmsg!!!!!', ogMsg && ogMsg.dataValues); if (ogMsg && ogMsg.sender && ogMsg.sender !== 1) { + console.log('===> asdfasdfasdfamt!!!!!', payload.message.amount - (chat.pricePerMessage || 0) - (chat.escrowAmount || 0)); const amtToForward = payload.message.amount - (chat.pricePerMessage || 0) - (chat.escrowAmount || 0); if (amtToForward > 0) { forwardSatsToContact(chat, ogMsg.sender, amtToForward); diff --git a/dist/src/network/receive.js.map b/dist/src/network/receive.js.map index a63cbbc..dad1dbd 100644 --- a/dist/src/network/receive.js.map +++ b/dist/src/network/receive.js.map @@ -1 +1 @@ -{"version":3,"file":"receive.js","sourceRoot":"","sources":["../../../src/network/receive.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAqC;AACrC,kDAA0C;AAC1C,gDAAsC;AACtC,0CAAyC;AACzC,kDAA2D;AAC3D,0CAAyC;AACzC,sCAAkC;AAClC,iCAAkC;AAClC,qCAA8G;AAC9G,sCAAiE;AACjE,yCAA8B;AAC9B,0CAAyC;AACzC,0CAAyC;AACzC,gCAAyC;AACzC,4CAAoC;AACpC,2CAA0C;AAE1C;;;;EAIE;AAEF,MAAM,QAAQ,GAAG,mBAAS,CAAC,aAAa,CAAA;AAE3B,QAAA,cAAc,GAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,WAAW;IAC3D,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,KAAK;CACpD,CAAA;AACD,MAAM,aAAa,GAAC;IACnB,QAAQ,CAAC,UAAU;CACnB,CAAA;AACD,MAAM,4BAA4B,GAAG;IACpC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,KAAK;CACrD,CAAA;AACY,QAAA,aAAa,GAAC;IAC1B,QAAQ,CAAC,OAAO;IAChB,QAAQ,CAAC,UAAU;IACnB,QAAQ,CAAC,WAAW;IACpB,QAAQ,CAAC,OAAO;CAChB,CAAA;AACD,MAAM,QAAQ,GAAC;IACd,mBAAS,CAAC,aAAa,CAAC,W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AAI,GAAG,CAAC,CAAC,CAAA;QACjB,CAAC,CAAC,CAAA;QACF,OAAO,MAAM,CAAC,EAAE,CAAC,CAAA;QACjB,OAAO,OAAO,CAAA;KACd;AACF,CAAC"} \ No newline at end of file +{"version":3,"file":"receive.js","sourceRoot":"","sources":["../../../src/network/receive.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAqC;AACrC,kDAA0C;AAC1C,gDAAsC;AACtC,0CAAyC;AACzC,kDAA2D;AAC3D,0CAAyC;AACzC,sCAAkC;AAClC,iCAAkC;AAClC,qCAA8G;AAC9G,sCAAiE;AACjE,yCAA8B;AAC9B,0CAAyC;AACzC,0CAAyC;AACzC,gCAAyC;AACzC,4CAAoC;AACpC,2CAA0C;AAE1C;;;;EAIE;AAEF,MAAM,QAAQ,GAAG,mBAAS,CAAC,aAAa,CAAA;AAE3B,QAAA,cAAc,GAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,WAAW;IAC3D,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,KAAK;CACpD,CAAA;AACD,MAAM,aAAa,GAAC;IACnB,QAAQ,CAAC,UAAU;CACnB,CAAA;AACD,MAAM,4BAA4B,GAAG;IACpC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,KAAK;CACrD,CAAA;AACY,QAAA,aAAa,GAAC;IAC1B,QAAQ,CAAC,OAAO;IAChB,QAAQ,CAAC,UAAU;IACnB,QAAQ,CAAC,WAAW;IACpB,QAAQ,CAAC,OAAO;CAChB,CAAA;AACD,MAAM,QAAQ,GAAC;IACd,mBAAS,CAAC,aAAa,CAAC,WAAW;IACnC,mBAAS,CAAC,aAAa,CAAC,OAAO;IAC/B,mBAAS,CAAC,aAAa,CAAC,OAAO;CAC/B,CAAA;AACD,MAAM,aAAa,GAAC;IACnB,mBAAS,CAAC,aAAa,CAAC,W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C,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAC,CAAC,EAAC,EAAE,CAAA,CAAC,CAAC,CAAC,GAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAA,EAAE;YAC7C,OAAO,IAAI,GAAG,CAAC,CAAC,CAAA;QACjB,CAAC,CAAC,CAAA;QACF,OAAO,MAAM,CAAC,EAAE,CAAC,CAAA;QACjB,OAAO,OAAO,CAAA;KACd;AACF,CAAC"} \ No newline at end of file diff --git a/src/network/receive.ts b/src/network/receive.ts index 69f70c8..6f0233c 100644 --- a/src/network/receive.ts +++ b/src/network/receive.ts @@ -123,10 +123,13 @@ async function onReceive(payload){ } // forward boost sats to recipient if(payload.type===msgtypes.boost && payload.message.replyUuid) { + console.log('===> OK!!!!!') const ogMsg = await models.Message.findOne({where:{ uuid: payload.message.replyUuid, }}) + console.log('===> ogmsg!!!!!',ogMsg&&ogMsg.dataValues) if(ogMsg && ogMsg.sender && ogMsg.sender!==1) { + console.log('===> asdfasdfasdfamt!!!!!',payload.message.amount - (chat.pricePerMessage||0) - (chat.escrowAmount||0)) const amtToForward = payload.message.amount - (chat.pricePerMessage||0) - (chat.escrowAmount||0) if(amtToForward>0) { forwardSatsToContact(chat,ogMsg.sender,amtToForward) From ebe32a4b44d5117f3bdc0dc07688c649040b54d6 Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Thu, 19 Nov 2020 11:11:52 -0800 Subject: [PATCH 06/38] force not mqtt for the boost forward --- dist/src/network/send.js | 4 +++- dist/src/network/send.js.map | 2 +- src/network/send.ts | 5 ++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/dist/src/network/send.js b/dist/src/network/send.js index d6410b0..3dadfb3 100644 --- a/dist/src/network/send.js +++ b/dist/src/network/send.js @@ -88,7 +88,9 @@ function sendMessage(params) { console.log('-> sending to ', contact.id, destkey); let mqttTopic = networkType === 'mqtt' ? `${destkey}/${chatUUID}` : ''; // sending a payment to one subscriber, buying a pic from OG poster - if (isTribeOwner && contactIds.length === 1 && amount && amount > constants_1.default.min_sat_amount && msg.type === constants_1.default.message_types.purchase) { + // or keysend such as forwarding boost to og poster + if (isTribeOwner && contactIds.length === 1 && amount && amount > constants_1.default.min_sat_amount && + (msg.type === constants_1.default.message_types.purchase || msg.type === constants_1.default.message_types.keysend)) { mqttTopic = ''; // FORCE KEYSEND!!! } const m = yield msg_1.personalizeMessage(msg, contact, isTribeOwner); diff --git a/dist/src/network/send.js.map b/dist/src/network/send.js.map index 99181c7..55aa68e 100644 --- a/dist/src/network/send.js.map +++ b/dist/src/network/send.js.map @@ -1 +1 @@ -{"version":3,"file":"send.js","sourceRoot":"","sources":["../../../src/network/send.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAkC;AAClC,0CAAyC;AACzC,0CAAyC;AACzC,sCAA+D;AAC/D,0CAAyC;AACzC,gEAAuE;AACvE,uCAAwC;AACxC,yCAAwC;AACxC,4CAAoC;AAIpC,SAAsB,WAAW,CAAC,MAAM;;QACvC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,MAAM,CAAA;QACjG,IAAG,CAAC,IAAI,IAAI,CAAC,MAAM;YAAE,OAAM;QAE3B,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,KAAG,mBAAS,CAAC,UAAU,CAAC,KAAK,CAAA;QACtD,IAAI,YAAY,GAAG,OAAO,IAAI,MAAM,CAAC,SAAS,KAAG,IAAI,CAAC,WAAW,CAAA;QAEjE,IAAI,SAAS,GAAG,CAAC,MAAM,CAAC,UAAU,IAAE,MAAM,CAAC,CAAA;QAC3C,IAAG,YAAY,IAAI,CAAC,WAAW,EAAE;YAChC,SAAS,mCAAO,CAAC,MAAM,CAAC,UAAU,IAAE,MAAM,CAAC,KAAE,IAAI,EAAC,mBAAS,CAAC,UAAU,CAAC,KA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AK,EAAE,KAAK,CAAC,CAAC;SAC7C;IACF,CAAC;CAAA;AACD,SAAe,KAAK,CAAC,EAAE;;QACtB,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAA;IACvD,CAAC;CAAA;AAED,oCAAoC;AACpC,iGAAiG;AACjG,IAAI;AACJ,oCAAoC;AACpC,yFAAyF;AACzF,IAAI"} \ No newline at end of file +{"version":3,"file":"send.js","sourceRoot":"","sources":["../../../src/network/send.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAkC;AAClC,0CAAyC;AACzC,0CAAyC;AACzC,sCAA+D;AAC/D,0CAAyC;AACzC,gEAAuE;AACvE,uCAAwC;AACxC,yCAAwC;AACxC,4CAAoC;AAIpC,SAAsB,WAAW,CAAC,MAAM;;QACvC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,MAAM,CAAA;QACjG,IAAG,CAAC,IAAI,IAAI,CAAC,MAAM;YAAE,OAAM;QAE3B,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,KAAG,mBAAS,CAAC,UAAU,CAAC,KAAK,CAAA;QACtD,IAAI,YAAY,GAAG,OAAO,IAAI,MAAM,CAAC,SAAS,KAAG,IAAI,CAAC,WAAW,CAAA;QAEjE,IAAI,SAAS,GAAG,CAAC,MAAM,CAAC,UAAU,IAAE,MAAM,CAAC,CAAA;QAC3C,IAAG,YAAY,IAAI,CAAC,WAAW,EAAE;YAChC,SAAS,mCAAO,CAAC,MAAM,CAAC,UAAU,IAAE,MAAM,CAAC,KAAE,IAAI,EAAC,mBAAS,CAAC,UAAU,CAAC,KAAK,GAAC,CAAA;SAC7E;QACD,IAAI,GAAG,GAAG,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC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,CAAC,CAAC;SAC7C;IACF,CAAC;CAAA;AACD,SAAe,KAAK,CAAC,EAAE;;QACtB,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAA;IACvD,CAAC;CAAA;AAED,oCAAoC;AACpC,iGAAiG;AACjG,IAAI;AACJ,oCAAoC;AACpC,yFAAyF;AACzF,IAAI"} \ No newline at end of file diff --git a/src/network/send.ts b/src/network/send.ts index 71875e5..f02f890 100644 --- a/src/network/send.ts +++ b/src/network/send.ts @@ -85,7 +85,10 @@ export async function sendMessage(params) { let mqttTopic = networkType==='mqtt' ? `${destkey}/${chatUUID}` : '' // sending a payment to one subscriber, buying a pic from OG poster - if(isTribeOwner && contactIds.length===1 && amount && amount>constants.min_sat_amount && msg.type===constants.message_types.purchase) { + // or keysend such as forwarding boost to og poster + if(isTribeOwner && contactIds.length===1 && amount && amount>constants.min_sat_amount && + (msg.type===constants.message_types.purchase || msg.type===constants.message_types.keysend) + ) { mqttTopic = '' // FORCE KEYSEND!!! } From ceab2be95026f12d74dbb1d79b427464143066af Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Thu, 19 Nov 2020 11:14:04 -0800 Subject: [PATCH 07/38] working, cleanup --- dist/src/network/receive.js | 3 --- dist/src/network/receive.js.map | 2 +- src/network/receive.ts | 3 --- 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/dist/src/network/receive.js b/dist/src/network/receive.js index d6b36df..7d30e4c 100644 --- a/dist/src/network/receive.js +++ b/dist/src/network/receive.js @@ -137,13 +137,10 @@ function onReceive(payload) { } // forward boost sats to recipient if (payload.type === msgtypes.boost && payload.message.replyUuid) { - console.log('===> OK!!!!!'); const ogMsg = yield models_1.models.Message.findOne({ where: { uuid: payload.message.replyUuid, } }); - console.log('===> ogmsg!!!!!', ogMsg && ogMsg.dataValues); if (ogMsg && ogMsg.sender && ogMsg.sender !== 1) { - console.log('===> asdfasdfasdfamt!!!!!', payload.message.amount - (chat.pricePerMessage || 0) - (chat.escrowAmount || 0)); const amtToForward = payload.message.amount - (chat.pricePerMessage || 0) - (chat.escrowAmount || 0); if (amtToForward > 0) { forwardSatsToContact(chat, ogMsg.sender, amtToForward); diff --git a/dist/src/network/receive.js.map b/dist/src/network/receive.js.map index dad1dbd..a63cbbc 100644 --- a/dist/src/network/receive.js.map +++ b/dist/src/network/receive.js.map @@ -1 +1 @@ -{"version":3,"file":"receive.js","sourceRoot":"","sources":["../../../src/network/receive.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAqC;AACrC,kDAA0C;AAC1C,gDAAsC;AACtC,0CAAyC;AACzC,kDAA2D;AAC3D,0CAAyC;AACzC,sCAAkC;AAClC,iCAAkC;AAClC,qCAA8G;AAC9G,sCAAiE;AACjE,yCAA8B;AAC9B,0CAAyC;AACzC,0CAAyC;AACzC,gCAAyC;AACzC,4CAAoC;AACpC,2CAA0C;AAE1C;;;;EAIE;AAEF,MAAM,QAAQ,GAAG,mBAAS,CAAC,aAAa,CAAA;AAE3B,QAAA,cAAc,GAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,WAAW;IAC3D,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,KAAK;CACpD,CAAA;AACD,MAAM,aAAa,GAAC;IACnB,QAAQ,CAAC,UAAU;CACnB,CAAA;AACD,MAAM,4BAA4B,GAAG;IACpC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,KAAK;CACrD,CAAA;AACY,QAAA,aAAa,GAAC;IAC1B,QAAQ,CAAC,OAAO;IAChB,QAAQ,CAAC,UAAU;IACnB,QAAQ,CAAC,WAAW;IACpB,QAAQ,CAAC,OAAO;CAChB,CAAA;AACD,MAAM,QAAQ,GAAC;IACd,mBAAS,CAAC,aAAa,CAAC,WAAW;IACnC,mBAAS,C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,IAAI,CAAC,CAAC,CAAC,EAAC,CAAC,EAAC,EAAE,CAAA,CAAC,CAAC,CAAC,GAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAA,EAAE;YAC7C,OAAO,IAAI,GAAG,CAAC,CAAC,CAAA;QACjB,CAAC,CAAC,CAAA;QACF,OAAO,MAAM,CAAC,EAAE,CAAC,CAAA;QACjB,OAAO,OAAO,CAAA;KACd;AACF,CAAC"} \ No newline at end of file diff --git a/src/network/receive.ts b/src/network/receive.ts index 6f0233c..69f70c8 100644 --- a/src/network/receive.ts +++ b/src/network/receive.ts @@ -123,13 +123,10 @@ async function onReceive(payload){ } // forward boost sats to recipient if(payload.type===msgtypes.boost && payload.message.replyUuid) { - console.log('===> OK!!!!!') const ogMsg = await models.Message.findOne({where:{ uuid: payload.message.replyUuid, }}) - console.log('===> ogmsg!!!!!',ogMsg&&ogMsg.dataValues) if(ogMsg && ogMsg.sender && ogMsg.sender!==1) { - console.log('===> asdfasdfasdfamt!!!!!',payload.message.amount - (chat.pricePerMessage||0) - (chat.escrowAmount||0)) const amtToForward = payload.message.amount - (chat.pricePerMessage||0) - (chat.escrowAmount||0) if(amtToForward>0) { forwardSatsToContact(chat,ogMsg.sender,amtToForward) From 312b5243394039f75eae3a7582b19690c8c4763d Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Thu, 19 Nov 2020 13:46:52 -0800 Subject: [PATCH 08/38] dont inc msg type in history, parse sender_pubkey for keysend type if you have the contact --- dist/src/controllers/messages.js | 8 ++++---- dist/src/controllers/messages.js.map | 2 +- dist/src/controllers/payment.js | 8 +------- dist/src/controllers/payment.js.map | 2 +- dist/src/network/receive.js | 23 ++++++++++++++++------- dist/src/network/receive.js.map | 2 +- dist/src/utils/setup.js | 10 +++++----- dist/src/utils/setup.js.map | 2 +- src/controllers/messages.ts | 8 ++++---- src/controllers/payment.ts | 14 +++++++------- src/network/receive.ts | 23 ++++++++++++++++------- src/utils/setup.ts | 11 ++++++----- 12 files changed, 63 insertions(+), 50 deletions(-) diff --git a/dist/src/controllers/messages.js b/dist/src/controllers/messages.js index 6dd0caf..a607964 100644 --- a/dist/src/controllers/messages.js +++ b/dist/src/controllers/messages.js @@ -187,7 +187,7 @@ exports.sendMessage = (req, res) => __awaiter(void 0, void 0, void 0, function* }); exports.receiveMessage = (payload) => __awaiter(void 0, void 0, void 0, function* () { // console.log('received message', { payload }) - const { owner, sender, chat, content, remote_content, msg_id, chat_type, sender_alias, msg_uuid, date_string, reply_uuid, amount } = yield helpers.parseReceiveParams(payload); + const { owner, sender, chat, content, remote_content, msg_id, chat_type, sender_alias, msg_uuid, date_string, reply_uuid } = yield helpers.parseReceiveParams(payload); if (!owner || !sender || !chat) { return console.log('=> no group chat!'); } @@ -202,7 +202,7 @@ exports.receiveMessage = (payload) => __awaiter(void 0, void 0, void 0, function type: constants_1.default.message_types.message, sender: sender.id, date: date, - amount: amount || 0, + // amount: amount||0, messageContent: text, createdAt: date, updatedAt: date, @@ -227,7 +227,7 @@ exports.receiveMessage = (payload) => __awaiter(void 0, void 0, void 0, function }); exports.receiveBoost = (payload) => __awaiter(void 0, void 0, void 0, function* () { console.log('received boost', { payload }); - const { owner, sender, chat, content, remote_content, chat_type, sender_alias, msg_uuid, date_string, reply_uuid, amount } = yield helpers.parseReceiveParams(payload); + const { owner, sender, chat, content, remote_content, chat_type, sender_alias, msg_uuid, date_string, reply_uuid } = yield helpers.parseReceiveParams(payload); if (!owner || !sender || !chat) { return console.log('=> no group chat!'); } @@ -242,7 +242,7 @@ exports.receiveBoost = (payload) => __awaiter(void 0, void 0, void 0, function* type: constants_1.default.message_types.boost, sender: sender.id, date: date, - amount: amount || 0, + // amount: amount||0, messageContent: text, createdAt: date, updatedAt: date, diff --git a/dist/src/controllers/messages.js.map b/dist/src/controllers/messages.js.map index dc69a3a..984c199 100644 --- a/dist/src/controllers/messages.js.map +++ b/dist/src/controllers/messages.js.map @@ -1 +1 @@ -{"version":3,"file":"messages.js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,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;QAChB,sBAAgB,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;QACnC,MAAM,CAAC,QAAQ,CAAC;YACf,IAAI,EAAE,WAAW;YACjB,QAAQ,EAAE,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC;SACpC,CAAC,CAAA;KACF;SAAM;QACN,aAAO,CAAC,GAAG,EAAE,SAAS,CAAC,CAAA;KACvB;AACF,CAAC,CAAA,CAAA;AAEY,QAAA,aAAa,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IACzC,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;IAErD,aAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;AACjB,CAAC,CAAA"} \ No newline at end of file +{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/controllers/messages.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,yCAA8B;AAC9B,2CAAoC;AACpC,gCAAyC;AACzC,0CAAyC;AACzC,2CAA0C;AAC1C,sCAAqC;AACrC,sCAA+C;AAC/C,0CAAyC;AACzC,mDAAgD;AAChD,sCAAqC;AACrC,oCAAmC;AACnC,4CAAoC;AAEvB,QAAA,WAAW,GAAG,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;IAC7C,MAAM,YAAY,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;IAEpC,IAAI,CAAC,YAAY,EAAE;QAClB,OAAO,sBAAc,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;KAC/B;IACD,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;IACzB,MAAM,KAAK,GAAG,MAAM,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,CAAA;IACx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,EAAE,IAAI,EAAE,EAAC,CAAC,CAAA;IAEvE,MAAM,eAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;QAC3C,KAAK,EAAE;YACL,MAAM,EAAE;gBACT,CAAC,cAAE,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE;aACf;YACD,MAAM,EAAE,OAAO;SAChB;KACD,CAAC,CAAC;IACH,MAAM,IAAI,GAAG,MAAM,eAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,CAAA;IAClE,IAAG,IAAI,EAAE;QACR,MAAM,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAClC,aAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;QAChB,sBAAgB,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;QACnC,MAAM,CAAC,QAAQ,CAAC;YACf,IAAI,EAAE,WAAW;YACjB,QAAQ,EAAE,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC;SACpC,CAAC,CAAA;KACF;SAAM;QACN,aAAO,CAAC,GAAG,EAAE,SAAS,CAAC,CAAA;KACvB;AACF,CAAC,CAAA,CAAA;AAEY,QAAA,aAAa,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IACzC,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;IAErD,aAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;AACjB,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/src/controllers/payment.js b/dist/src/controllers/payment.js index 4ee77a0..a6620c4 100644 --- a/dist/src/controllers/payment.js +++ b/dist/src/controllers/payment.js @@ -152,7 +152,7 @@ exports.receivePayment = (payload) => __awaiter(void 0, void 0, void 0, function exports.listPayments = (req, res) => __awaiter(void 0, void 0, void 0, function* () { const limit = (req.query.limit && parseInt(req.query.limit)) || 100; const offset = (req.query.offset && parseInt(req.query.offset)) || 0; - const MIN_VAL = constants_1.default.min_sat_amount; + // const MIN_VAL=constants.min_sat_amount try { const msgs = yield models_1.models.Message.findAll({ where: { @@ -164,12 +164,6 @@ exports.listPayments = (req, res) => __awaiter(void 0, void 0, void 0, function* constants_1.default.message_types.keysend, ] } }, - { - type: constants_1.default.message_types.message, - amount: { - [sequelize_1.Op.gt]: MIN_VAL // greater than - } - } ], }, order: [['createdAt', 'desc']], diff --git a/dist/src/controllers/payment.js.map b/dist/src/controllers/payment.js.map index 99cc794..9c4bbb7 100644 --- a/dist/src/controllers/payment.js.map +++ b/dist/src/controllers/payment.js.map @@ -1 +1 @@ -{"version":3,"file":"payment.js","sourceRoot":"","sources":["../../../src/controllers/payment.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,gCAAyC;AACzC,0CAAyC;AACzC,2CAA0C;AAC1C,sCAAqC;AACrC,sCAA+C;AAC/C,wCAA4C;AAC5C,sCAAqC;AACrC,oCAAmC;AACnC,4CAAoC;AACpC,yCAA8B;AAC9B,iCAAuC;AAE1B,QAAA,WAAW,GAAG,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;IAC5C,MAAM,EACJ,MAAM,EACN,OAAO,EACP,UAAU,EACV,eAAe,EACf,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,WAAW,EACX,UAAU,EACV,eAAe,EACf,WAAW,EACX,UAAU,GACX,GAAG,GAAG,CAAC,IAAI,CAAA;IAEZ,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,GAAG,CAAC,IAAI,CAAC,CAAA;IAEvC,MAAM,KAAK,GAAG,MAAM,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAC,CAAC,CAAA;IAEvE,IAAI,eA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,IAAI,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAA;IAEpE,MAAM,OAAO,GAAC,mBAAS,CAAC,cAAc,CAAA;IACtC,IAAI;QACF,MAAM,IAAI,GAAG,MAAM,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC;YACxC,KAAK,EAAC;gBACJ,CAAC,cAAE,CAAC,EAAE,CAAC,EAAE;oBACP;wBACE,IAAI,EAAE,EAAC,CAAC,cAAE,CAAC,EAAE,CAAC,EAAE;gCACd,mBAAS,CAAC,aAAa,CAAC,OAAO;gCAC/B,mBAAS,CAAC,aAAa,CAAC,cAAc;gCACtC,mBAAS,CAAC,aAAa,CAAC,OAAO;6BAChC,EAAC;qBACH;oBACD;wBACE,IAAI,EAAE,mBAAS,CAAC,aAAa,CAAC,OAAO;wBACrC,MAAM,EAAE;4BACN,CAAC,cAAE,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,eAAe;yBACjC;qBACF;iBACF;aACF;YACD,KAAK,EAAE,CAAC,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;YAC9B,KAAK;YACL,MAAM;SACP,CAAC,CAAA;QACF,MAAM,GAAG,GAAG,IAAI,IAAE,EAAE,CAAA;QACpB,aAAO,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,OAAO,CAAA,EAAE,CAAC,SAAS,CAAC,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,CAAA;KACxE;IAAC,OAAM,CAAC,EAAE;QACT,aAAO,CAAC,GAAG,EAAE,oBAAoB,CAAC,CAAA;KACnC;AACH,CAAC,CAAA,CAAC"} \ No newline at end of file +{"version":3,"file":"payment.js","sourceRoot":"","sources":["../../../src/controllers/payment.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,gCAAyC;AACzC,0CAAyC;AACzC,2CAA0C;AAC1C,sCAAqC;AACrC,sCAA+C;AAC/C,wCAA4C;AAC5C,s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AAO,EAAE,IAAI,CAAC,CAAC,CAAC,CAAA;KACxE;IAAC,OAAM,CAAC,EAAE;QACT,aAAO,CAAC,GAAG,EAAE,oBAAoB,CAAC,CAAA;KACnC;AACH,CAAC,CAAA,CAAC"} \ No newline at end of file diff --git a/dist/src/network/receive.js b/dist/src/network/receive.js index 7d30e4c..52ac46b 100644 --- a/dist/src/network/receive.js +++ b/dist/src/network/receive.js @@ -316,14 +316,21 @@ function parseAndVerifyPayload(data) { } }); } -function saveAnonymousKeysend(response, memo) { +function saveAnonymousKeysend(response, memo, sender_pubkey) { return __awaiter(this, void 0, void 0, function* () { + let sender = 0; + if (sender_pubkey) { + const theSender = yield models_1.models.Contact.findOne({ where: { publicKey: sender_pubkey } }); + if (theSender && theSender.id) { + sender = theSender.id; + } + } let settleDate = parseInt(response['settle_date'] + '000'); const amount = response['amt_paid_sat'] || 0; const msg = yield models_1.models.Message.create({ chatId: 0, type: constants_1.default.message_types.keysend, - sender: 0, + sender, amount, amountMsat: response['amt_paid_msat'], paymentHash: '', @@ -347,26 +354,28 @@ function parseKeysendInvoice(i) { const value = i && i.value && parseInt(i.value); // "keysend" type is NOT encrypted // and should be saved even if there is NO content - let isAnonymous = false; + let isKeysendType = false; let memo = ''; + let sender_pubkey; if (data) { try { const payload = parsePayload(data); if (payload && payload.type === constants_1.default.message_types.keysend) { - isAnonymous = true; + isKeysendType = true; memo = payload.message && payload.message.content; + sender_pubkey = payload.sender && payload.sender.pub_key; } } catch (e) { } // err could be a threaded TLV } else { - isAnonymous = true; + isKeysendType = true; } - if (isAnonymous) { + if (isKeysendType) { if (!memo) { hub_1.sendNotification(-1, '', 'keysend', value || 0); } - saveAnonymousKeysend(i, memo); + saveAnonymousKeysend(i, memo, sender_pubkey); return; } let payload; diff --git a/dist/src/network/receive.js.map b/dist/src/network/receive.js.map index a63cbbc..c458539 100644 --- a/dist/src/network/receive.js.map +++ b/dist/src/network/receive.js.map @@ -1 +1 @@ -{"version":3,"file":"receive.js","sourceRo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AAO,MAAM,CAAC,EAAE,CAAC,CAAA;QACjB,OAAO,OAAO,CAAA;KACd;AACF,CAAC"} \ No newline at end of file diff --git a/dist/src/utils/setup.js b/dist/src/utils/setup.js index 8049ec9..682aa3c 100644 --- a/dist/src/utils/setup.js +++ b/dist/src/utils/setup.js @@ -204,9 +204,6 @@ function printGitInfo() { } function printQR() { return __awaiter(this, void 0, void 0, function* () { - const clean = yield nodeinfo_1.isClean(); - if (!clean) - return; // skip it if already setup! let public_ip; const public_url = config.public_url; if (public_url) @@ -230,9 +227,12 @@ function printQR() { let theIP = public_ip; // if(!theIP.includes(":")) theIP = public_ip+':3001' const b64 = Buffer.from(`ip::${theIP}::${password_1.default || ''}`).toString('base64'); - console.log('Scan this QR in Sphinx app:'); - console.log(b64); + console.log('>>', b64); connectionStringFile(b64); + const clean = yield nodeinfo_1.isClean(); + if (!clean) + return; // skip it if already setup! + console.log('Scan this QR in Sphinx app:'); QRCode.toString(b64, { type: 'terminal' }, function (err, url) { console.log(url); }); diff --git a/dist/src/utils/setup.js.map b/dist/src/utils/setup.js.map index abf1647..96d2d27 100644 --- a/dist/src/utils/setup.js.map +++ b/dist/src/utils/setup.js.map @@ -1 +1 @@ -{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../../src/utils/setup.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,2CAA2C;AAC3C,sCAA6C;AAC7C,iDAAoC;AACpC,iCAAgC;AAChC,sCAAqC;AACrC,gDAAwC;AACxC,6BAA4B;AAC5B,8CAA4D;AAC5D,yBAAyB;AACzB,yCAAkC;AAElC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,uBAAuB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AAE1E,MAAM,YAAY,GAAG,CAAC,CAAA;AAEtB,MAAM,aAAa,GAAG,GAAS,E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,EAAE,GAAG;YAC3D,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QAClB,CAAC,CAAC,CAAA;IACJ,CAAC;CAAA;AAED,SAAS,oBAAoB,CAAC,GAAU;IACtC,EAAE,CAAC,SAAS,CAAC,uBAAuB,EAAE,GAAG,EAAE,UAAU,GAAG;QACtD,IAAI,GAAG;YAAE,OAAO,CAAC,GAAG,CAAC,qCAAqC,EAAE,GAAG,CAAC,CAAC;IACnE,CAAC,CAAC,CAAC;AACL,CAAC"} \ No newline at end of file diff --git a/src/controllers/messages.ts b/src/controllers/messages.ts index f0ab7e7..902e1b7 100644 --- a/src/controllers/messages.ts +++ b/src/controllers/messages.ts @@ -211,7 +211,7 @@ export const sendMessage = async (req, res) => { export const receiveMessage = async (payload) => { // console.log('received message', { payload }) - const {owner, sender, chat, content, remote_content, msg_id, chat_type, sender_alias, msg_uuid, date_string, reply_uuid, amount} = await helpers.parseReceiveParams(payload) + const {owner, sender, chat, content, remote_content, msg_id, chat_type, sender_alias, msg_uuid, date_string, reply_uuid} = await helpers.parseReceiveParams(payload) if(!owner || !sender || !chat) { return console.log('=> no group chat!') } @@ -227,7 +227,7 @@ export const receiveMessage = async (payload) => { type: constants.message_types.message, sender: sender.id, date: date, - amount: amount||0, + // amount: amount||0, messageContent: text, createdAt: date, updatedAt: date, @@ -255,7 +255,7 @@ export const receiveMessage = async (payload) => { export const receiveBoost = async (payload) => { console.log('received boost', { payload }) - const {owner, sender, chat, content, remote_content, chat_type, sender_alias, msg_uuid, date_string, reply_uuid, amount} = await helpers.parseReceiveParams(payload) + const {owner, sender, chat, content, remote_content, chat_type, sender_alias, msg_uuid, date_string, reply_uuid} = await helpers.parseReceiveParams(payload) if(!owner || !sender || !chat) { return console.log('=> no group chat!') } @@ -271,7 +271,7 @@ export const receiveBoost = async (payload) => { type: constants.message_types.boost, sender: sender.id, date: date, - amount: amount||0, + // amount: amount||0, messageContent: text, createdAt: date, updatedAt: date, diff --git a/src/controllers/payment.ts b/src/controllers/payment.ts index 08d37e2..7944d4d 100644 --- a/src/controllers/payment.ts +++ b/src/controllers/payment.ts @@ -168,7 +168,7 @@ export const listPayments = async (req, res) => { const limit = (req.query.limit && parseInt(req.query.limit)) || 100 const offset = (req.query.offset && parseInt(req.query.offset)) || 0 - const MIN_VAL=constants.min_sat_amount + // const MIN_VAL=constants.min_sat_amount try { const msgs = await models.Message.findAll({ where:{ @@ -180,12 +180,12 @@ export const listPayments = async (req, res) => { constants.message_types.keysend, ]} }, - { - type: constants.message_types.message, // for example /loopout message - amount: { - [Op.gt]: MIN_VAL // greater than - } - } + // { + // type: constants.message_types.message, // for example /loopout message + // amount: { + // [Op.gt]: MIN_VAL // greater than + // } + // } ], }, order: [['createdAt', 'desc']], diff --git a/src/network/receive.ts b/src/network/receive.ts index 69f70c8..d8d5344 100644 --- a/src/network/receive.ts +++ b/src/network/receive.ts @@ -288,13 +288,20 @@ async function parseAndVerifyPayload(data){ } } -async function saveAnonymousKeysend(response, memo) { +async function saveAnonymousKeysend(response, memo, sender_pubkey) { + let sender = 0 + if(sender_pubkey) { + const theSender = await models.Contact.findOne({ where: { publicKey: sender_pubkey }}) + if(theSender && theSender.id) { + sender = theSender.id + } + } let settleDate = parseInt(response['settle_date'] + '000'); const amount = response['amt_paid_sat'] || 0 const msg = await models.Message.create({ chatId: 0, type: constants.message_types.keysend, - sender: 0, + sender, amount, amountMsat: response['amt_paid_msat'], paymentHash: '', @@ -318,24 +325,26 @@ export async function parseKeysendInvoice(i){ // "keysend" type is NOT encrypted // and should be saved even if there is NO content - let isAnonymous = false + let isKeysendType = false let memo = '' + let sender_pubkey; if(data){ try { const payload = parsePayload(data) if(payload && payload.type===constants.message_types.keysend) { - isAnonymous = true + isKeysendType = true memo = payload.message && payload.message.content + sender_pubkey = payload.sender && payload.sender.pub_key } } catch(e) {} // err could be a threaded TLV } else { - isAnonymous = true + isKeysendType = true } - if(isAnonymous) { + if(isKeysendType) { if(!memo) { sendNotification(-1, '', 'keysend', value||0) } - saveAnonymousKeysend(i, memo) + saveAnonymousKeysend(i, memo, sender_pubkey) return } diff --git a/src/utils/setup.ts b/src/utils/setup.ts index 0a68484..f92bab0 100644 --- a/src/utils/setup.ts +++ b/src/utils/setup.ts @@ -203,9 +203,6 @@ async function printGitInfo() { async function printQR() { - const clean = await isClean() - if(!clean) return // skip it if already setup! - let public_ip const public_url = config.public_url @@ -229,9 +226,13 @@ async function printQR() { // if(!theIP.includes(":")) theIP = public_ip+':3001' const b64 = Buffer.from(`ip::${theIP}::${password || ''}`).toString('base64') - console.log('Scan this QR in Sphinx app:') - console.log(b64) + console.log('>>', b64) connectionStringFile(b64) + + const clean = await isClean() + if(!clean) return // skip it if already setup! + + console.log('Scan this QR in Sphinx app:') QRCode.toString(b64, { type: 'terminal' }, function (err, url) { console.log(url) }) From 626a3d69e90e549b820458c691225bed97852c80 Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Fri, 20 Nov 2020 11:39:35 -0800 Subject: [PATCH 09/38] record amts in all msgs, boost msg, if admin sends boost send separat keysend --- dist/src/controllers/messages.js | 39 +++++++++++++++++++++++++--- dist/src/controllers/messages.js.map | 2 +- dist/src/network/receive.js | 7 ++--- dist/src/network/receive.js.map | 2 +- src/controllers/messages.ts | 39 +++++++++++++++++++++++++--- src/network/receive.ts | 6 ++--- 6 files changed, 79 insertions(+), 16 deletions(-) diff --git a/dist/src/controllers/messages.js b/dist/src/controllers/messages.js index a607964..a5720ec 100644 --- a/dist/src/controllers/messages.js +++ b/dist/src/controllers/messages.js @@ -22,6 +22,7 @@ const confirmations_1 = require("./confirmations"); const network = require("../network"); const short = require("short-uuid"); const constants_1 = require("../constants"); +const receive_1 = require("../network/receive"); exports.getMessages = (req, res) => __awaiter(void 0, void 0, void 0, function* () { const dateToReturn = req.query.date; if (!dateToReturn) { @@ -184,10 +185,40 @@ exports.sendMessage = (req, res) => __awaiter(void 0, void 0, void 0, function* type: msgtype, message: msgToSend, }); + const isTribe = chat.type === constants_1.default.chat_types.tribe; + const isTribeOwner = isTribe && owner.publicKey === chat.ownerPubkey; + if (isTribeOwner && reply_uuid && boost && amount) { + processTribeAdminBoost(chat, reply_uuid, amount); + } }); +function processTribeAdminBoost(chat, reply_uuid, amount) { + return __awaiter(this, void 0, void 0, function* () { + const ogMsg = yield models_1.models.Message.findOne({ where: { + uuid: reply_uuid, + } }); + if (ogMsg && ogMsg.sender && ogMsg.sender !== 1) { + receive_1.forwardBoostSatsToContact(chat, ogMsg.sender, amount); + var date = new Date(); + date.setMilliseconds(0); + models_1.models.Message.create({ + chatId: 0, + type: constants_1.default.message_types.keysend, + sender: 1, + amount, + amountMsat: amount * 1000, + paymentHash: '', + date: date, + messageContent: '!', + status: constants_1.default.statuses.confirmed, + createdAt: date, + updatedAt: date + }); + } + }); +} exports.receiveMessage = (payload) => __awaiter(void 0, void 0, void 0, function* () { // console.log('received message', { payload }) - const { owner, sender, chat, content, remote_content, msg_id, chat_type, sender_alias, msg_uuid, date_string, reply_uuid } = yield helpers.parseReceiveParams(payload); + const { owner, sender, chat, content, remote_content, msg_id, chat_type, sender_alias, msg_uuid, date_string, reply_uuid, amount } = yield helpers.parseReceiveParams(payload); if (!owner || !sender || !chat) { return console.log('=> no group chat!'); } @@ -202,7 +233,7 @@ exports.receiveMessage = (payload) => __awaiter(void 0, void 0, void 0, function type: constants_1.default.message_types.message, sender: sender.id, date: date, - // amount: amount||0, + amount: amount || 0, messageContent: text, createdAt: date, updatedAt: date, @@ -227,7 +258,7 @@ exports.receiveMessage = (payload) => __awaiter(void 0, void 0, void 0, function }); exports.receiveBoost = (payload) => __awaiter(void 0, void 0, void 0, function* () { console.log('received boost', { payload }); - const { owner, sender, chat, content, remote_content, chat_type, sender_alias, msg_uuid, date_string, reply_uuid } = yield helpers.parseReceiveParams(payload); + const { owner, sender, chat, content, remote_content, chat_type, sender_alias, msg_uuid, date_string, reply_uuid, amount } = yield helpers.parseReceiveParams(payload); if (!owner || !sender || !chat) { return console.log('=> no group chat!'); } @@ -242,7 +273,7 @@ exports.receiveBoost = (payload) => __awaiter(void 0, void 0, void 0, function* type: constants_1.default.message_types.boost, sender: sender.id, date: date, - // amount: amount||0, + amount: amount || 0, messageContent: text, createdAt: date, updatedAt: date, diff --git a/dist/src/controllers/messages.js.map b/dist/src/controllers/messages.js.map index 984c199..d21d21b 100644 --- a/dist/src/controllers/messages.js.map +++ b/dist/src/controllers/messages.js.map @@ -1 +1 @@ -{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/controllers/messages.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,yCAA8B;AAC9B,2CAAoC;AACpC,gCAAyC;AACzC,0CAAyC;AACzC,2CAA0C;AAC1C,sCAAqC;AACrC,sCAA+C;AAC/C,0CAAyC;AACzC,mDAAgD;AAChD,sCAAqC;AACrC,oCAAmC;AACnC,4CAAoC;AAEvB,QAAA,WAAW,GAAG,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;IAC7C,MAAM,YAAY,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;IAEpC,IAAI,CAAC,YAAY,EAAE;QAClB,OAAO,sBAAc,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;KAC/B;IACD,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;IACzB,MAAM,KAAK,GAAG,MAAM,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,CAAA;IACxE,mCAAmC;IAEnC,IAAI,gBAAgB,GAAG;QACtB,IAAI,EAAE,EAAE,CAAC,cAAE,CAAC,GAAG,CAAC,EAAE,YAAY,EAAE;QAChC,CAAC,cAAE,CAAC,EAAE,CAAC,EAAE;YACR,EAAC,QAAQ,EAAE,KAAK,CAAC,EAAE,EAAC;YACpB,EAAC,QAAQ,EAAE,IAAI,EAAC;SAChB;KACD,CAAA;IAED,IAAI,sBAAsB,GAAG;QAC5B,U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AG,MAAM,eAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,CAAA;IAClE,IAAG,IAAI,EAAE;QACR,MAAM,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAClC,aAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;QAChB,sBAAgB,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;QACnC,MAAM,CAAC,QAAQ,CAAC;YACf,IAAI,EAAE,WAAW;YACjB,QAAQ,EAAE,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC;SACpC,CAAC,CAAA;KACF;SAAM;QACN,aAAO,CAAC,GAAG,EAAE,SAAS,CAAC,CAAA;KACvB;AACF,CAAC,CAAA,CAAA;AAEY,QAAA,aAAa,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IACzC,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;IAErD,aAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;AACjB,CAAC,CAAA"} \ No newline at end of file +{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/controllers/messages.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,yCAA8B;AAC9B,2CAAoC;AACpC,gCAAyC;AACzC,0CAAyC;AACzC,2CAA0C;AAC1C,sCAAqC;AACrC,sCAA+C;AAC/C,0CAAyC;AACzC,mDAAgD;AAChD,sCAAqC;AACrC,oCAAmC;AACnC,4CAAoC;AACpC,gDAA4D;AAE/C,QAAA,WAAW,GAAG,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;IAC7C,MAAM,YAAY,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;IAEpC,IAAI,CAAC,YAAY,EAAE;QAClB,O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AC,GAAG,EAAE,EAAE,CAAC,CAAA;AACjB,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/src/network/receive.js b/dist/src/network/receive.js index 52ac46b..b62133e 100644 --- a/dist/src/network/receive.js +++ b/dist/src/network/receive.js @@ -143,7 +143,7 @@ function onReceive(payload) { if (ogMsg && ogMsg.sender && ogMsg.sender !== 1) { const amtToForward = payload.message.amount - (chat.pricePerMessage || 0) - (chat.escrowAmount || 0); if (amtToForward > 0) { - forwardSatsToContact(chat, ogMsg.sender, amtToForward); + forwardBoostSatsToContact(chat, ogMsg.sender, amtToForward); } } } @@ -203,9 +203,9 @@ function doTheAction(data) { } }); } -function forwardSatsToContact(chat, contactId, amount) { +function forwardBoostSatsToContact(chat, contactId, amount) { return __awaiter(this, void 0, void 0, function* () { - console.log('=> forwardSatsToContact', contactId); + console.log('=> forwardBoostSatsToContact', contactId); const owner = yield models_1.models.Contact.findOne({ where: { isOwner: true } }); send_1.sendMessage({ chat: Object.assign(Object.assign({}, chat.dataValues), { contactIds: [contactId] }), @@ -218,6 +218,7 @@ function forwardSatsToContact(chat, contactId, amount) { }); }); } +exports.forwardBoostSatsToContact = forwardBoostSatsToContact; function forwardMessageToTribe(ogpayload, sender) { return __awaiter(this, void 0, void 0, function* () { // console.log('forwardMessageToTribe') diff --git a/dist/src/network/receive.js.map b/dist/src/network/receive.js.map index c458539..52b00a2 100644 --- a/dist/src/network/receive.js.map +++ b/dist/src/network/receive.js.map @@ -1 +1 @@ -{"version":3,"file":"receive.js","sourceRoot":"","sources":["../../../src/network/receive.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAqC;AACrC,kDAA0C;AAC1C,gDAAsC;AACtC,0CAAyC;AACzC,kDAA2D;AAC3D,0CAAyC;AACzC,sCAAkC;AAClC,iCAAkC;AAClC,qCAA8G;AAC9G,sCAAiE;AACjE,yCAA8B;AAC9B,0CAAyC;AACzC,0CAAyC;AACzC,gCAAyC;AACzC,4CAAoC;AACpC,2CAA0C;AA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,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAA,EAAE;YAC7C,OAAO,IAAI,GAAG,CAAC,CAAC,CAAA;QACjB,CAAC,CAAC,CAAA;QACF,OAAO,MAAM,CAAC,EAAE,CAAC,CAAA;QACjB,OAAO,OAAO,CAAA;KACd;AACF,CAAC"} \ No newline at end of file diff --git a/src/controllers/messages.ts b/src/controllers/messages.ts index 902e1b7..853c283 100644 --- a/src/controllers/messages.ts +++ b/src/controllers/messages.ts @@ -11,6 +11,7 @@ import {sendConfirmation} from './confirmations' import * as network from '../network' import * as short from 'short-uuid' import constants from '../constants' +import {forwardBoostSatsToContact} from '../network/receive' export const getMessages = async (req, res) => { const dateToReturn = req.query.date; @@ -206,12 +207,42 @@ export const sendMessage = async (req, res) => { type: msgtype, message: msgToSend, }) + + const isTribe = chat.type===constants.chat_types.tribe + const isTribeOwner = isTribe && owner.publicKey===chat.ownerPubkey + if(isTribeOwner && reply_uuid && boost && amount) { + processTribeAdminBoost(chat, reply_uuid, amount) + } +} + +async function processTribeAdminBoost(chat, reply_uuid, amount){ + const ogMsg = await models.Message.findOne({where:{ + uuid: reply_uuid, + }}) + if(ogMsg && ogMsg.sender && ogMsg.sender!==1) { + forwardBoostSatsToContact(chat,ogMsg.sender,amount) + var date = new Date(); + date.setMilliseconds(0) + models.Message.create({ // gen keysend record on owner side + chatId: 0, + type: constants.message_types.keysend, + sender: 1, + amount, + amountMsat: amount*1000, + paymentHash: '', + date: date, + messageContent: '!', + status: constants.statuses.confirmed, + createdAt: date, + updatedAt: date + }) + } } export const receiveMessage = async (payload) => { // console.log('received message', { payload }) - const {owner, sender, chat, content, remote_content, msg_id, chat_type, sender_alias, msg_uuid, date_string, reply_uuid} = await helpers.parseReceiveParams(payload) + const {owner, sender, chat, content, remote_content, msg_id, chat_type, sender_alias, msg_uuid, date_string, reply_uuid, amount} = await helpers.parseReceiveParams(payload) if(!owner || !sender || !chat) { return console.log('=> no group chat!') } @@ -227,7 +258,7 @@ export const receiveMessage = async (payload) => { type: constants.message_types.message, sender: sender.id, date: date, - // amount: amount||0, + amount: amount||0, messageContent: text, createdAt: date, updatedAt: date, @@ -255,7 +286,7 @@ export const receiveMessage = async (payload) => { export const receiveBoost = async (payload) => { console.log('received boost', { payload }) - const {owner, sender, chat, content, remote_content, chat_type, sender_alias, msg_uuid, date_string, reply_uuid} = await helpers.parseReceiveParams(payload) + const {owner, sender, chat, content, remote_content, chat_type, sender_alias, msg_uuid, date_string, reply_uuid, amount} = await helpers.parseReceiveParams(payload) if(!owner || !sender || !chat) { return console.log('=> no group chat!') } @@ -271,7 +302,7 @@ export const receiveBoost = async (payload) => { type: constants.message_types.boost, sender: sender.id, date: date, - // amount: amount||0, + amount: amount||0, messageContent: text, createdAt: date, updatedAt: date, diff --git a/src/network/receive.ts b/src/network/receive.ts index d8d5344..8e2388b 100644 --- a/src/network/receive.ts +++ b/src/network/receive.ts @@ -129,7 +129,7 @@ async function onReceive(payload){ if(ogMsg && ogMsg.sender && ogMsg.sender!==1) { const amtToForward = payload.message.amount - (chat.pricePerMessage||0) - (chat.escrowAmount||0) if(amtToForward>0) { - forwardSatsToContact(chat,ogMsg.sender,amtToForward) + forwardBoostSatsToContact(chat,ogMsg.sender,amtToForward) } } } @@ -183,8 +183,8 @@ async function doTheAction(data){ } } -async function forwardSatsToContact(chat,contactId:number,amount:number) { - console.log('=> forwardSatsToContact',contactId) +export async function forwardBoostSatsToContact(chat,contactId:number,amount:number) { + console.log('=> forwardBoostSatsToContact',contactId) const owner = await models.Contact.findOne({where:{isOwner:true}}) sendMessage({ chat: {...chat.dataValues, contactIds:[contactId]}, From c59d8a489e185b5bac379330fa43081884a7ce91 Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Fri, 20 Nov 2020 15:11:14 -0800 Subject: [PATCH 10/38] network_type migration, include network_type in all recieved messages, boosts are auto forwarded, choose network in network.sendMessage --- dist/src/constants.js | 4 +++ dist/src/constants.js.map | 2 +- dist/src/controllers/bots.js | 2 ++ dist/src/controllers/bots.js.map | 2 +- dist/src/controllers/chatTribes.js | 20 ++++++----- dist/src/controllers/chatTribes.js.map | 2 +- dist/src/controllers/chats.js | 13 ++++--- dist/src/controllers/chats.js.map | 2 +- dist/src/controllers/invoices.js | 4 ++- dist/src/controllers/invoices.js.map | 2 +- dist/src/controllers/media.js | 21 ++++++----- dist/src/controllers/media.js.map | 2 +- dist/src/controllers/messages.js | 46 ++++++++---------------- dist/src/controllers/messages.js.map | 2 +- dist/src/controllers/payment.js | 17 +++++++-- dist/src/controllers/payment.js.map | 2 +- dist/src/helpers.js | 3 +- dist/src/helpers.js.map | 2 +- dist/src/models/ts/message.js | 4 +++ dist/src/models/ts/message.js.map | 2 +- dist/src/network/modify.js | 2 ++ dist/src/network/modify.js.map | 2 +- dist/src/network/receive.js | 29 +++++---------- dist/src/network/receive.js.map | 2 +- dist/src/network/send.js | 7 ++-- dist/src/network/send.js.map | 2 +- dist/src/utils/setup.js | 1 + dist/src/utils/setup.js.map | 2 +- src/constants.ts | 4 +++ src/controllers/bots.ts | 3 ++ src/controllers/chatTribes.ts | 20 ++++++----- src/controllers/chats.ts | 13 ++++--- src/controllers/invoices.ts | 4 ++- src/controllers/media.ts | 21 ++++++----- src/controllers/messages.ts | 49 ++++++++++---------------- src/controllers/payment.ts | 23 +++++++----- src/helpers.ts | 3 +- src/models/ts/message.ts | 3 ++ src/network/modify.ts | 2 ++ src/network/receive.ts | 29 ++++++--------- src/network/send.ts | 10 +++--- src/utils/setup.ts | 2 ++ 42 files changed, 204 insertions(+), 183 deletions(-) diff --git a/dist/src/constants.js b/dist/src/constants.js index b2ed1b9..e7340da 100644 --- a/dist/src/constants.js +++ b/dist/src/constants.js @@ -60,6 +60,10 @@ const constants = { "keysend": 28, "boost": 29, }, + network_types: { + "lightning": 0, + "mqtt": 1, + }, payment_errors: { "timeout": "Timed Out", "no_route": "No Route To Receiver", diff --git a/dist/src/constants.js.map b/dist/src/constants.js.map index 55bf24d..80a64e8 100644 --- a/dist/src/constants.js.map +++ b/dist/src/constants.js.map @@ -1 +1 @@ -{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":";;AAAA,MAAM,SAAS,GAAG;IAChB,cAAc,EAAE,CAAC;IACjB,eAAe,EAAE;QACf,SAAS,EAAE,CAAC;QACZ,OAAO,EAAE,CAAC;QACV,WAAW,EAAE,CAAC;QACd,aAAa,EAAE,CAAC;QAChB,UAAU,EAAE,CAAC;QACb,SAAS,EAAE,CAAC;QACZ,iBAAiB,EAAE,CAAC;KACrB;IACD,gBAAgB,EAAE;QAChB,SAAS,EAAE,CAAC;QACZ,WAAW,EAAE,CAAC;KACf;IACD,QAAQ,EAAE;QACR,SAAS,EAAE,CAAC;QACZ,WAAW,EAAE,CAAC;QACd,WAAW,EAAE,CAAC;QACd,UAAU,EAAE,CAAC;QACb,QAAQ,EAAE,CAAC;QACX,SAAS,EAAE,CAAC;KACb;IACD,aAAa,EAAE;QACb,UAAU,EAAE,CAAC;QACb,SAAS,EAAE,CAAC;QACZ,UAAU,EAAE,CAAC;KACd;IACD,aAAa,EAAE;QACb,SAAS,EAAE,CAAC;QACZ,cAAc,EAAE,CAAC;QACjB,SAAS,EAAE,CAAC;QACZ,SAAS,EAAE,CAAC;QACZ,cAAc,EAAE,CAAC;QACjB,gBAAgB,EAAE,CAAC;QACnB,YAAY,EAAE,CAAC;QACf,UAAU,EAAE,CAAC;QACb,iBAAiB,EAAE,CAAC;QACpB,eAAe,EAAE,CAAC;QAClB,aAAa,EAAE,EAAE;QACjB,0BAA0B,EAAE,EAAE;QAC9B,cAAc,EAAE,EAAE;QAClB,cAAc,EAAE,EAAE;QAClB,YAAY,EAAE,EAAE;QAChB,aAAa,EAAE,EAAE;QACjB,YAAY,EAAE,EAAE;QAChB,QAAQ,EAAE,EAAE;QACZ,WAAW,EAAE,EAAE;QACf,gBAAgB,EAAE,EAAE;QACpB,gBAAgB,EAAE,EAAE;QACpB,eAAe,EAAE,EAAE;QACnB,cAAc,EAAE,EAAE;QAClB,aAAa,EAAE,EAAE;QACjB,SAAS,EAAE,EAAE;QACb,SAAS,EAAE,EAAE;QACb,WAAW,EAAE,EAAE;QACf,wBAAwB,EAAE,EAAE;QAC5B,SAAS,EAAE,EAAE;QACb,OAAO,EAAE,EAAE;KACZ;IACD,cAAc,EAAE;QACd,SAAS,EAAE,WAAW;QACtB,UAAU,EAAE,sBAAsB;QAClC,OAAO,EAAE,OAAO;QAChB,2BAA2B,EAAE,2BAA2B;QACxD,SAAS,EAAE,SAAS;KACrB;IACD,UAAU,EAAE;QACV,cAAc,EAAE,CAAC;QACjB,OAAO,EAAE,CAAC;QACV,OAAO,EAAE,CAAC;KACX;IACD,SAAS,EAAE;QACT,SAAS,EAAE,CAAC;QACZ,OAAO,EAAE,CAAC;QACV,QAAQ,EAAE,CAAC;KACZ;IACD,UAAU,EAAE;QACV,GAAG,EAAE,CAAC;QACN,OAAO,EAAE,CAAC;QACV,OAAO,EAAE,CAAC;QACV,KAAK,EAAE,CAAC;QACR,QAAQ,EAAE,CAAC;QACX,QAAQ,EAAE,CAAC;KACZ;CACF,CAAA;AAED,kBAAe,SAAS,CAAA"} \ No newline at end of file +{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":";;AAAA,MAAM,SAAS,GAAG;IAChB,cAAc,EAAE,CAAC;IACjB,eAAe,EAAE;QACf,SAAS,EAAE,CAAC;QACZ,OAAO,EAAE,CAAC;QACV,WAAW,EAAE,CAAC;QACd,aAAa,EAAE,CAAC;QAChB,UAAU,EAAE,CAAC;QACb,SAAS,EAAE,CAAC;QACZ,iBAAiB,EAAE,CAAC;KACrB;IACD,gBAAgB,EAAE;QAChB,SAAS,EAAE,CAAC;QACZ,WAAW,EAAE,CAAC;KACf;IACD,QAAQ,EAAE;QACR,SAAS,EAAE,CAAC;QACZ,WAAW,EAAE,CAAC;QACd,WAAW,EAAE,CAAC;QACd,UAAU,EAAE,CA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AS,EAAE,CAAC;QACZ,OAAO,EAAE,CAAC;QACV,QAAQ,EAAE,CAAC;KACZ;IACD,UAAU,EAAE;QACV,GAAG,EAAE,CAAC;QACN,OAAO,EAAE,CAAC;QACV,OAAO,EAAE,CAAC;QACV,KAAK,EAAE,CAAC;QACR,QAAQ,EAAE,CAAC;QACX,QAAQ,EAAE,CAAC;KACZ;CACF,CAAA;AAED,kBAAe,SAAS,CAAA"} \ No newline at end of file diff --git a/dist/src/controllers/bots.js b/dist/src/controllers/bots.js index 2c4c8c2..65d0e88 100644 --- a/dist/src/controllers/bots.js +++ b/dist/src/controllers/bots.js @@ -309,6 +309,7 @@ function receiveBotRes(payload) { const bot_name = dat.bot_name; const sender_alias = dat.sender.alias; const date_string = dat.message.date; + const network_type = dat.network_type || 0; if (!chat_uuid) return console.log('=> receiveBotRes Error no chat_uuid'); const chat = yield models_1.models.Chat.findOne({ where: { uuid: chat_uuid } }); @@ -349,6 +350,7 @@ function receiveBotRes(payload) { createdAt: date, updatedAt: date, senderAlias: sender_alias || 'Bot', + network_type }; const message = yield models_1.models.Message.create(msg); socket.sendJson({ diff --git a/dist/src/controllers/bots.js.map b/dist/src/controllers/bots.js.map index 23225c2..93d4089 100644 --- a/dist/src/controllers/bots.js.map +++ b/dist/src/controllers/bots.js.map @@ -1 +1 @@ -{"version":3,"file":"bots.js","sourceRoot":"","sources":["../../../src/controllers/bots.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,0CAAyC;AACzC,iCAAgC;AAChC,sCAAkC;AAClC,2CAA0C;AAC1C,sCAA+C;AAC/C,sCAAqC;AACrC,+BAAwC;AACxC,0CAAyC;AACzC,2CAA8B;AAC9B,wCAAuC;AAEvC,4CAAoC;AAEvB,QAAA,OAAO,GAAG,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;IACxC,IAAI;QACF,MAAM,IAAI,GAAG,MAAM,eAAM,CAAC,GAAG,CAAC,OAAO,EAAE,CAAA;QACvC,aAAO,CAAC,GAAG,EAA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C,EAAE;gBACf,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,mBAAS,CAAC,aAAa,CAAC,OAAO;gBACrC,MAAM,EAAE,CAAC,MAAM,IAAE,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC;gBAChC,MAAM,EAAE,MAAM,IAAI,CAAC;gBACnB,IAAI,EAAE,IAAI;gBACV,cAAc,EAAE,OAAO;gBACvB,MAAM,EAAE,mBAAS,CAAC,QAAQ,CAAC,SAAS;gBACpC,SAAS,EAAE,IAAI;gBACf,SAAS,EAAE,IAAI;gBACf,WAAW,EAAE,YAAY,IAAI,KAAK;aACnC,CAAA;YACD,MAAM,OAAO,GAAG,MAAM,eAAM,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;YAChD,MAAM,CAAC,QAAQ,CAAC;gBACd,IAAI,EAAE,SAAS;gBACf,QAAQ,EAAE,SAAS,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC;aAC3D,CAAC,CAAA;SACH;IACH,CAAC;CAAA;AAhED,sCAgEC"} \ No newline at end of file +{"version":3,"file":"bots.js","sourceRoot":"","sources":["../../../src/controllers/bots.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,0CAAyC;AACzC,iCAAgC;AAChC,sCAAkC;AAClC,2CAA0C;AAC1C,sCAA+C;AAC/C,sCAAqC;AACrC,+BAAwC;AACxC,0CAAyC;AACzC,2CAA8B;AAC9B,wCAAuC;AAEvC,4CAAoC;AAEvB,QAAA,OAAO,GAAG,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;IACxC,IAAI;QACF,MAAM,IAAI,GAAG,MAAM,eAAM,CAAC,GAAG,CAAC,OAAO,EAAE,CAAA;QACvC,aAAO,CAAC,GAAG,EAAE;YACX,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;SAC5C,CAAC,CAAA;KACH;IAAC,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;gBACrC,MAAM,EAAE,CAAC,MAAM,IAAE,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC;gBAChC,MAAM,EAAE,MAAM,IAAI,CAAC;gBACnB,IAAI,EAAE,IAAI;gBACV,cAAc,EAAE,OAAO;gBACvB,MAAM,EAAE,mBAAS,CAAC,QAAQ,CAAC,SAAS;gBACpC,SAAS,EAAE,IAAI;gBACf,SAAS,EAAE,IAAI;gBACf,WAAW,EAAE,YAAY,IAAI,KAAK;gBAClC,YAAY;aACb,CAAA;YACD,MAAM,OAAO,GAAG,MAAM,eAAM,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;YAChD,MAAM,CAAC,QAAQ,CAAC;gBACd,IAAI,EAAE,SAAS;gBACf,QAAQ,EAAE,SAAS,CAAC,aAAa,CAAC,OAAO,EAAE,OAAO,EAAE,KAAK,CAAC;aAC3D,CAAC,CAAA;SACH;IACH,CAAC;CAAA;AAlED,sCAkEC"} \ No newline at end of file diff --git a/dist/src/controllers/chatTribes.js b/dist/src/controllers/chatTribes.js index 28c9af7..96b400d 100644 --- a/dist/src/controllers/chatTribes.js +++ b/dist/src/controllers/chatTribes.js @@ -119,7 +119,7 @@ exports.joinTribe = joinTribe; function receiveMemberRequest(payload) { return __awaiter(this, void 0, void 0, function* () { console.log('=> receiveMemberRequest'); - const { sender_pub_key, sender_alias, chat_uuid, chat_members, chat_type, isTribeOwner } = yield helpers.parseReceiveParams(payload); + const { sender_pub_key, sender_alias, chat_uuid, chat_members, chat_type, isTribeOwner, network_type } = yield helpers.parseReceiveParams(payload); const chat = yield models_1.models.Chat.findOne({ where: { uuid: chat_uuid } }); if (!chat) return console.log('no chat'); @@ -173,7 +173,8 @@ function receiveMemberRequest(payload) { sender: (theSender && theSender.id) || 0, messageContent: '', remoteMessageContent: '', status: constants_1.default.statuses.confirmed, - date: date, createdAt: date, updatedAt: date + date: date, createdAt: date, updatedAt: date, + network_type }; if (isTribe) { msg.senderAlias = sender_alias; @@ -314,7 +315,7 @@ exports.approveOrRejectMember = approveOrRejectMember; function receiveMemberApprove(payload) { return __awaiter(this, void 0, void 0, function* () { console.log('=> receiveMemberApprove'); - const { owner, chat, chat_name, sender } = yield helpers.parseReceiveParams(payload); + const { owner, chat, chat_name, sender, network_type } = yield helpers.parseReceiveParams(payload); if (!chat) return console.log('no chat'); yield chat.update({ status: constants_1.default.chat_statuses.approved }); @@ -326,7 +327,8 @@ function receiveMemberApprove(payload) { sender: (sender && sender.id) || 0, messageContent: '', remoteMessageContent: '', status: constants_1.default.statuses.confirmed, - date: date, createdAt: date, updatedAt: date + date: date, createdAt: date, updatedAt: date, + network_type }; const message = yield models_1.models.Message.create(msg); socket.sendJson({ @@ -358,7 +360,7 @@ exports.receiveMemberApprove = receiveMemberApprove; function receiveMemberReject(payload) { return __awaiter(this, void 0, void 0, function* () { console.log('=> receiveMemberReject'); - const { chat, sender, chat_name } = yield helpers.parseReceiveParams(payload); + const { chat, sender, chat_name, network_type } = yield helpers.parseReceiveParams(payload); if (!chat) return console.log('no chat'); yield chat.update({ status: constants_1.default.chat_statuses.rejected }); @@ -371,7 +373,8 @@ function receiveMemberReject(payload) { sender: (sender && sender.id) || 0, messageContent: '', remoteMessageContent: '', status: constants_1.default.statuses.confirmed, - date: date, createdAt: date, updatedAt: date + date: date, createdAt: date, updatedAt: date, + network_type }; const message = yield models_1.models.Message.create(msg); socket.sendJson({ @@ -388,7 +391,7 @@ exports.receiveMemberReject = receiveMemberReject; function receiveTribeDelete(payload) { return __awaiter(this, void 0, void 0, function* () { console.log('=> receiveTribeDelete'); - const { chat, sender } = yield helpers.parseReceiveParams(payload); + const { chat, sender, network_type } = yield helpers.parseReceiveParams(payload); if (!chat) return console.log('no chat'); // await chat.update({status: constants.chat_statuses.rejected}) @@ -401,7 +404,8 @@ function receiveTribeDelete(payload) { sender: (sender && sender.id) || 0, messageContent: '', remoteMessageContent: '', status: constants_1.default.statuses.confirmed, - date: date, createdAt: date, updatedAt: date + date: date, createdAt: date, updatedAt: date, + network_type }; const message = yield models_1.models.Message.create(msg); socket.sendJson({ diff --git a/dist/src/controllers/chatTribes.js.map b/dist/src/controllers/chatTribes.js.map index 9bffb2b..0661487 100644 --- a/dist/src/controllers/chatTribes.js.map +++ b/dist/src/controllers/chatTribes.js.map @@ -1 +1 @@ -{"version":3,"file":"chatTribes.js","sourceRoot":"","sources":["../../../src/controllers/chatTribes.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAkC;AAClC,2CAA0C;AAC1C,sCAA+C;AAC/C,sCAAqC;AACrC,qCAAoC;AACpC,sCAAqC;AACrC,0CAAyC;AACzC,0CAAyC;AACzC,gCAAyC;AACzC,sCAA+D;AAC/D,yCAA8B;AAC9B,4CAAoC;AAEpC,SAAsB,SAAS,CAAC,GAAG,EAAE,GAAG;;QACvC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAA;QAC3B,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,YAAY,EAAE,WAAW,EAAE,GAAG,GAAG,CAAC,IAAI,CAAA;QACxF,MAAM,UAAU,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAA;QAEnC,MAAM,QAAQ,GAAG,MAAM,eAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAC,KAAK,EAAC,EAAC,IAAI,EAAC,EAAC,CAAC,CAAA;QAC1D,IAAG,QAAQ,EAAE;YACZ,OAAO,CAAC,GAAG,CAAC,sCAAsC,CAAC,CAAA;YACnD,OAAO,aAAO,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAA;SACtC;QAED,IAAG,CAAC,YAAY,IAAI,CAAC,SAAS,IAAI,CAAC,IAAI,EAAE;YACxC,OAAO,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAA;YAC/C,OAAO,aAAO,CAAC,GAAG,EAAE,yBAAyB,CAAC,CAAA;SAC9C;QAED,MAAM,WAAW,GAAG,YAAY,CA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AK;YAC1B,MAAM,EAAE,OAAO,IAAE,EAAE;YACnB,OAAO,EAAE,QAAQ,IAAE,EAAE;SACrB,CAAA;IACF,CAAC;CAAA;AAhCD,sDAgCC;AAED,SAAsB,0BAA0B,CAAC,KAAK;;QACrD,MAAM,OAAO,GAAG,MAAM,eAAM,CAAC,UAAU,CAAC,OAAO,CAAC,EAAC,KAAK,EAAC;gBACtD,MAAM,EAAE,KAAK,CAAC,EAAE;gBAChB,MAAM,EAAE,mBAAS,CAAC,aAAa,CAAC,OAAO,CAAC,eAAe;aACvD,EAAC,CAAC,CAAA;QACH,IAAI,CAAC,OAAO;YAAE,OAAO,KAAK,CAAA;QAC1B,MAAM,iBAAiB,GAAY,OAAO,CAAC,GAAG,CAAC,CAAC,CAAA,EAAE,CAAA,CAAC,CAAC,SAAS,CAAC,CAAA;QAC9D,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,IAAE,KAAK,CAAA;QACpC,uCACI,IAAI,KACP,iBAAiB,IACjB;IACF,CAAC;CAAA;AAZD,gEAYC;AAED,SAAe,YAAY,CAAC,KAAK,EAAE,QAAQ;;QAC1C,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;YAChD,MAAM,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;SAC7C;IACF,CAAC;CAAA"} \ No newline at end of file +{"version":3,"file":"chatTribes.js","sourceRoot":"","sources":["../../../src/controllers/chatTribes.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAkC;AAClC,2CAA0C;AAC1C,sCAA+C;AAC/C,sCAAqC;AACrC,qCAAoC;AACpC,sCAAqC;AACrC,0CAAyC;AACzC,0CAAyC;AACzC,gCAAyC;AACzC,sCAA+D;AAC/D,yCAA8B;AAC9B,4CAAoC;AAEpC,SAAsB,SAAS,CAAC,GAAG,EAAE,GAAG;;QACvC,OAAO,C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AM,iBAAiB,GAAY,OAAO,CAAC,GAAG,CAAC,CAAC,CAAA,EAAE,CAAA,CAAC,CAAC,SAAS,CAAC,CAAA;QAC9D,MAAM,IAAI,GAAG,KAAK,CAAC,UAAU,IAAE,KAAK,CAAA;QACpC,uCACI,IAAI,KACP,iBAAiB,IACjB;IACF,CAAC;CAAA;AAZD,gEAYC;AAED,SAAe,YAAY,CAAC,KAAK,EAAE,QAAQ;;QAC1C,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;YAChD,MAAM,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;SAC7C;IACF,CAAC;CAAA"} \ No newline at end of file diff --git a/dist/src/controllers/chats.js b/dist/src/controllers/chats.js index cdd445e..13b5884 100644 --- a/dist/src/controllers/chats.js +++ b/dist/src/controllers/chats.js @@ -79,7 +79,7 @@ exports.kickChatMember = kickChatMember; function receiveGroupKick(payload) { return __awaiter(this, void 0, void 0, function* () { console.log('=> receiveGroupKick'); - const { chat, sender, date_string } = yield helpers.parseReceiveParams(payload); + const { chat, sender, date_string, network_type } = yield helpers.parseReceiveParams(payload); if (!chat) return; // const owner = await models.Contact.findOne({where:{isOwner:true}}) @@ -104,6 +104,7 @@ function receiveGroupKick(payload) { messageContent: '', remoteMessageContent: '', status: constants_1.default.statuses.confirmed, date: date, createdAt: date, updatedAt: date, + network_type }; const message = yield models_1.models.Message.create(msg); socket.sendJson({ @@ -318,7 +319,7 @@ exports.deleteChat = (req, res) => __awaiter(void 0, void 0, void 0, function* ( function receiveGroupJoin(payload) { return __awaiter(this, void 0, void 0, function* () { console.log('=> receiveGroupJoin'); - const { sender_pub_key, sender_alias, chat_uuid, chat_members, chat_type, isTribeOwner, date_string } = yield helpers.parseReceiveParams(payload); + const { sender_pub_key, sender_alias, chat_uuid, chat_members, chat_type, isTribeOwner, date_string, network_type } = yield helpers.parseReceiveParams(payload); const chat = yield models_1.models.Chat.findOne({ where: { uuid: chat_uuid } }); if (!chat) return; @@ -386,7 +387,8 @@ function receiveGroupJoin(payload) { sender: (theSender && theSender.id) || 0, messageContent: '', remoteMessageContent: '', status: constants_1.default.statuses.confirmed, - date: date, createdAt: date, updatedAt: date + date: date, createdAt: date, updatedAt: date, + network_type }; if (isTribe) { msg.senderAlias = sender_alias; @@ -407,7 +409,7 @@ exports.receiveGroupJoin = receiveGroupJoin; function receiveGroupLeave(payload) { return __awaiter(this, void 0, void 0, function* () { console.log('=> receiveGroupLeave'); - const { sender_pub_key, chat_uuid, chat_type, sender_alias, isTribeOwner, date_string } = yield helpers.parseReceiveParams(payload); + const { sender_pub_key, chat_uuid, chat_type, sender_alias, isTribeOwner, date_string, network_type } = yield helpers.parseReceiveParams(payload); const chat = yield models_1.models.Chat.findOne({ where: { uuid: chat_uuid } }); if (!chat) return; @@ -446,7 +448,8 @@ function receiveGroupLeave(payload) { sender: (sender && sender.id) || 0, messageContent: '', remoteMessageContent: '', status: constants_1.default.statuses.confirmed, - date: date, createdAt: date, updatedAt: date + date: date, createdAt: date, updatedAt: date, + network_type }; if (isTribe) { msg.senderAlias = sender_alias; diff --git a/dist/src/controllers/chats.js.map b/dist/src/controllers/chats.js.map index ca0056a..f4e3713 100644 --- a/dist/src/controllers/chats.js.map +++ b/dist/src/controllers/chats.js.map @@ -1 +1 @@ -{"version":3,"file":"chats.js","sourceRoot":"","sources":["../../../src/controllers/chats.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAkC;AAClC,2CAA0C;AAC1C,sCAA+C;AAC/C,sCAAqC;AACrC,sCAAqC;AACrC,0CAAyC;AACzC,gCAAyC;AACzC,2BAA0B;AAC1B,0CAAyC;AACzC,0CAAyC;AACzC,6CAA+F;AAC/F,4CAAoC;AAEpC,SAAsB,UAAU,CAAC,GAAG,EAAE,GAAG;;QACxC,OAAO,CAAC,GAAG,CAAC,eAAe,CAAC,CAAA;QAC5B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AM,CAAC,OAAO,CAAC,CAAA;IAC/F,MAAM,IAAI,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAA;IAC1C,MAAM,aAAa,GAAG,UAAU,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,CAAA;IAChG,OAAO;QACN,IAAI,EAAE,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,IAAI,IAAI,EAAE;QACvC,UAAU,EAAE,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC;QACzC,SAAS,EAAE,IAAI;QACf,SAAS,EAAE,IAAI;QACf,IAAI,EAAE,IAAI;QACV,IAAI,EAAE,mBAAS,CAAC,UAAU,CAAC,KAAK;KAChC,CAAA;AACF,CAAC;AAED,SAAe,YAAY,CAAC,KAAK,EAAE,QAAQ;;QAC1C,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;YAChD,MAAM,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;SAC7C;IACF,CAAC;CAAA"} \ No newline at end of file diff --git a/dist/src/controllers/invoices.js b/dist/src/controllers/invoices.js index a9d2293..13bc3ec 100644 --- a/dist/src/controllers/invoices.js +++ b/dist/src/controllers/invoices.js @@ -204,6 +204,7 @@ exports.receiveInvoice = (payload) => __awaiter(void 0, void 0, void 0, function const total_spent = 1; const dat = payload.content || payload; const payment_request = dat.message.invoice; + const network_type = dat.network_type || 0; var date = new Date(); date.setMilliseconds(0); const { owner, sender, chat, msg_id, chat_type, sender_alias, msg_uuid } = yield helpers.parseReceiveParams(payload); @@ -226,7 +227,8 @@ exports.receiveInvoice = (payload) => __awaiter(void 0, void 0, void 0, function date: new Date(invoiceDate), status: constants_1.default.statuses.pending, createdAt: date, - updatedAt: date + updatedAt: date, + network_type: network_type, }; const isTribe = chat_type === constants_1.default.chat_types.tribe; if (isTribe) { diff --git a/dist/src/controllers/invoices.js.map b/dist/src/controllers/invoices.js.map index 6b64283..f74542f 100644 --- a/dist/src/controllers/invoices.js.map +++ b/dist/src/controllers/invoices.js.map @@ -1 +1 @@ -{"version":3,"file":"invoices.js","sourceRoot":"","sources":["../../../src/controllers/invoices.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAkC;AAClC,kDAAkD;AAClD,0CAAyC;AACzC,2CAA0C;AAC1C,+CAA8C;AAC9C,sCAAqC;AACrC,gCAAyC;AACzC,sCAAsC;AACtC,mDAAgD;AAChD,sCAAqC;AACrC,oCAAmC;AACnC,4CAAoC;AAEpC,SAAS,oBAAoB,CAAC,CAAC;IAC7B,IAAG,CAAC,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC;QAAE,OAAO,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;IACnE,OAAO,CAAC,CAAA;AACV,CAAC;AAEY,QAAA,UAAU,GAAG,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;IAC3C,MAAM,SAAS,GAAG,MAAM,yBAAa,EAAE,CAAA;IACvC,MAAM,eAAe,GAAG,oBAAoB,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;IAEtE,IAAG,CAAC,eAAe,EAAC;QAClB,OAAO,CAAC,GAAG,CAAC,0CAA0C,CAAC,CAAA;QACvD,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QACf,GAAG,CAAC,IAAI,CAAC,EAAC,OAAO,EAAC,KAAK,EAAE,KAAK,EAAC,0BAA0B,EAAC,CAAC,CAAA;QAC3D,GAAG,CAAC,GAAG,EAAE,CAAA;QACT,OAAM;KACP;IACD,OAAO,CAAC,GAAG,CAAC,iBAAiB,eAAe,EAAE,CAAC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,QAAQ,CAAC,CAAC;IACpE,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,IAAI,GAAG,GAAG,CAAC,CAAC;IACZ,IAAI,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE;QAC5B,IAAI,GAAG,MAAM,CAAC;QACd,GAAG,GAAG,MAAM,GAAG,IAAI,CAAC;KACrB;IAED,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAA;AACzE,CAAC"} \ No newline at end of file +{"version":3,"file":"invoices.js","sourceRoot":"","sources":["../../../src/controllers/invoices.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAkC;AAClC,kDAAkD;AAClD,0CAAyC;AACzC,2CAA0C;AAC1C,+CAA8C;AAC9C,sCAAqC;AACrC,gCAAyC;AACzC,sCAAsC;AACtC,mDAAgD;AAChD,sCAAqC;AACrC,oCAAmC;AACnC,4CAAoC;AAEpC,SAAS,oBAAoB,CAAC,CAAC;IAC7B,IAAG,CAAC,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC;QAAE,OAAO,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;IACnE,OAAO,CAAC,CAAA;AACV,CAAC;AAEY,QAAA,UAAU,GAAG,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;IAC3C,MAAM,SAAS,GAAG,MAAM,yBAAa,EAAE,CAAA;IACvC,MAAM,eAAe,GAAG,oBAAoB,CAAC,GAAG,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;IAEtE,IAAG,CAAC,eAAe,EAAC;QAClB,OAAO,CAAC,GAAG,CAAC,0CAA0C,CAAC,CAAA;QACvD,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;QACf,GAAG,CAAC,IAAI,CAAC,EAAC,OAAO,EAAC,KAAK,EAAE,KAAK,EAAC,0BAA0B,EAAC,CAAC,CAAA;QAC3D,GAAG,CAAC,G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IACnE,IAAI,WAAW,GAAG,QAAQ,CAAC,qBAAqB,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,GAAG,KAAK,CAAC,CAAC;IAErF,IAAI,MAAM,GAAG,qBAAqB,CAAC,qBAAqB,CAAC,CAAC,QAAQ,CAAC,CAAC;IACpE,IAAI,IAAI,GAAG,CAAC,CAAC;IACb,IAAI,GAAG,GAAG,CAAC,CAAC;IACZ,IAAI,MAAM,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE;QAC5B,IAAI,GAAG,MAAM,CAAC;QACd,GAAG,GAAG,MAAM,GAAG,IAAI,CAAC;KACrB;IAED,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,EAAE,iBAAiB,EAAE,IAAI,EAAE,CAAA;AACzE,CAAC"} \ No newline at end of file diff --git a/dist/src/controllers/media.js b/dist/src/controllers/media.js index ea8289e..a0705af 100644 --- a/dist/src/controllers/media.js +++ b/dist/src/controllers/media.js @@ -185,6 +185,7 @@ exports.purchase = (req, res) => __awaiter(void 0, void 0, void 0, function* () chat: Object.assign(Object.assign({}, chat.dataValues), { contactIds: [contact_id] }), sender: owner, type: constants_1.default.message_types.purchase, + realSatsContactId: contact_id, message: msg, amount: amount, success: (data) => __awaiter(void 0, void 0, void 0, function* () { @@ -199,7 +200,7 @@ exports.receivePurchase = (payload) => __awaiter(void 0, void 0, void 0, functio console.log('=> received purchase', { payload }); var date = new Date(); date.setMilliseconds(0); - const { owner, sender, chat, amount, mediaToken, msg_uuid, chat_type, skip_payment_processing, purchaser_id } = yield helpers.parseReceiveParams(payload); + const { owner, sender, chat, amount, mediaToken, msg_uuid, chat_type, skip_payment_processing, purchaser_id, network_type } = yield helpers.parseReceiveParams(payload); if (!owner || !sender || !chat) { return console.log('=> group chat not found!'); } @@ -212,7 +213,8 @@ exports.receivePurchase = (payload) => __awaiter(void 0, void 0, void 0, functio mediaToken: mediaToken, date: date, createdAt: date, - updatedAt: date + updatedAt: date, + network_type }); socket.sendJson({ type: 'purchase', @@ -319,7 +321,7 @@ exports.receivePurchaseAccept = (payload) => __awaiter(void 0, void 0, void 0, f console.log('=> receivePurchaseAccept'); var date = new Date(); date.setMilliseconds(0); - const { owner, sender, chat, mediaToken, mediaKey, mediaType, originalMuid } = yield helpers.parseReceiveParams(payload); + const { owner, sender, chat, mediaToken, mediaKey, mediaType, originalMuid, network_type } = yield helpers.parseReceiveParams(payload); if (!owner || !sender || !chat) { return console.log('=> no group chat!'); } @@ -349,7 +351,8 @@ exports.receivePurchaseAccept = (payload) => __awaiter(void 0, void 0, void 0, f originalMuid: originalMuid || '', date: date, createdAt: date, - updatedAt: date + updatedAt: date, + network_type }); socket.sendJson({ type: 'purchase_accept', @@ -360,7 +363,7 @@ exports.receivePurchaseDeny = (payload) => __awaiter(void 0, void 0, void 0, fun console.log('=> receivePurchaseDeny'); var date = new Date(); date.setMilliseconds(0); - const { owner, sender, chat, amount, mediaToken } = yield helpers.parseReceiveParams(payload); + const { owner, sender, chat, amount, mediaToken, network_type } = yield helpers.parseReceiveParams(payload); if (!owner || !sender || !chat) { return console.log('=> no group chat!'); } @@ -375,7 +378,8 @@ exports.receivePurchaseDeny = (payload) => __awaiter(void 0, void 0, void 0, fun mediaToken, date: date, createdAt: date, - updatedAt: date + updatedAt: date, + network_type }); socket.sendJson({ type: 'purchase_deny', @@ -386,7 +390,7 @@ exports.receiveAttachment = (payload) => __awaiter(void 0, void 0, void 0, funct // console.log('received attachment', { payload }) var date = new Date(); date.setMilliseconds(0); - const { owner, sender, chat, mediaToken, mediaKey, mediaType, content, msg_id, chat_type, sender_alias, msg_uuid, reply_uuid } = yield helpers.parseReceiveParams(payload); + const { owner, sender, chat, mediaToken, mediaKey, mediaType, content, msg_id, chat_type, sender_alias, msg_uuid, reply_uuid, network_type } = yield helpers.parseReceiveParams(payload); if (!owner || !sender || !chat) { return console.log('=> no group chat!'); } @@ -397,7 +401,8 @@ exports.receiveAttachment = (payload) => __awaiter(void 0, void 0, void 0, funct sender: sender.id, date: date, createdAt: date, - updatedAt: date + updatedAt: date, + network_type }; if (content) msg.messageContent = content; diff --git a/dist/src/controllers/media.js.map b/dist/src/controllers/media.js.map index 408d213..1ef32f9 100644 --- a/dist/src/controllers/media.js.map +++ b/dist/src/controllers/media.js.map @@ -1 +1 @@ -{"version":3,"file":"media.js","sourceRoot":"","sources":["../../../src/controllers/media.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,0CAAyC;AACzC,2CAA0C;AAC1C,yCAAwC;AACxC,sCAAqC;AACrC,gCAAyC;AACzC,kDAA8D;AAC9D,sCAAqC;AACrC,kDAAkD;AAClD,wCAAqF;AACrF,+BAA4B;AAC5B,4CAA2C;AAC3C,qCAAoC;AACpC,mDAAgD;AAChD,6BAA4B;AAC5B,sCAAqC;AACrC,sCAAqC;AACrC,oCAAmC;AACnC,4CAAoC;AAEpC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,uBAAuB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AAEzE;;;;;;;;;;;;;;;;EAgBE;AAEW,QAAA,qBAAqB,GAAG,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;IACtD,QAAQ;IACR,8CAA8C;IAC9C,eAAe;IACf,4CAA4C;IAC5C,IAAI;IAEJ,MAAM,EACJ,OAAO,EACP,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,WAAW,EACX,eAAe,EACf,aAAa,EACb,UAAU,EACV,MAAM,EACN,SAAS,EACT,GAAG,EACH,KAAK,EAAE,+CAA+C;IACtD,UAAU,GACX,GAAG,GAAG,CAAC,IAAI,CAAA;IAEZ,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,GAAG,CAAC,IAAI,CAAC,CAAA;IAE1C,MAAM,KAAK,GAAG,MAAM,eAAM,C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AAG,MAAM,aAAa,CAAC,IAAI,CAAC,CAAA;YACvC,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC,GAAG,CAAC,QAAQ,GAAC,UAAU,GAAC,IAAI,EAAC;gBAChD,OAAO,EAAE;oBACP,eAAe,EAAE,UAAU,KAAK,EAAE;oBAClC,cAAc,EAAE,kBAAkB;iBACnC;gBACD,IAAI,EAAC,IAAI;aACV,CAAC,CAAA;YACF,OAAO,GAAG,CAAA;SACX;QAAC,OAAM,CAAC,EAAE;YACT,OAAO,IAAI,CAAA;SACZ;IACH,CAAC;CAAA;AAdD,oCAcC"} \ No newline at end of file +{"version":3,"file":"media.js","sourceRoot":"","sources":["../../../src/controllers/media.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,0CAAyC;AACzC,2CAA0C;AAC1C,yCAAwC;AACxC,sCAAqC;AACrC,gCAAyC;AACzC,kDAA8D;AAC9D,sCAAqC;AACrC,kDAAkD;AAClD,wCAAqF;AACrF,+BAA4B;AAC5B,4CAA2C;AAC3C,qCAAoC;AACpC,mDAAgD;AAChD,6BAA4B;AAC5B,sCAAqC;AACrC,sCAAqC;AACrC,oCAAmC;AACnC,4CAAoC;AAEpC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,uBAAuB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AAEzE;;;;;;;;;;;;;;;;EAgBE;AAEW,QAAA,qBAAqB,GAAG,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;IACtD,QAAQ;IACR,8CAA8C;IAC9C,eAAe;IACf,4CAA4C;IAC5C,IAAI;IAEJ,MAAM,EACJ,OAAO,EACP,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,WAAW,EACX,eAAe,EACf,aAAa,EACb,UAAU,EACV,MAAM,EACN,SAAS,EACT,GAAG,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,MAAM,IAAI,KAAK,CAAC,UAAU,CAAC,CAAA;aAC5B;YACD,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;YAC9B,OAAO,IAAI,CAAC,KAAK,CAAA;SAClB;QAAC,OAAM,CAAC,EAAE;YACT,MAAM,CAAC,CAAA;SACR;IACH,CAAC;CAAA;AAlCD,sCAkCC;AAED,SAAsB,YAAY,CAAC,IAAI;;QACrC,IAAI;YACF,MAAM,KAAK,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,CAAA;YACvC,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC,GAAG,CAAC,QAAQ,GAAC,UAAU,GAAC,IAAI,EAAC;gBAChD,OAAO,EAAE;oBACP,eAAe,EAAE,UAAU,KAAK,EAAE;oBAClC,cAAc,EAAE,kBAAkB;iBACnC;gBACD,IAAI,EAAC,IAAI;aACV,CAAC,CAAA;YACF,OAAO,GAAG,CAAA;SACX;QAAC,OAAM,CAAC,EAAE;YACT,OAAO,IAAI,CAAA;SACZ;IACH,CAAC;CAAA;AAdD,oCAcC"} \ No newline at end of file diff --git a/dist/src/controllers/messages.js b/dist/src/controllers/messages.js index a5720ec..91133cd 100644 --- a/dist/src/controllers/messages.js +++ b/dist/src/controllers/messages.js @@ -22,7 +22,6 @@ const confirmations_1 = require("./confirmations"); const network = require("../network"); const short = require("short-uuid"); const constants_1 = require("../constants"); -const receive_1 = require("../network/receive"); exports.getMessages = (req, res) => __awaiter(void 0, void 0, void 0, function* () { const dateToReturn = req.query.date; if (!dateToReturn) { @@ -178,47 +177,30 @@ exports.sendMessage = (req, res) => __awaiter(void 0, void 0, void 0, function* }; if (reply_uuid) msgToSend.replyUuid = reply_uuid; - network.sendMessage({ + const sendMessageParams = { chat: chat, sender: owner, amount: amount || 0, type: msgtype, message: msgToSend, - }); + }; + // IF BOOST AND TRIBE OWNER NEED TO SEND ACTUAL SATS TO OG POSTER const isTribe = chat.type === constants_1.default.chat_types.tribe; const isTribeOwner = isTribe && owner.publicKey === chat.ownerPubkey; if (isTribeOwner && reply_uuid && boost && amount) { - processTribeAdminBoost(chat, reply_uuid, amount); - } -}); -function processTribeAdminBoost(chat, reply_uuid, amount) { - return __awaiter(this, void 0, void 0, function* () { const ogMsg = yield models_1.models.Message.findOne({ where: { uuid: reply_uuid, } }); - if (ogMsg && ogMsg.sender && ogMsg.sender !== 1) { - receive_1.forwardBoostSatsToContact(chat, ogMsg.sender, amount); - var date = new Date(); - date.setMilliseconds(0); - models_1.models.Message.create({ - chatId: 0, - type: constants_1.default.message_types.keysend, - sender: 1, - amount, - amountMsat: amount * 1000, - paymentHash: '', - date: date, - messageContent: '!', - status: constants_1.default.statuses.confirmed, - createdAt: date, - updatedAt: date - }); + if (ogMsg && ogMsg.sender) { + sendMessageParams.realSatsContactId = 123; } - }); -} + } + // final send + network.sendMessage(sendMessageParams); +}); exports.receiveMessage = (payload) => __awaiter(void 0, void 0, void 0, function* () { // console.log('received message', { payload }) - const { owner, sender, chat, content, remote_content, msg_id, chat_type, sender_alias, msg_uuid, date_string, reply_uuid, amount } = yield helpers.parseReceiveParams(payload); + const { owner, sender, chat, content, remote_content, msg_id, chat_type, sender_alias, msg_uuid, date_string, reply_uuid, amount, network_type } = yield helpers.parseReceiveParams(payload); if (!owner || !sender || !chat) { return console.log('=> no group chat!'); } @@ -237,7 +219,8 @@ exports.receiveMessage = (payload) => __awaiter(void 0, void 0, void 0, function messageContent: text, createdAt: date, updatedAt: date, - status: constants_1.default.statuses.received + status: constants_1.default.statuses.received, + network_type: network_type, }; const isTribe = chat_type === constants_1.default.chat_types.tribe; if (isTribe) { @@ -258,7 +241,7 @@ exports.receiveMessage = (payload) => __awaiter(void 0, void 0, void 0, function }); exports.receiveBoost = (payload) => __awaiter(void 0, void 0, void 0, function* () { console.log('received boost', { payload }); - const { owner, sender, chat, content, remote_content, chat_type, sender_alias, msg_uuid, date_string, reply_uuid, amount } = yield helpers.parseReceiveParams(payload); + const { owner, sender, chat, content, remote_content, chat_type, sender_alias, msg_uuid, date_string, reply_uuid, amount, network_type } = yield helpers.parseReceiveParams(payload); if (!owner || !sender || !chat) { return console.log('=> no group chat!'); } @@ -277,7 +260,8 @@ exports.receiveBoost = (payload) => __awaiter(void 0, void 0, void 0, function* messageContent: text, createdAt: date, updatedAt: date, - status: constants_1.default.statuses.received + status: constants_1.default.statuses.received, + network_type }; const isTribe = chat_type === constants_1.default.chat_types.tribe; if (isTribe) { diff --git a/dist/src/controllers/messages.js.map b/dist/src/controllers/messages.js.map index d21d21b..f696775 100644 --- a/dist/src/controllers/messages.js.map +++ b/dist/src/controllers/messages.js.map @@ -1 +1 @@ -{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/controllers/messages.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,yCAA8B;AAC9B,2CAAoC;AACpC,gCAAyC;AACzC,0CAAyC;AACzC,2CAA0C;AAC1C,sCAAqC;AACrC,sCAA+C;AAC/C,0CAAyC;AACzC,mDAAgD;AAChD,sCAAqC;AACrC,oCAAmC;AACnC,4CAAoC;AACpC,gDAA4D;AAE/C,QAAA,WAAW,GAAG,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;IAC7C,MAAM,YAAY,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;IAEpC,IAAI,CAAC,YAAY,EAAE;QAClB,OAAO,sBAAc,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;KAC/B;IACD,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;IACzB,MAAM,KAAK,GAAG,MAAM,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,CAAA;IACxE,mCAAmC;IAEnC,IAAI,gBAAgB,GAAG;QACtB,IAAI,EAAE,EAAE,CAAC,cAAE,CAAC,GAAG,CAAC,EAAE,YAAY,EAAE;QAChC,CAAC,cAAE,CAAC,EAAE,CAAC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T,CAAC,cAAE,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE;aACf;YACD,MAAM,EAAE,OAAO;SAChB;KACD,CAAC,CAAC;IACH,MAAM,IAAI,GAAG,MAAM,eAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,CAAA;IAClE,IAAG,IAAI,EAAE;QACR,MAAM,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAClC,aAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;QAChB,sBAAgB,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;QACnC,MAAM,CAAC,QAAQ,CAAC;YACf,IAAI,EAAE,WAAW;YACjB,QAAQ,EAAE,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC;SACpC,CAAC,CAAA;KACF;SAAM;QACN,aAAO,CAAC,GAAG,EAAE,SAAS,CAAC,CAAA;KACvB;AACF,CAAC,CAAA,CAAA;AAEY,QAAA,aAAa,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IACzC,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;IAErD,aAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;AACjB,CAAC,CAAA"} \ No newline at end of file +{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/controllers/messages.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,yCAA8B;AAC9B,2CAAoC;AACpC,gCAAyC;AACzC,0CAAyC;AACzC,2CAA0C;AAC1C,sCAAqC;AACrC,sCAA+C;AAC/C,0CAAyC;AACzC,mDAAgD;AAChD,sCAAqC;AACrC,oCAAmC;AACnC,4CAAoC;AAEvB,QAAA,WAAW,GAAG,CAAO,GAAG,EAAE,GAAG,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;aACf;YACD,MAAM,EAAE,OAAO;SAChB;KACD,CAAC,CAAC;IACH,MAAM,IAAI,GAAG,MAAM,eAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,CAAA;IAClE,IAAG,IAAI,EAAE;QACR,MAAM,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAClC,aAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;QAChB,sBAAgB,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;QACnC,MAAM,CAAC,QAAQ,CAAC;YACf,IAAI,EAAE,WAAW;YACjB,QAAQ,EAAE,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC;SACpC,CAAC,CAAA;KACF;SAAM;QACN,aAAO,CAAC,GAAG,EAAE,SAAS,CAAC,CAAA;KACvB;AACF,CAAC,CAAA,CAAA;AAEY,QAAA,aAAa,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IACzC,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;IAErD,aAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;AACjB,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/src/controllers/payment.js b/dist/src/controllers/payment.js index a6620c4..113a373 100644 --- a/dist/src/controllers/payment.js +++ b/dist/src/controllers/payment.js @@ -115,7 +115,7 @@ exports.receivePayment = (payload) => __awaiter(void 0, void 0, void 0, function console.log('received payment', { payload }); var date = new Date(); date.setMilliseconds(0); - const { owner, sender, chat, amount, content, mediaType, mediaToken, chat_type, sender_alias, msg_uuid, reply_uuid } = yield helpers.parseReceiveParams(payload); + const { owner, sender, chat, amount, content, mediaType, mediaToken, chat_type, sender_alias, msg_uuid, reply_uuid, network_type } = yield helpers.parseReceiveParams(payload); if (!owner || !sender || !chat) { return console.log('=> no group chat!'); } @@ -128,7 +128,8 @@ exports.receivePayment = (payload) => __awaiter(void 0, void 0, void 0, function amountMsat: parseFloat(amount) * 1000, date: date, createdAt: date, - updatedAt: date + updatedAt: date, + network_type }; if (content) msg.messageContent = content; @@ -152,7 +153,7 @@ exports.receivePayment = (payload) => __awaiter(void 0, void 0, void 0, function exports.listPayments = (req, res) => __awaiter(void 0, void 0, void 0, function* () { const limit = (req.query.limit && parseInt(req.query.limit)) || 100; const offset = (req.query.offset && parseInt(req.query.offset)) || 0; - // const MIN_VAL=constants.min_sat_amount + const MIN_VAL = constants_1.default.min_sat_amount; try { const msgs = yield models_1.models.Message.findAll({ where: { @@ -164,6 +165,16 @@ exports.listPayments = (req, res) => __awaiter(void 0, void 0, void 0, function* constants_1.default.message_types.keysend, ] } }, + { + type: { [sequelize_1.Op.or]: [ + constants_1.default.message_types.message, + constants_1.default.message_types.boost, + ] }, + amount: { + [sequelize_1.Op.gt]: MIN_VAL // greater than + }, + network_type: constants_1.default.network_types.lightning + } ], }, order: [['createdAt', 'desc']], diff --git a/dist/src/controllers/payment.js.map b/dist/src/controllers/payment.js.map index 9c4bbb7..0eed230 100644 --- a/dist/src/controllers/payment.js.map +++ b/dist/src/controllers/payment.js.map @@ -1 +1 @@ -{"version":3,"file":"payment.js","sourceRoot":"","sources":["../../../src/controllers/payment.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,gCAAyC;AACzC,0CAAyC;AACzC,2CAA0C;AAC1C,sCAAqC;AACrC,sCAA+C;AAC/C,wCAA4C;AAC5C,sCAAqC;AACrC,oCAAmC;AACnC,4CAAoC;AACpC,yCAA8B;AAC9B,iCAAuC;AAE1B,QAAA,WAAW,GAAG,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;IAC5C,MAAM,EACJ,MAAM,EACN,OAAO,EACP,UAAU,EACV,eAAe,EACf,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,WAAW,EAC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AAS,CAAC,CAAA;AAClE,CAAC,CAAA,CAAA;AAEY,QAAA,YAAY,GAAG,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;IAC7C,MAAM,KAAK,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,IAAI,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,IAAI,GAAG,CAAA;IACnE,MAAM,MAAM,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,IAAI,QAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAA;IAEpE,yCAAyC;IACzC,IAAI;QACF,MAAM,IAAI,GAAG,MAAM,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC;YACxC,KAAK,EAAC;gBACJ,CAAC,cAAE,CAAC,EAAE,CAAC,EAAE;oBACP;wBACE,IAAI,EAAE,EAAC,CAAC,cAAE,CAAC,EAAE,CAAC,EAAE;gCACd,mBAAS,CAAC,aAAa,CAAC,OAAO;gCAC/B,mBAAS,CAAC,aAAa,CAAC,cAAc;gCACtC,mBAAS,CAAC,aAAa,CAAC,OAAO;6BAChC,EAAC;qBACH;iBAOF;aACF;YACD,KAAK,EAAE,CAAC,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;YAC9B,KAAK;YACL,MAAM;SACP,CAAC,CAAA;QACF,MAAM,GAAG,GAAG,IAAI,IAAE,EAAE,CAAA;QACpB,aAAO,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,OAAO,CAAA,EAAE,CAAC,SAAS,CAAC,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,CAAA;KACxE;IAAC,OAAM,CAAC,EAAE;QACT,aAAO,CAAC,GAAG,EAAE,oBAAoB,CAAC,CAAA;KACnC;AACH,CAAC,CAAA,CAAC"} \ No newline at end of file +{"version":3,"file":"payment.js","sourceRoot":"","sources":["../../../src/controllers/payment.ts"],"names":[],"mappings":";;;;;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AAa,CAAC,OAAO;gCAC/B,mBAAS,CAAC,aAAa,CAAC,KAAK;6BAC9B,EAAC;wBACF,MAAM,EAAE;4BACN,CAAC,cAAE,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,eAAe;yBACjC;wBACD,YAAY,EAAE,mBAAS,CAAC,aAAa,CAAC,SAAS;qBAChD;iBACF;aACF;YACD,KAAK,EAAE,CAAC,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;YAC9B,KAAK;YACL,MAAM;SACP,CAAC,CAAA;QACF,MAAM,GAAG,GAAG,IAAI,IAAE,EAAE,CAAA;QACpB,aAAO,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,OAAO,CAAA,EAAE,CAAC,SAAS,CAAC,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,CAAA;KACxE;IAAC,OAAM,CAAC,EAAE;QACT,aAAO,CAAC,GAAG,EAAE,oBAAoB,CAAC,CAAA;KACnC;AACH,CAAC,CAAA,CAAC"} \ No newline at end of file diff --git a/dist/src/helpers.js b/dist/src/helpers.js index 291e899..a5259c0 100644 --- a/dist/src/helpers.js +++ b/dist/src/helpers.js @@ -168,6 +168,7 @@ function parseReceiveParams(payload) { const skip_payment_processing = dat.message.skipPaymentProcessing; const reply_uuid = dat.message.replyUuid; const purchaser_id = dat.message.purchaser; + const network_type = dat.network_type || 0; const isTribeOwner = dat.isTribeOwner ? true : false; const isConversation = !chat_type || (chat_type && chat_type == constants_1.default.chat_types.conversation); let sender; @@ -188,7 +189,7 @@ function parseReceiveParams(payload) { } chat = yield models_1.models.Chat.findOne({ where: { uuid: chat_uuid } }); } - return { owner, sender, chat, sender_pub_key, sender_alias, isTribeOwner, chat_uuid, amount, content, mediaToken, mediaKey, mediaType, originalMuid, chat_type, msg_id, chat_members, chat_name, chat_host, chat_key, remote_content, msg_uuid, date_string, reply_uuid, skip_payment_processing, purchaser_id, sender_photo_url }; + return { owner, sender, chat, sender_pub_key, sender_alias, isTribeOwner, chat_uuid, amount, content, mediaToken, mediaKey, mediaType, originalMuid, chat_type, msg_id, chat_members, chat_name, chat_host, chat_key, remote_content, msg_uuid, date_string, reply_uuid, skip_payment_processing, purchaser_id, sender_photo_url, network_type }; }); } exports.parseReceiveParams = parseReceiveParams; diff --git a/dist/src/helpers.js.map b/dist/src/helpers.js.map index 56607e8..6bae5ed 100644 --- a/dist/src/helpers.js.map +++ b/dist/src/helpers.js.map @@ -1 +1 @@ -{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../src/helpers.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,qCAAiC;AACjC,2BAA0B;AAC1B,qCAAoC;AACpC,2CAAmC;AAEtB,QAAA,gBAAgB,GAAG,CAAO,MAAM,EAAE,EAAE;IAChD,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,MAAM,CAAA;IAClD,IAAI,IAAI,CAAA;IACR,IAAI,IAAI,GAAG,IAAI,IAAI,EAAE,CAAC;IACtB,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAAA;IAEvB,IAAI,OAAO,EAAE;QACZ,IAAI,GAAG,MAAM,eAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,CAAA;QAC5D,kDAAkD;KAClD;SAAM;QACN,OAAO,CAAC,GAAG,CAAC,kCAAkC,CAAC,CAAA;QAC/C,MAAM,KAAK,GAAG,MAAM,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,CAAC,CAAA;QACvE,MAAM,SAAS,GAAG,MAAM,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,CAAC,CAAA;QAC/E,MAAM,IAAI,GAAG,GAAG,CAAC,CAAC,KAAK,CAAC,SAAS,EAAE,SAAS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C1C,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;YAChD,MAAM,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;SAC7C;IACF,CAAC;CAAA;AAED,SAAS,iBAAiB,CAAC,IAAI,EAAE,MAAM;IACtC,MAAM,eAAe,GAAG,MAAM,IAAI,MAAM,CAAC,QAAQ,IAAI,CAAC,MAAM,CAAC,YAAY,CAAA;IACzE,OAAO;QACN,IAAI,EAAE,IAAI;QACV,MAAM,gCACL,OAAO,EAAE,MAAM,CAAC,SAAS,EACzB,WAAW,EAAE,MAAM,CAAC,UAAU,IAC3B,MAAM,CAAC,KAAK,IAAI,EAAC,KAAK,EAAE,MAAM,CAAC,KAAK,EAAC,GACrC,eAAe,IAAI,EAAC,SAAS,EAAE,MAAM,CAAC,QAAQ,EAAC,CAClD;KACD,CAAA;AACF,CAAC"} \ No newline at end of file diff --git a/dist/src/models/ts/message.js b/dist/src/models/ts/message.js index 3fd04c4..d7a9f29 100644 --- a/dist/src/models/ts/message.js +++ b/dist/src/models/ts/message.js @@ -129,6 +129,10 @@ __decorate([ sequelize_typescript_1.Column, __metadata("design:type", String) ], Message.prototype, "replyUuid", void 0); +__decorate([ + sequelize_typescript_1.Column(sequelize_typescript_1.DataType.INTEGER), + __metadata("design:type", Number) +], Message.prototype, "network_type", void 0); Message = __decorate([ sequelize_typescript_1.Table({ tableName: 'sphinx_messages', underscored: true }) ], Message); diff --git a/dist/src/models/ts/message.js.map b/dist/src/models/ts/message.js.map index f0c1bc8..e813e40 100644 --- a/dist/src/models/ts/message.js.map +++ b/dist/src/models/ts/message.js.map @@ -1 +1 @@ -{"version":3,"file":"message.js","sourceRoot":"","sources":["../../../../src/models/ts/message.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAsE;AAGtE,IAAqB,OAAO,GAA5B,MAAqB,OAAQ,S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,KAAK;QACnB,SAAS,EAAE,KAAK;KACjB,CAAC;;qCACW;AAGb;IADC,6BAAM;8BACI,IAAI;0CAAA;AAGf;IADC,6BAAM;8BACI,IAAI;0CAAA;AAGf;IADC,6BAAM;;4CACY;AAGnB;IADC,6BAAM;;6CACa;AAGpB;IADC,6BAAM;;0CACU;AA1FE,OAAO;IAD3B,4BAAK,CAAC,EAAC,SAAS,EAAE,iBAAiB,EAAE,WAAW,EAAE,IAAI,EAAC,CAAC;GACpC,OAAO,CA2F3B;kBA3FoB,OAAO"} \ No newline at end of file +{"version":3,"file":"message.js","sourceRoot":"","sources":["../../../../src/models/ts/message.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAsE;AAGtE,IAAqB,OAAO,GAA5B,MAAqB,OAAQ,SAAQ,4BAAc;CA8FlD,CAAA;AAtFC;IANC,6BAAM,CAAC;QACN,IAAI,EAAE,+BAAQ,CAAC,MAAM;QACrB,UAAU,EAAE,IAAI;QAChB,MAAM,EAAE,IAAI;QACZ,aAAa,EAAE,IAAI;KACpB,CAAC;;mCACQ;AAGV;IADC,6BAAM;;qCACK;AAGZ;IADC,6BAAM,CAAC,+BAAQ,CAAC,MAAM,CAAC;;uCACV;AAGd;IADC,6BAAM,CAAC,+BAAQ,CAAC,MAAM,CAAC;;qCACZ;AAGZ;IADC,6BAAM,CAAC,+BAAQ,CAAC,MAAM,CAAC;;uCACV;AAGd;IADC,6BAAM,CAAC,+BAAQ,CAAC,MAAM,CAAC;;yCACR;AAGhB;IADC,6BAAM,CAAC,+BAAQ,CAAC,OAAO,CAAC;;uCACX;AAGd;IADC,6BAAM,CAAC,+BAAQ,CAAC,OAAO,CAAC;;2CACP;AAGlB;IADC,6BAAM;;4CACY;AAGnB;IADC,6BAAM,CAAC,+BAAQ,CAAC,IAAI,CAAC;;+CACA;AAGtB;IADC,6BAAM;8BACD,IAAI;qCAAA;AAGV;IADC,6BAAM;8BACS,IAAI;+CAAA;AAGpB;IADC,6BAAM,CAAC,+BAAQ,CAAC,IAAI,CAAC;;+CACA;AAGtB;IADC,6BAAM,CAAC,+BAAQ,CAAC,IAAI,CAAC;;qDACM;AAG5B;IADC,6BAAM,CAAC,+BAAQ,CAAC,MAAM,CAAC;;uCACV;AAGd;IADC,6BAAM,CAAC,+BAAQ,CAAC,IAAI,CAAC;;0CACL;AAGjB;IADC,6BAAM,CAAC,+BAAQ,CAAC,MAAM,CAAC;;yCACR;AAGhB;IADC,6BAAM,CAAC,+BAAQ,CAAC,MAAM,CAAC;;+CACF;AAGtB;IADC,6BAAM;;yCACS;AAGhB;IADC,6BAAM;;0CACU;AAGjB;IADC,6BAAM;;2CACW;AAOlB;IALC,6BAAM,CAAC;QACN,IAAI,EAAE,+BAAQ,CAAC,OAAO;QACtB,YAAY,EAAE,KAAK;QACnB,SAAS,EAAE,KAAK;KACjB,CAAC;;qCACW;AAGb;IADC,6BAAM;8BACI,IAAI;0CAAA;AAGf;IADC,6BAAM;8BACI,IAAI;0CAAA;AAGf;IADC,6BAAM;;4CACY;AAGnB;IADC,6BAAM;;6CACa;AAGpB;IADC,6BAAM;;0CACU;AAGjB;IADC,6BAAM,CAAC,+BAAQ,CAAC,OAAO,CAAC;;6CACL;AA7FD,OAAO;IAD3B,4BAAK,CAAC,EAAC,SAAS,EAAE,iBAAiB,EAAE,WAAW,EAAE,IAAI,EAAC,CAAC;GACpC,OAAO,CA8F3B;kBA9FoB,OAAO"} \ No newline at end of file diff --git a/dist/src/network/modify.js b/dist/src/network/modify.js index edcc6a7..e8c3b9e 100644 --- a/dist/src/network/modify.js +++ b/dist/src/network/modify.js @@ -79,6 +79,7 @@ function purchaseFromOriginalSender(payload, chat, purchaser) { sender: owner, type: constants_1.default.message_types.purchase, amount: amount, + realSatsContactId: mediaKey.sender, message: { mediaToken: mt, skipPaymentProcessing: true, @@ -97,6 +98,7 @@ function purchaseFromOriginalSender(payload, chat, purchaser) { chat: Object.assign(Object.assign({}, chat.dataValues), { contactIds: [ogmsg.sender] }), sender: Object.assign(Object.assign(Object.assign({}, owner.dataValues), purchaser && purchaser.alias && { alias: purchaser.alias }), { role: constants_1.default.chat_roles.reader }), type: constants_1.default.message_types.purchase, + realSatsContactId: ogmsg.sender, message: msg, amount: amount, success: () => { }, diff --git a/dist/src/network/modify.js.map b/dist/src/network/modify.js.map index 088594f..e36d065 100644 --- a/dist/src/network/modify.js.map +++ b/dist/src/network/modify.js.map @@ -1 +1 @@ -{"version":3,"file":"modify.js","sourceRoot":"","sources":["../../../src/network/modify.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,2CAA8B;AAC9B,wCAAuC;AACvC,qCAAoC;AACpC,iCAAgC;AAChC,sCAAqC;AACrC,sCAAqC;AACrC,sCAAkC;AAClC,uCAAsC;AACtC,iCAAkC;AAClC,iCAAiC;AACjC,4CAAoC;AAEpC,MAAM,QAAQ,GAAG,mBAAS,CAAC,aAAa,CAAA;AAExC,SAAsB,4BAA4B,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM;;QACtE,IAAG,OAAO,CAAC,IAAI,KAAG,QAAQ,CAAC,UAAU;YAAE,OAAO,OAAO,CAAA;QACrD,IAAG;YACD,MAAM,GAAG,GAAG,MAAM,4CAA4C,CAAC,OAAO,EAAC,IAAI,EAAC,MAAM,CAAC,CAAA;YACnF,OAAO,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA,CAAC,4BAA4B;SAC1D;QAAC,OAAM,CAAC,EAAE;YACT,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,CAAC,CAAC,CAAA;YAChC,OAAO,OAAO,CAAA;SACf;IACH,CAAC;CAAA;AATD,oEASC;AAED,kBAAkB;AAClB,SAAsB,0BAA0B,CAAC,OAAO,EAAE,IAAI,EAAE,SAAS;;QACvE,IAAG,OAAO,CAAC,IAAI,KAAG,QAAQ,CAAC,QAAQ;YAAE,OAAM;QAE3C,MAAM,EAAE,GAAG,OAAO,CAAC,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,UAAU,CAA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AAK,GAAG,IAAI,EAAC,GAAG,EAAC,CAAC;aACvB,CAAA;YAED,MAAM,MAAM,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC,CAAA;YACzD,IAAI,IAAI,GAAG,IAAI,IAAI,EAAE,CAAA;YAErB,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAAA;YACvB,MAAM,KAAK,CAAC,CAAC,CAAC,CAAA;YACd,MAAM,eAAM,CAAC,QAAQ,CAAC,MAAM,CAAC;gBAC3B,IAAI,EAAC,IAAI,CAAC,IAAI;gBACd,MAAM,EAAC,IAAI,CAAC,EAAE;gBACd,GAAG,EAAC,MAAM;gBACV,SAAS,EAAE,CAAC,OAAO,CAAC,OAAO,IAAE,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,IAAE,CAAC;gBACnD,QAAQ,EAAE,CAAC;gBACX,MAAM,EAAE,MAAM,CAAC,EAAE;gBACjB,SAAS,EAAE,IAAI;gBACf,YAAY,EAAE,MAAM;gBACpB,SAAS,EAAC,GAAG;aACd,CAAC,CAAA;YACF,OAAO,EAAC,UAAU,EAAC,QAAQ,EAAC,MAAM,EAAC,CAAA;SACpC;QAAC,OAAM,CAAC,EAAE;YACT,MAAM,CAAC,CAAA;SACR;IACH,CAAC;CAAA;AA1ED,oGA0EC"} \ No newline at end of file +{"version":3,"file":"modify.js","sourceRoot":"","sources":["../../../src/network/modify.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,2CAA8B;AAC9B,wCAAuC;AACvC,qCAAoC;AACpC,iCAAgC;AAChC,sCAAqC;AACrC,sCAAqC;AACrC,sCAAkC;AAClC,uCAAsC;AACtC,iCAAkC;AAClC,iCAAiC;AACjC,4CAAoC;AAEpC,MAAM,QAAQ,GAAG,mBAAS,CAAC,aAAa,CAAA;AAExC,SAAsB,4BAA4B,CAAC,OAAO,EAAE,IAAI,EAAE,MAAM;;QACtE,IAAG,OAAO,CAAC,I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EAAE,CAAC;gBACX,MAAM,EAAE,MAAM,CAAC,EAAE;gBACjB,SAAS,EAAE,IAAI;gBACf,YAAY,EAAE,MAAM;gBACpB,SAAS,EAAC,GAAG;aACd,CAAC,CAAA;YACF,OAAO,EAAC,UAAU,EAAC,QAAQ,EAAC,MAAM,EAAC,CAAA;SACpC;QAAC,OAAM,CAAC,EAAE;YACT,MAAM,CAAC,CAAA;SACR;IACH,CAAC;CAAA;AA1ED,oGA0EC"} \ No newline at end of file diff --git a/dist/src/network/receive.js b/dist/src/network/receive.js index b62133e..7caae4d 100644 --- a/dist/src/network/receive.js +++ b/dist/src/network/receive.js @@ -136,6 +136,7 @@ function onReceive(payload) { } } // forward boost sats to recipient + let realSatsContactId = null; if (payload.type === msgtypes.boost && payload.message.replyUuid) { const ogMsg = yield models_1.models.Message.findOne({ where: { uuid: payload.message.replyUuid, @@ -143,12 +144,12 @@ function onReceive(payload) { if (ogMsg && ogMsg.sender && ogMsg.sender !== 1) { const amtToForward = payload.message.amount - (chat.pricePerMessage || 0) - (chat.escrowAmount || 0); if (amtToForward > 0) { - forwardBoostSatsToContact(chat, ogMsg.sender, amtToForward); + realSatsContactId = ogMsg.sender; } } } if (doAction) - forwardMessageToTribe(payload, senderContact); + forwardMessageToTribe(payload, senderContact, realSatsContactId); else console.log('=> insufficient payment for this action'); } @@ -203,23 +204,7 @@ function doTheAction(data) { } }); } -function forwardBoostSatsToContact(chat, contactId, amount) { - return __awaiter(this, void 0, void 0, function* () { - console.log('=> forwardBoostSatsToContact', contactId); - const owner = yield models_1.models.Contact.findOne({ where: { isOwner: true } }); - send_1.sendMessage({ - chat: Object.assign(Object.assign({}, chat.dataValues), { contactIds: [contactId] }), - sender: owner, - type: constants_1.default.message_types.keysend, - amount: amount, - message: { content: '!' }, - success: () => { }, - failure: () => { } - }); - }); -} -exports.forwardBoostSatsToContact = forwardBoostSatsToContact; -function forwardMessageToTribe(ogpayload, sender) { +function forwardMessageToTribe(ogpayload, sender, realSatsContactId) { return __awaiter(this, void 0, void 0, function* () { // console.log('forwardMessageToTribe') const chat = yield models_1.models.Chat.findOne({ where: { uuid: ogpayload.chat.uuid } }); @@ -242,6 +227,7 @@ function forwardMessageToTribe(ogpayload, sender) { sender: Object.assign(Object.assign(Object.assign({}, owner.dataValues), payload.sender && payload.sender.alias && { alias: payload.sender.alias }), { role: constants_1.default.chat_roles.reader }), chat: chat, skipPubKey: payload.sender.pub_key, + realSatsContactId: realSatsContactId, success: () => { }, receive: () => { }, isForwarded: true, @@ -267,6 +253,7 @@ function initTribesSubscriptions() { const msg = message.toString(); // check topic is signed by sender? const payload = yield parseAndVerifyPayload(msg); + payload.network_type = constants_1.default.network_types.mqtt; onReceive(payload); } catch (e) { } @@ -339,7 +326,8 @@ function saveAnonymousKeysend(response, memo, sender_pubkey) { messageContent: memo || '', status: constants_1.default.statuses.confirmed, createdAt: new Date(settleDate), - updatedAt: new Date(settleDate) + updatedAt: new Date(settleDate), + network_type: constants_1.default.network_types.lightning }); socket.sendJson({ type: 'keysend', @@ -396,6 +384,7 @@ function parseKeysendInvoice(i) { if (value && dat && dat.message) { dat.message.amount = value; // ADD IN TRUE VALUE } + dat.network_type = constants_1.default.network_types.lightning; onReceive(dat); } }); diff --git a/dist/src/network/receive.js.map b/dist/src/network/receive.js.map index 52b00a2..2866e22 100644 --- a/dist/src/network/receive.js.map +++ b/dist/src/network/receive.js.map @@ -1 +1 @@ -{"version":3,"file":"receive.js","sourceRoot":"","sources":["../../../src/network/receive.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAqC;AACrC,kDAA0C;AAC1C,gDAAsC;AACtC,0CAAyC;AACzC,kDAA2D;AAC3D,0CAAyC;AACzC,sCAAkC;AAClC,iCAAkC;AAClC,qCAA8G;AAC9G,sCAAiE;AACjE,yCAA8B;AAC9B,0CAAyC;AACzC,0CAAyC;AACzC,gCAAyC;AACzC,4CAAoC;AACpC,2CAA0C;AAE1C;;;;EAIE;AAEF,MAAM,QAAQ,GAAG,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GAAG,EAAE,CAAC,CAAC,CAAC,CAAA;IAChB,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAA;IACf,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAA;IACf,MAAM,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAC,CAAC,EAAC,EAAE,CAAA,CAAC,GAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACzC,MAAM,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,EAAE,CAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,CAAA;IAC9D,IAAG,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,KAAG,QAAQ,CAAC,CAAC,CAAC,EAAC;QAClC,cAAc;QACd,MAAM,GAAG,GAAG,MAAM,CAAC,EAAE,CAAC,CAAA;QACtB,IAAI,OAAO,GAAG,EAAE,CAAA;QAChB,GAAG,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAC,CAAC,EAAC,EAAE,CAAA,CAAC,CAAC,CAAC,GAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAA,EAAE;YAC7C,OAAO,IAAI,GAAG,CAAC,CAAC,CAAA;QACjB,CAAC,CAAC,CAAA;QACF,OAAO,MAAM,CAAC,EAAE,CAAC,CAAA;QACjB,OAAO,OAAO,CAAA;KACd;AACF,CAAC"} \ No newline at end of file diff --git a/dist/src/network/send.js b/dist/src/network/send.js index 3dadfb3..d78148f 100644 --- a/dist/src/network/send.js +++ b/dist/src/network/send.js @@ -20,7 +20,7 @@ const intercept = require("./intercept"); const constants_1 = require("../constants"); function sendMessage(params) { return __awaiter(this, void 0, void 0, function* () { - const { type, chat, message, sender, amount, success, failure, skipPubKey, isForwarded } = params; + const { type, chat, message, sender, amount, success, failure, skipPubKey, isForwarded, realSatsContactId } = params; if (!chat || !sender) return; const isTribe = chat.type === constants_1.default.chat_types.tribe; @@ -88,9 +88,8 @@ function sendMessage(params) { console.log('-> sending to ', contact.id, destkey); let mqttTopic = networkType === 'mqtt' ? `${destkey}/${chatUUID}` : ''; // sending a payment to one subscriber, buying a pic from OG poster - // or keysend such as forwarding boost to og poster - if (isTribeOwner && contactIds.length === 1 && amount && amount > constants_1.default.min_sat_amount && - (msg.type === constants_1.default.message_types.purchase || msg.type === constants_1.default.message_types.keysend)) { + // or boost to og poster + if (isTribeOwner && amount && realSatsContactId === contactId) { mqttTopic = ''; // FORCE KEYSEND!!! } const m = yield msg_1.personalizeMessage(msg, contact, isTribeOwner); diff --git a/dist/src/network/send.js.map b/dist/src/network/send.js.map index 55aa68e..bbd5590 100644 --- a/dist/src/network/send.js.map +++ b/dist/src/network/send.js.map @@ -1 +1 @@ -{"version":3,"file":"send.js","sourceRoot":"","sources":["../../../src/network/send.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAkC;AAClC,0CAAyC;AACzC,0CAAyC;AACzC,sCAA+D;AAC/D,0CAAyC;AACzC,gEAAuE;AACvE,uCAAwC;AACxC,yCAAwC;AACxC,4CAAoC;AAIpC,SAAsB,WAAW,CAAC,MAAM;;QACvC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,GAAG,MAAM,CAAA;QACjG,IAAG,CAAC,IAAI,IAAI,CAAC,MAAM;YAAE,OAAM;QAE3B,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,KAAG,mBAAS,CAAC,UAAU,CAAC,KAAK,CAAA;QACtD,IAAI,YAAY,GAAG,OAAO,IAAI,MAAM,CAAC,SAAS,KAAG,IAAI,CAAC,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AC,EAAE;YACvC,IAAI,EAAE,MAAM,CAAC,IAAI,IAAI,mBAAS,CAAC,UAAU,CAAC,MAAM;SAGhD;KACD,CAAA;AACF,CAAC;AAvBD,wBAuBC;AAED,SAAe,YAAY,CAAC,KAAK,EAAE,QAAQ;;QAC1C,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;YAChD,MAAM,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;SAC7C;IACF,CAAC;CAAA;AACD,SAAe,KAAK,CAAC,EAAE;;QACtB,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAA;IACvD,CAAC;CAAA;AAED,oCAAoC;AACpC,iGAAiG;AACjG,IAAI;AACJ,oCAAoC;AACpC,yFAAyF;AACzF,IAAI"} \ No newline at end of file +{"version":3,"file":"send.js","sourceRoot":"","sources":["../../../src/network/send.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAkC;AAClC,0CAAyC;AACzC,0CAAyC;AACzC,sCAA+D;AAC/D,0CAAyC;AACzC,gEAAuE;AACvE,uCAAwC;AACxC,yCAAwC;AACxC,4CAAoC;AAIpC,SAAsB,WAAW,CAAC,MAAM;;QACvC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,iBAAiB,EAAE,GAAG,MAAM,CAAA;QACpH,IAAG,CAAC,IAAI,IAAI,CAAC,MAAM;YAAE,OAAM;QAE3B,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,KAAG,mBAAS,CAAC,UAAU,CAAC,KAAK,CAAA;QACtD,IAAI,YAAY,GAAG,OAAO,IAAI,MAAM,CAAC,SAAS,KAAG,IAAI,CAAC,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,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;YAChD,MAAM,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;SAC7C;IACF,CAAC;CAAA;AACD,SAAe,KAAK,CAAC,EAAE;;QACtB,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAA;IACvD,CAAC;CAAA;AAED,oCAAoC;AACpC,iGAAiG;AACjG,IAAI;AACJ,oCAAoC;AACpC,yFAAyF;AACzF,IAAI"} \ No newline at end of file diff --git a/dist/src/utils/setup.js b/dist/src/utils/setup.js index 682aa3c..1202f96 100644 --- a/dist/src/utils/setup.js +++ b/dist/src/utils/setup.js @@ -49,6 +49,7 @@ function setVersion() { } function migrate() { return __awaiter(this, void 0, void 0, function* () { + addTableColumn('sphinx_messages', 'network_type', 'INTEGER'); addTableColumn('sphinx_chats', 'meta'); addTableColumn('sphinx_contacts', 'tip_amount', 'BIGINT'); addTableColumn('sphinx_contacts', 'last_active', 'DATETIME'); diff --git a/dist/src/utils/setup.js.map b/dist/src/utils/setup.js.map index 96d2d27..19c7e17 100644 --- a/dist/src/utils/setup.js.map +++ b/dist/src/utils/setup.js.map @@ -1 +1 @@ -{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../../src/utils/setup.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,2CAA2C;AAC3C,sCAA6C;AAC7C,iDAAoC;AACpC,iCAAgC;AAChC,sCAAqC;AACrC,gDAAwC;AACxC,6BAA4B;AAC5B,8CAA4D;AAC5D,yBAAyB;AACzB,yCAAkC;AAElC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,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7B,IAAG,CAAC,KAAK;YAAE,OAAM,CAAC,4BAA4B;QAE9C,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAA;QAC1C,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,UAAU,GAAG,EAAE,GAAG;YAC3D,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QAClB,CAAC,CAAC,CAAA;IACJ,CAAC;CAAA;AAED,SAAS,oBAAoB,CAAC,GAAU;IACtC,EAAE,CAAC,SAAS,CAAC,uBAAuB,EAAE,GAAG,EAAE,UAAU,GAAG;QACtD,IAAI,GAAG;YAAE,OAAO,CAAC,GAAG,CAAC,qCAAqC,EAAE,GAAG,CAAC,CAAC;IACnE,CAAC,CAAC,CAAC;AACL,CAAC"} \ No newline at end of file diff --git a/src/constants.ts b/src/constants.ts index 5a43ed7..1ecbcdf 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -58,6 +58,10 @@ const constants = { "keysend": 28, // no e2e "boost": 29, }, + network_types: { + "lightning": 0, + "mqtt": 1, + }, payment_errors: { "timeout": "Timed Out", "no_route": "No Route To Receiver", diff --git a/src/controllers/bots.ts b/src/controllers/bots.ts index 7de4d84..5df2550 100644 --- a/src/controllers/bots.ts +++ b/src/controllers/bots.ts @@ -176,6 +176,7 @@ export async function receiveBotInstall(payload) { const sender_pub_key = dat.sender && dat.sender.pub_key const bot_uuid = dat.bot_uuid const chat_uuid = dat.chat && dat.chat.uuid + if(!chat_uuid || !sender_pub_key) return console.log('no chat uuid or sender pub key') const owner = await models.Contact.findOne({ where: { isOwner: true } }) @@ -298,6 +299,7 @@ export async function receiveBotRes(payload) { const bot_name = dat.bot_name const sender_alias = dat.sender.alias const date_string = dat.message.date + const network_type = dat.network_type||0 if(!chat_uuid) return console.log('=> receiveBotRes Error no chat_uuid') @@ -339,6 +341,7 @@ export async function receiveBotRes(payload) { createdAt: date, updatedAt: date, senderAlias: sender_alias || 'Bot', + network_type } const message = await models.Message.create(msg) socket.sendJson({ diff --git a/src/controllers/chatTribes.ts b/src/controllers/chatTribes.ts index 97e7a0b..83120de 100644 --- a/src/controllers/chatTribes.ts +++ b/src/controllers/chatTribes.ts @@ -114,7 +114,7 @@ export async function joinTribe(req, res){ export async function receiveMemberRequest(payload) { console.log('=> receiveMemberRequest') - const { sender_pub_key, sender_alias, chat_uuid, chat_members, chat_type, isTribeOwner } = await helpers.parseReceiveParams(payload) + const { sender_pub_key, sender_alias, chat_uuid, chat_members, chat_type, isTribeOwner, network_type } = await helpers.parseReceiveParams(payload) const chat = await models.Chat.findOne({ where: { uuid: chat_uuid } }) if (!chat) return console.log('no chat') @@ -170,7 +170,8 @@ export async function receiveMemberRequest(payload) { sender: (theSender && theSender.id) || 0, messageContent:'', remoteMessageContent:'', status: constants.statuses.confirmed, - date: date, createdAt: date, updatedAt: date + date: date, createdAt: date, updatedAt: date, + network_type } if(isTribe) { msg.senderAlias = sender_alias @@ -316,7 +317,7 @@ export async function approveOrRejectMember(req,res) { export async function receiveMemberApprove(payload) { console.log('=> receiveMemberApprove') - const { owner, chat, chat_name, sender } = await helpers.parseReceiveParams(payload) + const { owner, chat, chat_name, sender, network_type } = await helpers.parseReceiveParams(payload) if(!chat) return console.log('no chat') await chat.update({status: constants.chat_statuses.approved}) @@ -328,7 +329,8 @@ export async function receiveMemberApprove(payload) { sender: (sender && sender.id) || 0, messageContent:'', remoteMessageContent:'', status: constants.statuses.confirmed, - date: date, createdAt: date, updatedAt: date + date: date, createdAt: date, updatedAt: date, + network_type } const message = await models.Message.create(msg) socket.sendJson({ @@ -362,7 +364,7 @@ export async function receiveMemberApprove(payload) { export async function receiveMemberReject(payload) { console.log('=> receiveMemberReject') - const { chat, sender, chat_name } = await helpers.parseReceiveParams(payload) + const { chat, sender, chat_name, network_type } = await helpers.parseReceiveParams(payload) if(!chat) return console.log('no chat') await chat.update({status: constants.chat_statuses.rejected}) // dang.. nothing really to do here? @@ -374,7 +376,8 @@ export async function receiveMemberReject(payload) { sender: (sender && sender.id) || 0, messageContent:'', remoteMessageContent:'', status: constants.statuses.confirmed, - date: date, createdAt: date, updatedAt: date + date: date, createdAt: date, updatedAt: date, + network_type } const message = await models.Message.create(msg) socket.sendJson({ @@ -391,7 +394,7 @@ export async function receiveMemberReject(payload) { export async function receiveTribeDelete(payload) { console.log('=> receiveTribeDelete') - const { chat, sender } = await helpers.parseReceiveParams(payload) + const { chat, sender, network_type } = await helpers.parseReceiveParams(payload) if(!chat) return console.log('no chat') // await chat.update({status: constants.chat_statuses.rejected}) // update on tribes server too @@ -403,7 +406,8 @@ export async function receiveTribeDelete(payload) { sender: (sender && sender.id) || 0, messageContent:'', remoteMessageContent:'', status: constants.statuses.confirmed, - date: date, createdAt: date, updatedAt: date + date: date, createdAt: date, updatedAt: date, + network_type } const message = await models.Message.create(msg) socket.sendJson({ diff --git a/src/controllers/chats.ts b/src/controllers/chats.ts index 3ff9a00..8418914 100644 --- a/src/controllers/chats.ts +++ b/src/controllers/chats.ts @@ -67,7 +67,7 @@ export async function kickChatMember(req, res){ export async function receiveGroupKick(payload) { console.log('=> receiveGroupKick') - const { chat, sender, date_string } = await helpers.parseReceiveParams(payload) + const { chat, sender, date_string, network_type } = await helpers.parseReceiveParams(payload) if (!chat) return // const owner = await models.Contact.findOne({where:{isOwner:true}}) @@ -92,6 +92,7 @@ export async function receiveGroupKick(payload) { messageContent:'', remoteMessageContent:'', status: constants.statuses.confirmed, date: date, createdAt: date, updatedAt: date, + network_type } const message = await models.Message.create(msg) @@ -323,7 +324,7 @@ export const deleteChat = async (req, res) => { export async function receiveGroupJoin(payload) { console.log('=> receiveGroupJoin') - const { sender_pub_key, sender_alias, chat_uuid, chat_members, chat_type, isTribeOwner, date_string } = await helpers.parseReceiveParams(payload) + const { sender_pub_key, sender_alias, chat_uuid, chat_members, chat_type, isTribeOwner, date_string, network_type } = await helpers.parseReceiveParams(payload) const chat = await models.Chat.findOne({ where: { uuid: chat_uuid } }) if (!chat) return @@ -393,7 +394,8 @@ export async function receiveGroupJoin(payload) { sender: (theSender && theSender.id) || 0, messageContent:'', remoteMessageContent:'', status: constants.statuses.confirmed, - date: date, createdAt: date, updatedAt: date + date: date, createdAt: date, updatedAt: date, + network_type } if(isTribe) { msg.senderAlias = sender_alias @@ -413,7 +415,7 @@ export async function receiveGroupJoin(payload) { export async function receiveGroupLeave(payload) { console.log('=> receiveGroupLeave') - const { sender_pub_key, chat_uuid, chat_type, sender_alias, isTribeOwner, date_string } = await helpers.parseReceiveParams(payload) + const { sender_pub_key, chat_uuid, chat_type, sender_alias, isTribeOwner, date_string, network_type } = await helpers.parseReceiveParams(payload) const chat = await models.Chat.findOne({ where: { uuid: chat_uuid } }) if (!chat) return @@ -454,7 +456,8 @@ export async function receiveGroupLeave(payload) { sender: (sender && sender.id) || 0, messageContent:'', remoteMessageContent:'', status: constants.statuses.confirmed, - date: date, createdAt: date, updatedAt: date + date: date, createdAt: date, updatedAt: date, + network_type } if(isTribe) { msg.senderAlias = sender_alias diff --git a/src/controllers/invoices.ts b/src/controllers/invoices.ts index ffdc4e5..ce229be 100644 --- a/src/controllers/invoices.ts +++ b/src/controllers/invoices.ts @@ -221,6 +221,7 @@ export const receiveInvoice = async (payload) => { const total_spent = 1 const dat = payload.content || payload const payment_request = dat.message.invoice + const network_type = dat.network_type||0 var date = new Date(); date.setMilliseconds(0) @@ -246,7 +247,8 @@ export const receiveInvoice = async (payload) => { date: new Date(invoiceDate), status: constants.statuses.pending, createdAt: date, - updatedAt: date + updatedAt: date, + network_type: network_type, } const isTribe = chat_type===constants.chat_types.tribe if(isTribe) { diff --git a/src/controllers/media.ts b/src/controllers/media.ts index 21ebe4e..7722c2d 100644 --- a/src/controllers/media.ts +++ b/src/controllers/media.ts @@ -206,6 +206,7 @@ export const purchase = async (req, res) => { chat: {...chat.dataValues, contactIds:[contact_id]}, sender: owner, type: constants.message_types.purchase, + realSatsContactId: contact_id, // ALWAYS will be keysend, so doesnt matter if tribe owner or not message: msg, amount: amount, success: async (data) => { @@ -224,7 +225,7 @@ export const receivePurchase = async (payload) => { var date = new Date(); date.setMilliseconds(0) - const {owner, sender, chat, amount, mediaToken, msg_uuid, chat_type, skip_payment_processing, purchaser_id} = await helpers.parseReceiveParams(payload) + const {owner, sender, chat, amount, mediaToken, msg_uuid, chat_type, skip_payment_processing, purchaser_id, network_type} = await helpers.parseReceiveParams(payload) if(!owner || !sender || !chat) { return console.log('=> group chat not found!') } @@ -238,7 +239,8 @@ export const receivePurchase = async (payload) => { mediaToken: mediaToken, date: date, createdAt: date, - updatedAt: date + updatedAt: date, + network_type }) socket.sendJson({ type: 'purchase', @@ -351,7 +353,7 @@ export const receivePurchaseAccept = async (payload) => { var date = new Date(); date.setMilliseconds(0) - const {owner, sender, chat, mediaToken, mediaKey, mediaType, originalMuid} = await helpers.parseReceiveParams(payload) + const {owner, sender, chat, mediaToken, mediaKey, mediaType, originalMuid, network_type} = await helpers.parseReceiveParams(payload) if(!owner || !sender || !chat) { return console.log('=> no group chat!') } @@ -383,7 +385,8 @@ export const receivePurchaseAccept = async (payload) => { originalMuid:originalMuid||'', date: date, createdAt: date, - updatedAt: date + updatedAt: date, + network_type }) socket.sendJson({ type: 'purchase_accept', @@ -395,7 +398,7 @@ export const receivePurchaseDeny = async (payload) => { console.log('=> receivePurchaseDeny') var date = new Date() date.setMilliseconds(0) - const {owner, sender, chat, amount, mediaToken} = await helpers.parseReceiveParams(payload) + const {owner, sender, chat, amount, mediaToken, network_type} = await helpers.parseReceiveParams(payload) if(!owner || !sender || !chat) { return console.log('=> no group chat!') } @@ -410,7 +413,8 @@ export const receivePurchaseDeny = async (payload) => { mediaToken, date: date, createdAt: date, - updatedAt: date + updatedAt: date, + network_type }) socket.sendJson({ type: 'purchase_deny', @@ -424,7 +428,7 @@ export const receiveAttachment = async (payload) => { var date = new Date(); date.setMilliseconds(0) - const {owner, sender, chat, mediaToken, mediaKey, mediaType, content, msg_id, chat_type, sender_alias, msg_uuid, reply_uuid} = await helpers.parseReceiveParams(payload) + const {owner, sender, chat, mediaToken, mediaKey, mediaType, content, msg_id, chat_type, sender_alias, msg_uuid, reply_uuid, network_type} = await helpers.parseReceiveParams(payload) if(!owner || !sender || !chat) { return console.log('=> no group chat!') } @@ -436,7 +440,8 @@ export const receiveAttachment = async (payload) => { sender: sender.id, date: date, createdAt: date, - updatedAt: date + updatedAt: date, + network_type } if(content) msg.messageContent = content if(mediaToken) msg.mediaToken = mediaToken diff --git a/src/controllers/messages.ts b/src/controllers/messages.ts index 853c283..24d8922 100644 --- a/src/controllers/messages.ts +++ b/src/controllers/messages.ts @@ -11,7 +11,6 @@ import {sendConfirmation} from './confirmations' import * as network from '../network' import * as short from 'short-uuid' import constants from '../constants' -import {forwardBoostSatsToContact} from '../network/receive' export const getMessages = async (req, res) => { const dateToReturn = req.query.date; @@ -200,49 +199,35 @@ export const sendMessage = async (req, res) => { content: remote_text_map || remote_text || text } if(reply_uuid) msgToSend.replyUuid=reply_uuid - network.sendMessage({ + + const sendMessageParams:{[k:string]:any} = { chat: chat, sender: owner, amount: amount||0, type: msgtype, message: msgToSend, - }) + } + // IF BOOST AND TRIBE OWNER NEED TO SEND ACTUAL SATS TO OG POSTER const isTribe = chat.type===constants.chat_types.tribe const isTribeOwner = isTribe && owner.publicKey===chat.ownerPubkey if(isTribeOwner && reply_uuid && boost && amount) { - processTribeAdminBoost(chat, reply_uuid, amount) + const ogMsg = await models.Message.findOne({where:{ + uuid: reply_uuid, + }}) + if(ogMsg && ogMsg.sender) { + sendMessageParams.realSatsContactId = 123 + } } -} -async function processTribeAdminBoost(chat, reply_uuid, amount){ - const ogMsg = await models.Message.findOne({where:{ - uuid: reply_uuid, - }}) - if(ogMsg && ogMsg.sender && ogMsg.sender!==1) { - forwardBoostSatsToContact(chat,ogMsg.sender,amount) - var date = new Date(); - date.setMilliseconds(0) - models.Message.create({ // gen keysend record on owner side - chatId: 0, - type: constants.message_types.keysend, - sender: 1, - amount, - amountMsat: amount*1000, - paymentHash: '', - date: date, - messageContent: '!', - status: constants.statuses.confirmed, - createdAt: date, - updatedAt: date - }) - } + // final send + network.sendMessage(sendMessageParams) } export const receiveMessage = async (payload) => { // console.log('received message', { payload }) - const {owner, sender, chat, content, remote_content, msg_id, chat_type, sender_alias, msg_uuid, date_string, reply_uuid, amount} = await helpers.parseReceiveParams(payload) + const {owner, sender, chat, content, remote_content, msg_id, chat_type, sender_alias, msg_uuid, date_string, reply_uuid, amount, network_type} = await helpers.parseReceiveParams(payload) if(!owner || !sender || !chat) { return console.log('=> no group chat!') } @@ -262,7 +247,8 @@ export const receiveMessage = async (payload) => { messageContent: text, createdAt: date, updatedAt: date, - status: constants.statuses.received + status: constants.statuses.received, + network_type: network_type, } const isTribe = chat_type===constants.chat_types.tribe if(isTribe) { @@ -286,7 +272,7 @@ export const receiveMessage = async (payload) => { export const receiveBoost = async (payload) => { console.log('received boost', { payload }) - const {owner, sender, chat, content, remote_content, chat_type, sender_alias, msg_uuid, date_string, reply_uuid, amount} = await helpers.parseReceiveParams(payload) + const {owner, sender, chat, content, remote_content, chat_type, sender_alias, msg_uuid, date_string, reply_uuid, amount, network_type} = await helpers.parseReceiveParams(payload) if(!owner || !sender || !chat) { return console.log('=> no group chat!') } @@ -306,7 +292,8 @@ export const receiveBoost = async (payload) => { messageContent: text, createdAt: date, updatedAt: date, - status: constants.statuses.received + status: constants.statuses.received, + network_type } const isTribe = chat_type===constants.chat_types.tribe if(isTribe) { diff --git a/src/controllers/payment.ts b/src/controllers/payment.ts index 7944d4d..606c820 100644 --- a/src/controllers/payment.ts +++ b/src/controllers/payment.ts @@ -128,7 +128,7 @@ export const receivePayment = async (payload) => { var date = new Date(); date.setMilliseconds(0) - const {owner, sender, chat, amount, content, mediaType, mediaToken, chat_type, sender_alias, msg_uuid, reply_uuid} = await helpers.parseReceiveParams(payload) + const {owner, sender, chat, amount, content, mediaType, mediaToken, chat_type, sender_alias, msg_uuid, reply_uuid, network_type} = await helpers.parseReceiveParams(payload) if(!owner || !sender || !chat) { return console.log('=> no group chat!') } @@ -142,7 +142,8 @@ export const receivePayment = async (payload) => { amountMsat: parseFloat(amount) * 1000, date: date, createdAt: date, - updatedAt: date + updatedAt: date, + network_type } if(content) msg.messageContent = content if(mediaType) msg.mediaType = mediaType @@ -168,7 +169,7 @@ export const listPayments = async (req, res) => { const limit = (req.query.limit && parseInt(req.query.limit)) || 100 const offset = (req.query.offset && parseInt(req.query.offset)) || 0 - // const MIN_VAL=constants.min_sat_amount + const MIN_VAL=constants.min_sat_amount try { const msgs = await models.Message.findAll({ where:{ @@ -180,12 +181,16 @@ export const listPayments = async (req, res) => { constants.message_types.keysend, ]} }, - // { - // type: constants.message_types.message, // for example /loopout message - // amount: { - // [Op.gt]: MIN_VAL // greater than - // } - // } + { + type: {[Op.or]: [ + constants.message_types.message, // paid bot msgs + constants.message_types.boost, + ]}, + amount: { + [Op.gt]: MIN_VAL // greater than + }, + network_type: constants.network_types.lightning + } ], }, order: [['createdAt', 'desc']], diff --git a/src/helpers.ts b/src/helpers.ts index e059edf..32557dd 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -154,6 +154,7 @@ export async function parseReceiveParams(payload) { const skip_payment_processing = dat.message.skipPaymentProcessing const reply_uuid = dat.message.replyUuid const purchaser_id = dat.message.purchaser + const network_type = dat.network_type||0 const isTribeOwner = dat.isTribeOwner?true:false const isConversation = !chat_type || (chat_type && chat_type == constants.chat_types.conversation) @@ -176,7 +177,7 @@ export async function parseReceiveParams(payload) { } chat = await models.Chat.findOne({ where: { uuid: chat_uuid } }) } - return { owner, sender, chat, sender_pub_key, sender_alias, isTribeOwner, chat_uuid, amount, content, mediaToken, mediaKey, mediaType, originalMuid, chat_type, msg_id, chat_members, chat_name, chat_host, chat_key, remote_content, msg_uuid, date_string, reply_uuid, skip_payment_processing, purchaser_id, sender_photo_url } + return { owner, sender, chat, sender_pub_key, sender_alias, isTribeOwner, chat_uuid, amount, content, mediaToken, mediaKey, mediaType, originalMuid, chat_type, msg_id, chat_members, chat_name, chat_host, chat_key, remote_content, msg_uuid, date_string, reply_uuid, skip_payment_processing, purchaser_id, sender_photo_url, network_type } } async function asyncForEach(array, callback) { diff --git a/src/models/ts/message.ts b/src/models/ts/message.ts index cfd9b5b..0d61aef 100644 --- a/src/models/ts/message.ts +++ b/src/models/ts/message.ts @@ -92,4 +92,7 @@ export default class Message extends Model { @Column replyUuid: string + + @Column(DataType.INTEGER) + network_type: number } \ No newline at end of file diff --git a/src/network/modify.ts b/src/network/modify.ts index 0331fc6..0b4b969 100644 --- a/src/network/modify.ts +++ b/src/network/modify.ts @@ -67,6 +67,7 @@ export async function purchaseFromOriginalSender(payload, chat, purchaser){ sender: owner, type: constants.message_types.purchase, amount: amount, + realSatsContactId: mediaKey.sender, message: { mediaToken: mt, skipPaymentProcessing: true, @@ -87,6 +88,7 @@ export async function purchaseFromOriginalSender(payload, chat, purchaser){ role: constants.chat_roles.reader, }, type: constants.message_types.purchase, + realSatsContactId: ogmsg.sender, message: msg, amount: amount, success: ()=>{}, diff --git a/src/network/receive.ts b/src/network/receive.ts index 8e2388b..f911773 100644 --- a/src/network/receive.ts +++ b/src/network/receive.ts @@ -122,6 +122,7 @@ async function onReceive(payload){ } } // forward boost sats to recipient + let realSatsContactId = null if(payload.type===msgtypes.boost && payload.message.replyUuid) { const ogMsg = await models.Message.findOne({where:{ uuid: payload.message.replyUuid, @@ -129,11 +130,11 @@ async function onReceive(payload){ if(ogMsg && ogMsg.sender && ogMsg.sender!==1) { const amtToForward = payload.message.amount - (chat.pricePerMessage||0) - (chat.escrowAmount||0) if(amtToForward>0) { - forwardBoostSatsToContact(chat,ogMsg.sender,amtToForward) + realSatsContactId = ogMsg.sender } } } - if(doAction) forwardMessageToTribe(payload, senderContact) + if(doAction) forwardMessageToTribe(payload, senderContact, realSatsContactId) else console.log('=> insufficient payment for this action') } if(isTribeOwner && payload.type===msgtypes.purchase) { @@ -183,21 +184,7 @@ async function doTheAction(data){ } } -export async function forwardBoostSatsToContact(chat,contactId:number,amount:number) { - console.log('=> forwardBoostSatsToContact',contactId) - const owner = await models.Contact.findOne({where:{isOwner:true}}) - sendMessage({ - chat: {...chat.dataValues, contactIds:[contactId]}, - sender: owner, - type: constants.message_types.keysend, - amount: amount, - message: { content:'!' }, - success: ()=>{}, - failure: ()=>{} - }) -} - -async function forwardMessageToTribe(ogpayload, sender){ +async function forwardMessageToTribe(ogpayload, sender, realSatsContactId){ // console.log('forwardMessageToTribe') const chat = await models.Chat.findOne({where:{uuid:ogpayload.chat.uuid}}) @@ -224,6 +211,7 @@ async function forwardMessageToTribe(ogpayload, sender){ }, chat: chat, skipPubKey: payload.sender.pub_key, + realSatsContactId: realSatsContactId, success: ()=>{}, receive: ()=>{}, isForwarded: true, @@ -245,6 +233,7 @@ export async function initTribesSubscriptions(){ const msg = message.toString() // check topic is signed by sender? const payload = await parseAndVerifyPayload(msg) + payload.network_type = constants.network_types.mqtt onReceive(payload) } catch(e){} }) @@ -309,7 +298,8 @@ async function saveAnonymousKeysend(response, memo, sender_pubkey) { messageContent: memo||'', status: constants.statuses.confirmed, createdAt: new Date(settleDate), - updatedAt: new Date(settleDate) + updatedAt: new Date(settleDate), + network_type: constants.network_types.lightning }) socket.sendJson({ type:'keysend', @@ -361,7 +351,8 @@ export async function parseKeysendInvoice(i){ const dat = payload if(value && dat && dat.message){ dat.message.amount = value // ADD IN TRUE VALUE - } + } + dat.network_type = constants.network_types.lightning onReceive(dat) } } diff --git a/src/network/send.ts b/src/network/send.ts index f02f890..28b7cf2 100644 --- a/src/network/send.ts +++ b/src/network/send.ts @@ -11,7 +11,7 @@ import constants from '../constants' type NetworkType = undefined | 'mqtt' | 'lightning' export async function sendMessage(params) { - const { type, chat, message, sender, amount, success, failure, skipPubKey, isForwarded } = params + const { type, chat, message, sender, amount, success, failure, skipPubKey, isForwarded, realSatsContactId } = params if(!chat || !sender) return const isTribe = chat.type===constants.chat_types.tribe @@ -83,12 +83,10 @@ export async function sendMessage(params) { console.log('-> sending to ', contact.id, destkey) let mqttTopic = networkType==='mqtt' ? `${destkey}/${chatUUID}` : '' - + // sending a payment to one subscriber, buying a pic from OG poster - // or keysend such as forwarding boost to og poster - if(isTribeOwner && contactIds.length===1 && amount && amount>constants.min_sat_amount && - (msg.type===constants.message_types.purchase || msg.type===constants.message_types.keysend) - ) { + // or boost to og poster + if(isTribeOwner && amount && realSatsContactId===contactId) { mqttTopic = '' // FORCE KEYSEND!!! } diff --git a/src/utils/setup.ts b/src/utils/setup.ts index f92bab0..decfac4 100644 --- a/src/utils/setup.ts +++ b/src/utils/setup.ts @@ -38,6 +38,8 @@ async function setVersion() { async function migrate() { + addTableColumn('sphinx_messages', 'network_type', 'INTEGER') + addTableColumn('sphinx_chats', 'meta') addTableColumn('sphinx_contacts', 'tip_amount', 'BIGINT') From 0b05d98ac5bdbb4a5b3f7ee33330938a72f86aa9 Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Fri, 20 Nov 2020 15:23:40 -0800 Subject: [PATCH 11/38] fixes --- dist/src/controllers/messages.js | 3 ++- dist/src/controllers/messages.js.map | 2 +- dist/src/network/receive.js | 1 + dist/src/network/receive.js.map | 2 +- src/controllers/messages.ts | 3 ++- src/network/receive.ts | 1 + 6 files changed, 8 insertions(+), 4 deletions(-) diff --git a/dist/src/controllers/messages.js b/dist/src/controllers/messages.js index 91133cd..7d1060d 100644 --- a/dist/src/controllers/messages.js +++ b/dist/src/controllers/messages.js @@ -192,7 +192,8 @@ exports.sendMessage = (req, res) => __awaiter(void 0, void 0, void 0, function* uuid: reply_uuid, } }); if (ogMsg && ogMsg.sender) { - sendMessageParams.realSatsContactId = 123; + console.log('=======> ADMIN BOOSTED A MSG to', ogMsg.sender); + sendMessageParams.realSatsContactId = ogMsg.sender; } } // final send diff --git a/dist/src/controllers/messages.js.map b/dist/src/controllers/messages.js.map index f696775..7d67bda 100644 --- a/dist/src/controllers/messages.js.map +++ b/dist/src/controllers/messages.js.map @@ -1 +1 @@ -{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/src/network/receive.js index 7caae4d..1fd85f7 100644 --- a/dist/src/network/receive.js +++ b/dist/src/network/receive.js @@ -145,6 +145,7 @@ function onReceive(payload) { const amtToForward = payload.message.amount - (chat.pricePerMessage || 0) - (chat.escrowAmount || 0); if (amtToForward > 0) { realSatsContactId = ogMsg.sender; + console.log('=======> ADMIN WILL FORWARD BOOST TO', ogMsg.sender); } } } diff --git a/dist/src/network/receive.js.map b/dist/src/network/receive.js.map index 2866e22..1f54e3d 100644 --- a/dist/src/network/receive.js.map +++ b/dist/src/network/receive.js.map @@ -1 +1 @@ -{"version":3,"file":"receive.js","sourceRoot":"","sources":["../../../src/network/receive.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAqC;AACrC,kDAA0C;AAC1C,gDAAsC;AACtC,0CAAyC;AACzC,kDAA2D;AAC3D,0CAAyC;AACzC,sCAAkC;AAClC,iCAAkC;AAClC,qCAA8G;AAC9G,sCAAiE;AACjE,yCAA8B;AAC9B,0CAAyC;AACzC,0CAAyC;AACzC,gCAAyC;AACzC,4CAAoC;AACpC,2CAA0C;AAE1C;;;;EAIE;AAEF,MAAM,QAAQ,GAAG,mBAAS,CAAC,aAAa,CAAA;AAE3B,QAAA,cAAc,GAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,WAAW;IAC3D,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,KAAK;CACpD,CAAA;AACD,MAAM,aAAa,GAAC;IACnB,QAAQ,CAAC,UAAU;CACnB,CAAA;AACD,MAAM,4BAA4B,GAAG;IACpC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,KAAK;CACrD,CAAA;AACY,QAAA,aAAa,GAAC;IAC1B,QAAQ,CAAC,OAAO;IAChB,QAAQ,CAAC,UAAU;IACnB,QAAQ,CAAC,WAAW;IACpB,QAAQ,CAAC,OAAO;CAChB,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AAA,CAAC,CAAC,CAAC,GAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAA,EAAE;YAC7C,OAAO,IAAI,GAAG,CAAC,CAAC,CAAA;QACjB,CAAC,CAAC,CAAA;QACF,OAAO,MAAM,CAAC,EAAE,CAAC,CAAA;QACjB,OAAO,OAAO,CAAA;KACd;AACF,CAAC"} \ No newline at end of file diff --git a/src/controllers/messages.ts b/src/controllers/messages.ts index 24d8922..be6b348 100644 --- a/src/controllers/messages.ts +++ b/src/controllers/messages.ts @@ -216,7 +216,8 @@ export const sendMessage = async (req, res) => { uuid: reply_uuid, }}) if(ogMsg && ogMsg.sender) { - sendMessageParams.realSatsContactId = 123 + console.log('=======> ADMIN BOOSTED A MSG to',ogMsg.sender) + sendMessageParams.realSatsContactId = ogMsg.sender } } diff --git a/src/network/receive.ts b/src/network/receive.ts index f911773..387c4e3 100644 --- a/src/network/receive.ts +++ b/src/network/receive.ts @@ -131,6 +131,7 @@ async function onReceive(payload){ const amtToForward = payload.message.amount - (chat.pricePerMessage||0) - (chat.escrowAmount||0) if(amtToForward>0) { realSatsContactId = ogMsg.sender + console.log('=======> ADMIN WILL FORWARD BOOST TO',ogMsg.sender) } } } From 3852e3900de395d704d0f816e63924c596727318 Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Fri, 20 Nov 2020 15:43:52 -0800 Subject: [PATCH 12/38] amtToForward --- dist/src/network/receive.js | 13 ++++++++----- dist/src/network/receive.js.map | 2 +- dist/src/network/send.js | 5 +++++ dist/src/network/send.js.map | 2 +- src/network/receive.ts | 13 ++++++++----- src/network/send.ts | 5 +++++ 6 files changed, 28 insertions(+), 12 deletions(-) diff --git a/dist/src/network/receive.js b/dist/src/network/receive.js index 1fd85f7..dec1f2e 100644 --- a/dist/src/network/receive.js +++ b/dist/src/network/receive.js @@ -137,20 +137,22 @@ function onReceive(payload) { } // forward boost sats to recipient let realSatsContactId = null; + let amtToForward = 0; if (payload.type === msgtypes.boost && payload.message.replyUuid) { const ogMsg = yield models_1.models.Message.findOne({ where: { uuid: payload.message.replyUuid, } }); if (ogMsg && ogMsg.sender && ogMsg.sender !== 1) { - const amtToForward = payload.message.amount - (chat.pricePerMessage || 0) - (chat.escrowAmount || 0); - if (amtToForward > 0) { + const theAmtToForward = payload.message.amount - (chat.pricePerMessage || 0) - (chat.escrowAmount || 0); + if (theAmtToForward > 0) { realSatsContactId = ogMsg.sender; + amtToForward = theAmtToForward; console.log('=======> ADMIN WILL FORWARD BOOST TO', ogMsg.sender); } } } if (doAction) - forwardMessageToTribe(payload, senderContact, realSatsContactId); + forwardMessageToTribe(payload, senderContact, realSatsContactId, amtToForward); else console.log('=> insufficient payment for this action'); } @@ -205,7 +207,7 @@ function doTheAction(data) { } }); } -function forwardMessageToTribe(ogpayload, sender, realSatsContactId) { +function forwardMessageToTribe(ogpayload, sender, realSatsContactId, amtToForward) { return __awaiter(this, void 0, void 0, function* () { // console.log('forwardMessageToTribe') const chat = yield models_1.models.Chat.findOne({ where: { uuid: ogpayload.chat.uuid } }); @@ -226,9 +228,10 @@ function forwardMessageToTribe(ogpayload, sender, realSatsContactId) { send_1.sendMessage({ type, message, sender: Object.assign(Object.assign(Object.assign({}, owner.dataValues), payload.sender && payload.sender.alias && { alias: payload.sender.alias }), { role: constants_1.default.chat_roles.reader }), + amount: amtToForward || 0, chat: chat, skipPubKey: payload.sender.pub_key, - realSatsContactId: realSatsContactId, + realSatsContactId, success: () => { }, receive: () => { }, isForwarded: true, diff --git a/dist/src/network/receive.js.map b/dist/src/network/receive.js.map index 1f54e3d..e1a4fa2 100644 --- a/dist/src/network/receive.js.map +++ b/dist/src/network/receive.js.map @@ -1 +1 @@ -{"version":3,"file":"receive.js","sourceRoot":"","sources":["../../../src/network/receive.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAqC;AACrC,kDAA0C;AAC1C,gDAAsC;AACtC,0CAAyC;AACzC,kDAA2D;AAC3D,0CAAyC;AACzC,sCAAkC;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AAC,CAAA;IAChB,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAA;IACf,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAA;IACf,MAAM,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAC,CAAC,EAAC,EAAE,CAAA,CAAC,GAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACzC,MAAM,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,EAAE,CAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,CAAA;IAC9D,IAAG,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,KAAG,QAAQ,CAAC,CAAC,CAAC,EAAC;QAClC,cAAc;QACd,MAAM,GAAG,GAAG,MAAM,CAAC,EAAE,CAAC,CAAA;QACtB,IAAI,OAAO,GAAG,EAAE,CAAA;QAChB,GAAG,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAC,CAAC,EAAC,EAAE,CAAA,CAAC,CAAC,CAAC,GAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAA,EAAE;YAC7C,OAAO,IAAI,GAAG,CAAC,CAAC,CAAA;QACjB,CAAC,CAAC,CAAA;QACF,OAAO,MAAM,CAAC,EAAE,CAAC,CAAA;QACjB,OAAO,OAAO,CAAA;KACd;AACF,CAAC"} \ No newline at end of file +{"version":3,"file":"receive.js","sourceRoot":"","sources":["../../../src/network/receive.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAqC;AACrC,kDAA0C;AAC1C,gDAAsC;AACtC,0CAAyC;AACzC,kDAA2D;AAC3D,0CAAyC;AACzC,sCAAkC;AAClC,iCAAkC;A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;IACvB,IAAG,EAAE,CAAC,MAAM,GAAC,CAAC;QAAE,OAAM;IACtB,MAAM,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,CAAA;IAChB,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAA;IACf,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAA;IACf,MAAM,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAC,CAAC,EAAC,EAAE,CAAA,CAAC,GAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACzC,MAAM,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,EAAE,CAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,CAAA;IAC9D,IAAG,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,KAAG,QAAQ,CAAC,CAAC,CAAC,EAAC;QAClC,cAAc;QACd,MAAM,GAAG,GAAG,MAAM,CAAC,EAAE,CAAC,CAAA;QACtB,IAAI,OAAO,GAAG,EAAE,CAAA;QAChB,GAAG,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAC,CAAC,EAAC,EAAE,CAAA,CAAC,CAAC,CAAC,GAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAA,EAAE;YAC7C,OAAO,IAAI,GAAG,CAAC,CAAC,CAAA;QACjB,CAAC,CAAC,CAAA;QACF,OAAO,MAAM,CAAC,EAAE,CAAC,CAAA;QACjB,OAAO,OAAO,CAAA;KACd;AACF,CAAC"} \ No newline at end of file diff --git a/dist/src/network/send.js b/dist/src/network/send.js index d78148f..495fd09 100644 --- a/dist/src/network/send.js +++ b/dist/src/network/send.js @@ -89,6 +89,11 @@ function sendMessage(params) { let mqttTopic = networkType === 'mqtt' ? `${destkey}/${chatUUID}` : ''; // sending a payment to one subscriber, buying a pic from OG poster // or boost to og poster + if (realSatsContactId) { + console.log("REAL SATS CONTACT ID", realSatsContactId); + console.log("is tribe owenr", isTribeOwner); + console.log('amount', amount); + } if (isTribeOwner && amount && realSatsContactId === contactId) { mqttTopic = ''; // FORCE KEYSEND!!! } diff --git a/dist/src/network/send.js.map b/dist/src/network/send.js.map index bbd5590..d5b929c 100644 --- a/dist/src/network/send.js.map +++ b/dist/src/network/send.js.map @@ -1 +1 @@ -{"version":3,"file":"send.js","sourceRoot":"","sources":["../../../src/network/send.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAkC;AAClC,0CAAyC;AACzC,0CAAyC;AACzC,sCAA+D;AAC/D,0CAAyC;AACzC,gEAAuE;AACvE,uCAAwC;AACxC,yCAAwC;AACxC,4CAAoC;AAIpC,SAAsB,WAAW,CAAC,MAAM;;QACvC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,iBAAiB,EAAE,GAAG,MAAM,CAAA;QACpH,IAAG,CAAC,IAAI,IAAI,CAAC,MAAM;YAAE,OAAM;QAE3B,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,KAAG,mBAAS,CAAC,UAAU,CAAC,KAAK,CAAA;QACtD,IAAI,YAAY,GAAG,OAAO,IAAI,MAAM,CAAC,SAAS,KAAG,IAAI,CAAC,WAAW,CAAA;QAEjE,IAAI,SAAS,GAAG,CAAC,MAAM,CAAC,UAAU,IAAE,MAAM,CAAC,CAAA;QAC3C,IAAG,YAAY,IAAI,CAAC,WAAW,EAAE;YAChC,SAAS,mCAAO,CAAC,MAAM,CAAC,UAAU,IAAE,MAAM,CAAC,KAAE,IAAI,EAAC,mBAAS,CAAC,UAAU,CAAC,KAAK,GAAC,CAAA;SAC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CAAC,EAAE;;QACtB,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAA;IACvD,CAAC;CAAA;AAED,oCAAoC;AACpC,iGAAiG;AACjG,IAAI;AACJ,oCAAoC;AACpC,yFAAyF;AACzF,IAAI"} \ No newline at end of file diff --git a/src/network/receive.ts b/src/network/receive.ts index 387c4e3..6096116 100644 --- a/src/network/receive.ts +++ b/src/network/receive.ts @@ -123,19 +123,21 @@ async function onReceive(payload){ } // forward boost sats to recipient let realSatsContactId = null + let amtToForward = 0 if(payload.type===msgtypes.boost && payload.message.replyUuid) { const ogMsg = await models.Message.findOne({where:{ uuid: payload.message.replyUuid, }}) if(ogMsg && ogMsg.sender && ogMsg.sender!==1) { - const amtToForward = payload.message.amount - (chat.pricePerMessage||0) - (chat.escrowAmount||0) - if(amtToForward>0) { + const theAmtToForward = payload.message.amount - (chat.pricePerMessage||0) - (chat.escrowAmount||0) + if(theAmtToForward>0) { realSatsContactId = ogMsg.sender + amtToForward = theAmtToForward console.log('=======> ADMIN WILL FORWARD BOOST TO',ogMsg.sender) } } } - if(doAction) forwardMessageToTribe(payload, senderContact, realSatsContactId) + if(doAction) forwardMessageToTribe(payload, senderContact, realSatsContactId, amtToForward) else console.log('=> insufficient payment for this action') } if(isTribeOwner && payload.type===msgtypes.purchase) { @@ -185,7 +187,7 @@ async function doTheAction(data){ } } -async function forwardMessageToTribe(ogpayload, sender, realSatsContactId){ +async function forwardMessageToTribe(ogpayload, sender, realSatsContactId, amtToForward){ // console.log('forwardMessageToTribe') const chat = await models.Chat.findOne({where:{uuid:ogpayload.chat.uuid}}) @@ -210,9 +212,10 @@ async function forwardMessageToTribe(ogpayload, sender, realSatsContactId){ ...payload.sender&&payload.sender.alias && {alias:payload.sender.alias}, role: constants.chat_roles.reader, }, + amount: amtToForward||0, chat: chat, skipPubKey: payload.sender.pub_key, - realSatsContactId: realSatsContactId, + realSatsContactId, success: ()=>{}, receive: ()=>{}, isForwarded: true, diff --git a/src/network/send.ts b/src/network/send.ts index 28b7cf2..ca40efc 100644 --- a/src/network/send.ts +++ b/src/network/send.ts @@ -86,6 +86,11 @@ export async function sendMessage(params) { // sending a payment to one subscriber, buying a pic from OG poster // or boost to og poster + if(realSatsContactId) { + console.log("REAL SATS CONTACT ID",realSatsContactId) + console.log("is tribe owenr",isTribeOwner) + console.log('amount', amount) + } if(isTribeOwner && amount && realSatsContactId===contactId) { mqttTopic = '' // FORCE KEYSEND!!! } From af2798b68c7e1b4c1db30dba7fbac04709b3272a Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Fri, 20 Nov 2020 15:45:20 -0800 Subject: [PATCH 13/38] amtToForwardToRealSatsContactId --- dist/src/network/receive.js | 4 ++-- dist/src/network/receive.js.map | 2 +- src/network/receive.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dist/src/network/receive.js b/dist/src/network/receive.js index dec1f2e..e576626 100644 --- a/dist/src/network/receive.js +++ b/dist/src/network/receive.js @@ -207,7 +207,7 @@ function doTheAction(data) { } }); } -function forwardMessageToTribe(ogpayload, sender, realSatsContactId, amtToForward) { +function forwardMessageToTribe(ogpayload, sender, realSatsContactId, amtToForwardToRealSatsContactId) { return __awaiter(this, void 0, void 0, function* () { // console.log('forwardMessageToTribe') const chat = yield models_1.models.Chat.findOne({ where: { uuid: ogpayload.chat.uuid } }); @@ -228,7 +228,7 @@ function forwardMessageToTribe(ogpayload, sender, realSatsContactId, amtToForwar send_1.sendMessage({ type, message, sender: Object.assign(Object.assign(Object.assign({}, owner.dataValues), payload.sender && payload.sender.alias && { alias: payload.sender.alias }), { role: constants_1.default.chat_roles.reader }), - amount: amtToForward || 0, + amount: amtToForwardToRealSatsContactId || 0, chat: chat, skipPubKey: payload.sender.pub_key, realSatsContactId, diff --git a/dist/src/network/receive.js.map b/dist/src/network/receive.js.map index e1a4fa2..c81deb8 100644 --- a/dist/src/network/receive.js.map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CAAC,CAAC,CAAA;QACjB,CAAC,CAAC,CAAA;QACF,OAAO,MAAM,CAAC,EAAE,CAAC,CAAA;QACjB,OAAO,OAAO,CAAA;KACd;AACF,CAAC"} \ No newline at end of file +{"version":3,"file":"receive.js","sourceRoot":"","sources":["../../../src/network/receive.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAqC;AACrC,kDAA0C;AAC1C,gDAAsC;AACtC,0CAAyC;AACzC,kDAA2D;AAC3D,0CAAyC;AACzC,sCAAkC;AAClC,iCAAkC;AAClC,qCAA8G;AAC9G,sCAAiE;AACjE,yCAA8B;AAC9B,0CAAyC;AACzC,0CAAyC;AACzC,gCAAyC;AACzC,4CAAoC;AACpC,2CAA0C;AAE1C;;;;EAIE;AAEF,MAAM,QAAQ,GAAG,mBAAS,CAAC,aAAa,CAAA;AAE3B,QAAA,cAAc,GAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,WAAW;IAC3D,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,KAAK;CACpD,CAAA;AACD,MAAM,aAAa,GAAC;IACnB,QAAQ,CAAC,UAAU;CACnB,CAAA;AACD,MAAM,4BAA4B,GAAG;IACpC,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,KAAK;CACrD,CAAA;AACY,QAAA,aAAa,GAAC;IAC1B,QAAQ,CAAC,OAAO;IAChB,QAAQ,CAAC,UAAU;IACnB,QAAQ,CAAC,WAAW;IACpB,QAAQ,CAAC,OAAO;CAChB,CAAA;AACD,MAAM,QAAQ,GAAC;IACd,mBAAS,CAAC,aAAa,CAAC,WAAW;IACnC,mBAAS,CAAC,aAAa,CAAC,OAAO;IAC/B,mBAAS,CAAC,aAAa,CAAC,OAAO;CAC/B,CAAA;AACD,MAAM,aAAa,GAAC;IACnB,mBAAS,CAAC,aAAa,CAAC,WAAW;IACnC,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,CAAC,CAAC,GAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAA,EAAE;YAC7C,OAAO,IAAI,GAAG,CAAC,CAAC,CAAA;QACjB,CAAC,CAAC,CAAA;QACF,OAAO,MAAM,CAAC,EAAE,CAAC,CAAA;QACjB,OAAO,OAAO,CAAA;KACd;AACF,CAAC"} \ No newline at end of file diff --git a/src/network/receive.ts b/src/network/receive.ts index 6096116..bfb3eba 100644 --- a/src/network/receive.ts +++ b/src/network/receive.ts @@ -187,7 +187,7 @@ async function doTheAction(data){ } } -async function forwardMessageToTribe(ogpayload, sender, realSatsContactId, amtToForward){ +async function forwardMessageToTribe(ogpayload, sender, realSatsContactId, amtToForwardToRealSatsContactId){ // console.log('forwardMessageToTribe') const chat = await models.Chat.findOne({where:{uuid:ogpayload.chat.uuid}}) @@ -212,7 +212,7 @@ async function forwardMessageToTribe(ogpayload, sender, realSatsContactId, amtTo ...payload.sender&&payload.sender.alias && {alias:payload.sender.alias}, role: constants.chat_roles.reader, }, - amount: amtToForward||0, + amount: amtToForwardToRealSatsContactId||0, chat: chat, skipPubKey: payload.sender.pub_key, realSatsContactId, From 31fb7fbdf1ce72ccbd4da76809396f69ee827590 Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Fri, 20 Nov 2020 16:05:22 -0800 Subject: [PATCH 14/38] fixes, cleanup --- dist/src/controllers/messages.js | 3 +-- dist/src/controllers/messages.js.map | 2 +- dist/src/network/receive.js | 1 - dist/src/network/receive.js.map | 2 +- dist/src/network/send.js | 5 ----- dist/src/network/send.js.map | 2 +- src/controllers/messages.ts | 4 +--- src/network/receive.ts | 1 - src/network/send.ts | 5 ----- 9 files changed, 5 insertions(+), 20 deletions(-) diff --git a/dist/src/controllers/messages.js b/dist/src/controllers/messages.js index 7d1060d..692dbcf 100644 --- a/dist/src/controllers/messages.js +++ b/dist/src/controllers/messages.js @@ -192,7 +192,6 @@ exports.sendMessage = (req, res) => __awaiter(void 0, void 0, void 0, function* uuid: reply_uuid, } }); if (ogMsg && ogMsg.sender) { - console.log('=======> ADMIN BOOSTED A MSG to', ogMsg.sender); sendMessageParams.realSatsContactId = ogMsg.sender; } } @@ -241,8 +240,8 @@ exports.receiveMessage = (payload) => __awaiter(void 0, void 0, void 0, function confirmations_1.sendConfirmation({ chat: theChat, sender: owner, msg_id }); }); exports.receiveBoost = (payload) => __awaiter(void 0, void 0, void 0, function* () { - console.log('received boost', { payload }); const { owner, sender, chat, content, remote_content, chat_type, sender_alias, msg_uuid, date_string, reply_uuid, amount, network_type } = yield helpers.parseReceiveParams(payload); + console.log('received boost ' + amount + ' sats on network:', network_type); if (!owner || !sender || !chat) { return console.log('=> no group chat!'); } diff --git a/dist/src/controllers/messages.js.map b/dist/src/controllers/messages.js.map index 7d67bda..7527aef 100644 --- a/dist/src/controllers/messages.js.map +++ b/dist/src/controllers/messages.js.map @@ -1 +1 @@ -{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/controllers/messages.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,yCAA8B;AAC9B,2CAAoC;AACpC,gCAAyC;AACzC,0CAAyC;AACzC,2CAA0C;AAC1C,sCAAqC;AACrC,sCAA+C;AAC/C,0CAAyC;AACzC,mDAAgD;AAChD,sCAAqC;AACrC,oCAAmC;AACnC,4CAAoC;AAEvB,QAAA,WAAW,GAAG,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;IAC7C,MAAM,YAAY,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;IAEpC,IAAI,CAAC,YAAY,EAAE;QAClB,OAAO,sBAAc,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;KAC/B;IACD,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;IACzB,MAAM,KAAK,GAAG,MAAM,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,CAAA;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,IAAI,EAAE,CAAC,CAAC;QAClC,aAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;QAChB,sBAAgB,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;QACnC,MAAM,CAAC,QAAQ,CAAC;YACf,IAAI,EAAE,WAAW;YACjB,QAAQ,EAAE,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC;SACpC,CAAC,CAAA;KACF;SAAM;QACN,aAAO,CAAC,GAAG,EAAE,SAAS,CAAC,CAAA;KACvB;AACF,CAAC,CAAA,CAAA;AAEY,QAAA,aAAa,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IACzC,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;IAErD,aAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;AACjB,CAAC,CAAA"} \ No newline at end of file +{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/controllers/messages.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,yCAA8B;AAC9B,2CAAoC;AACpC,gCAAyC;AACzC,0CAAyC;AACzC,2CAA0C;AAC1C,sCAAqC;AACrC,sCAA+C;AAC/C,0CAAyC;AACzC,mDAAgD;AAChD,sCAAqC;AACrC,oCAAmC;AACnC,4CAAoC;AAEvB,QAAA,WAAW,GAAG,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;IAC7C,MAAM,YAAY,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;IAEpC,IAAI,CAAC,YAAY,EAAE;QAClB,OAAO,sBAAc,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;KAC/B;IACD,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;IACzB,MAAM,KAAK,GAAG,MAAM,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,OAAO,EAA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,aAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;QAChB,sBAAgB,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;QACnC,MAAM,CAAC,QAAQ,CAAC;YACf,IAAI,EAAE,WAAW;YACjB,QAAQ,EAAE,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC;SACpC,CAAC,CAAA;KACF;SAAM;QACN,aAAO,CAAC,GAAG,EAAE,SAAS,CAAC,CAAA;KACvB;AACF,CAAC,CAAA,CAAA;AAEY,QAAA,aAAa,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IACzC,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;IAErD,aAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;AACjB,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/src/network/receive.js b/dist/src/network/receive.js index e576626..a971a60 100644 --- a/dist/src/network/receive.js +++ b/dist/src/network/receive.js @@ -147,7 +147,6 @@ function onReceive(payload) { if (theAmtToForward > 0) { realSatsContactId = ogMsg.sender; amtToForward = theAmtToForward; - console.log('=======> ADMIN WILL FORWARD BOOST TO', ogMsg.sender); } } } diff --git a/dist/src/network/receive.js.map b/dist/src/network/receive.js.map index c81deb8..8786a0b 100644 --- a/dist/src/network/receive.js.map +++ b/dist/src/network/receive.js.map @@ -1 +1 @@ -{"version":3,"file":"receive.js","sourceRoot":"","sources":["../../../src/network/receive.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAqC;AACrC,kDAA0C;AAC1C,gDAAsC;AACtC,0CAAyC;AACzC,kDAA2D;AAC3D,0CAAyC;AACzC,sCAAkC;AAClC,iCAAkC;AAClC,qCAA8G;AAC9G,sCAAiE;AACjE,yCAA8B;AAC9B,0CAAyC;AACzC,0CAAyC;AACzC,gCAAyC;AACzC,4CAAoC;AACpC,2CAA0C;AAE1C;;;;E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AAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAA;IACf,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAA;IACf,MAAM,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAC,CAAC,EAAC,EAAE,CAAA,CAAC,GAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACzC,MAAM,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,EAAE,CAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,CAAA;IAC9D,IAAG,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,KAAG,QAAQ,CAAC,CAAC,CAAC,EAAC;QAClC,cAAc;QACd,MAAM,GAAG,GAAG,MAAM,CAAC,EAAE,CAAC,CAAA;QACtB,IAAI,OAAO,GAAG,EAAE,CAAA;QAChB,GAAG,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAC,CAAC,EAAC,EAAE,CAAA,CAAC,CAAC,CAAC,GAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAA,EAAE;YAC7C,OAAO,IAAI,GAAG,CAAC,CAAC,CAAA;QACjB,CAAC,CAAC,CAAA;QACF,OAAO,MAAM,CAAC,EAAE,CAAC,CAAA;QACjB,OAAO,OAAO,CAAA;KACd;AACF,CAAC"} \ No newline at end of file +{"version":3,"file":"receive.js","sourceRoot":"","sources":["../../../src/network/receive.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAqC;AACrC,kDAA0C;AAC1C,gDAAsC;AACtC,0CAAyC;AACzC,kDAA2D;AAC3D,0CAAyC;AACzC,sCAAkC;AAClC,iCAAkC;AAClC,qCAA8G;AAC9G,sCA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AC,CAAC,CAAA;IAChB,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAA;IACf,MAAM,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAA;IACf,MAAM,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,EAAC,CAAC,EAAC,EAAE,CAAA,CAAC,GAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACzC,MAAM,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,EAAE,CAAC,EAAE,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,EAAC,CAAC,CAAA;IAC9D,IAAG,MAAM,CAAC,EAAE,CAAC,CAAC,MAAM,KAAG,QAAQ,CAAC,CAAC,CAAC,EAAC;QAClC,cAAc;QACd,MAAM,GAAG,GAAG,MAAM,CAAC,EAAE,CAAC,CAAA;QACtB,IAAI,OAAO,GAAG,EAAE,CAAA;QAChB,GAAG,CAAC,KAAK,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,EAAC,CAAC,EAAC,EAAE,CAAA,CAAC,CAAC,CAAC,GAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAA,EAAE;YAC7C,OAAO,IAAI,GAAG,CAAC,CAAC,CAAA;QACjB,CAAC,CAAC,CAAA;QACF,OAAO,MAAM,CAAC,EAAE,CAAC,CAAA;QACjB,OAAO,OAAO,CAAA;KACd;AACF,CAAC"} \ No newline at end of file diff --git a/dist/src/network/send.js b/dist/src/network/send.js index 495fd09..d78148f 100644 --- a/dist/src/network/send.js +++ b/dist/src/network/send.js @@ -89,11 +89,6 @@ function sendMessage(params) { let mqttTopic = networkType === 'mqtt' ? `${destkey}/${chatUUID}` : ''; // sending a payment to one subscriber, buying a pic from OG poster // or boost to og poster - if (realSatsContactId) { - console.log("REAL SATS CONTACT ID", realSatsContactId); - console.log("is tribe owenr", isTribeOwner); - console.log('amount', amount); - } if (isTribeOwner && amount && realSatsContactId === contactId) { mqttTopic = ''; // FORCE KEYSEND!!! } diff --git a/dist/src/network/send.js.map b/dist/src/network/send.js.map index d5b929c..bbd5590 100644 --- a/dist/src/network/send.js.map +++ b/dist/src/network/send.js.map @@ -1 +1 @@ -{"version":3,"file":"send.js","sourceRoot":"","sources":["../../../src/network/send.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAkC;AAClC,0CAAyC;AACzC,0CAAyC;AACzC,sCAA+D;AAC/D,0CAAyC;AACzC,gEAAuE;AACvE,uCAAwC;AACxC,yCAAwC;AACxC,4CAAoC;AAIpC,SAAsB,WAAW,CAAC,MAAM;;QACvC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,iBAAiB,EAAE,GAAG,MAAM,CAAA;QACpH,IAAG,CAAC,IAAI,IAAI,CAAC,MAAM;YAAE,OAAM;QAE3B,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,KAAG,mBAAS,CAAC,UAAU,CAAC,KAAK,CAAA;QACtD,IAAI,YAAY,GAAG,OAAO,IAAI,MAAM,CAAC,SAAS,KAAG,IAAI,CAAC,WAAW,CAAA;QAEjE,IAAI,SAAS,GAAG,CAAC,MAAM,CAAC,UAAU,IAAE,MAAM,CAAC,CAAA;QAC3C,IAAG,YAAY,IAAI,CAAC,WAAW,EAAE;YAChC,SAAS,mCAAO,CAAC,MAAM,CAAC,UAAU,IAAE,MAAM,CAAC,KAAE,IAAI,EAAC,mBAAS,CAAC,UAAU,CAAC,KAAK,GAAC,CAAA;SAC7E;QACD,IAAI,GAAG,GAAG,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,CAAA;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,KAAK,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC;SAC7C;IACF,CAAC;CAAA;AACD,SAAe,KAAK,CAAC,EAAE;;QACtB,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAA;IACvD,CAAC;CAAA;AAED,oCAAoC;AACpC,iGAAiG;AACjG,IAAI;AACJ,oCAAoC;AACpC,yFAAyF;AACzF,IAAI"} \ No newline at end of file +{"version":3,"file":"send.js","sourceRoot":"","sources":["../../../src/network/send.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAkC;AAClC,0CAAyC;AACzC,0CAAyC;AACzC,sCAA+D;AAC/D,0CAAyC;AACzC,gEAAuE;AACvE,uCAAwC;AACxC,yCAAwC;AACxC,4CAAoC;AAIpC,SAAsB,WAAW,CAAC,MAAM;;QACvC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,iBAAiB,EAAE,GAAG,MAAM,CAAA;QACpH,IAAG,CAAC,IAAI,IAAI,CAAC,MAAM;YAAE,OAAM;QAE3B,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,KAAG,mBAAS,CAAC,UAAU,CAAC,KAAK,CAAA;QACtD,IAAI,YAAY,GAAG,OAAO,IAAI,MAAM,CAAC,SAAS,KAAG,IAAI,CAAC,WAAW,CAAA;QAEjE,IAAI,SAAS,GAAG,CAAC,MAAM,CAAC,UAAU,IAAE,MAAM,CAAC,CAAA;QAC3C,IAAG,YAAY,IAAI,CAAC,WAAW,EAAE;YAChC,SAAS,mCAAO,CAAC,MAAM,CAAC,UAAU,IAAE,MAAM,CAAC,KAAE,IAAI,EAAC,mBAAS,CAAC,UAAU,CAAC,KAAK,GAAC,CAAA;SAC7E;QACD,IAAI,GAAG,GAAG,MAAM,CAAC,IAAI,EAAE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AAE,CAAC,CAAC,CAAA;IACvD,CAAC;CAAA;AAED,oCAAoC;AACpC,iGAAiG;AACjG,IAAI;AACJ,oCAAoC;AACpC,yFAAyF;AACzF,IAAI"} \ No newline at end of file diff --git a/src/controllers/messages.ts b/src/controllers/messages.ts index be6b348..0dbb7e6 100644 --- a/src/controllers/messages.ts +++ b/src/controllers/messages.ts @@ -216,7 +216,6 @@ export const sendMessage = async (req, res) => { uuid: reply_uuid, }}) if(ogMsg && ogMsg.sender) { - console.log('=======> ADMIN BOOSTED A MSG to',ogMsg.sender) sendMessageParams.realSatsContactId = ogMsg.sender } } @@ -271,9 +270,8 @@ export const receiveMessage = async (payload) => { } export const receiveBoost = async (payload) => { - console.log('received boost', { payload }) - const {owner, sender, chat, content, remote_content, chat_type, sender_alias, msg_uuid, date_string, reply_uuid, amount, network_type} = await helpers.parseReceiveParams(payload) + console.log('received boost ' +amount+ ' sats on network:', network_type) if(!owner || !sender || !chat) { return console.log('=> no group chat!') } diff --git a/src/network/receive.ts b/src/network/receive.ts index bfb3eba..3eef45b 100644 --- a/src/network/receive.ts +++ b/src/network/receive.ts @@ -133,7 +133,6 @@ async function onReceive(payload){ if(theAmtToForward>0) { realSatsContactId = ogMsg.sender amtToForward = theAmtToForward - console.log('=======> ADMIN WILL FORWARD BOOST TO',ogMsg.sender) } } } diff --git a/src/network/send.ts b/src/network/send.ts index ca40efc..28b7cf2 100644 --- a/src/network/send.ts +++ b/src/network/send.ts @@ -86,11 +86,6 @@ export async function sendMessage(params) { // sending a payment to one subscriber, buying a pic from OG poster // or boost to og poster - if(realSatsContactId) { - console.log("REAL SATS CONTACT ID",realSatsContactId) - console.log("is tribe owenr",isTribeOwner) - console.log('amount', amount) - } if(isTribeOwner && amount && realSatsContactId===contactId) { mqttTopic = '' // FORCE KEYSEND!!! } From 494f7d86a805325e55556b38daff267786a62f49 Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Mon, 23 Nov 2020 14:51:37 -0800 Subject: [PATCH 15/38] auto-unlock, post unlock for voltage --- app.ts | 62 +++------------ dist/app.js | 61 ++++----------- dist/app.js.map | 2 +- dist/src/auth.js | 129 ++++++++++++++++++++++++++++++++ dist/src/auth.js.map | 1 + dist/src/grpc/index.js | 2 +- dist/src/grpc/index.js.map | 2 +- dist/src/utils/lightning.js | 19 ++++- dist/src/utils/lightning.js.map | 2 +- dist/src/utils/macaroon.js | 22 ++++++ dist/src/utils/macaroon.js.map | 1 + dist/src/utils/unlock.js | 45 +++++++++++ dist/src/utils/unlock.js.map | 1 + package-lock.json | 5 ++ package.json | 1 + src/auth.ts | 124 ++++++++++++++++++++++++++++++ src/grpc/index.ts | 2 +- src/utils/lightning.ts | 21 +++++- src/utils/macaroon.ts | 20 +++++ src/utils/unlock.ts | 34 +++++++++ 20 files changed, 451 insertions(+), 105 deletions(-) create mode 100644 dist/src/auth.js create mode 100644 dist/src/auth.js.map create mode 100644 dist/src/utils/macaroon.js create mode 100644 dist/src/utils/macaroon.js.map create mode 100644 dist/src/utils/unlock.js create mode 100644 dist/src/utils/unlock.js.map create mode 100644 src/auth.ts create mode 100644 src/utils/macaroon.ts create mode 100644 src/utils/unlock.ts diff --git a/app.ts b/app.ts index 2796e48..a25368d 100644 --- a/app.ts +++ b/app.ts @@ -3,17 +3,15 @@ import * as bodyParser from 'body-parser' import * as helmet from 'helmet' import * as cookieParser from 'cookie-parser' import * as cors from 'cors' -import * as crypto from 'crypto' import * as path from 'path' -import {models} from './src/models' import logger from './src/utils/logger' import {pingHubInterval, checkInvitesHubInterval} from './src/hub' import {setupDatabase, setupDone} from './src/utils/setup' import * as controllers from './src/controllers' import * as socket from './src/utils/socket' import * as network from './src/network' +import {authModule, unlocker} from './src/auth' -let server: any = null const env = process.env.NODE_ENV || 'development'; const config = require(path.join(__dirname, 'config/app.json'))[env]; const port = process.env.PORT || config.node_http_port || 3001 @@ -86,53 +84,17 @@ async function setupApp(){ console.log(`Node listening on ${port}.`); }); - controllers.set(app); - - socket.connect(server) -} - -async function authModule(req, res, next) { - if ( - req.path == '/app' || - req.path == '/' || - req.path == '/info' || - req.path == '/action' || - req.path == '/contacts/tokens' || - req.path == '/latest' || - req.path.startsWith('/static') || - req.path == '/contacts/set_dev' - ) { - next() - return - } - - if (process.env.HOSTING_PROVIDER==='true'){ - // const domain = process.env.INVITE_SERVER - const host = req.headers.origin - console.log('=> host:', host) - const referer = req.headers.referer - console.log('=> referer:', referer) - if (req.path === '/invoices') { - next() - return - } - } - - const token = req.headers['x-user-token'] || req.cookies['x-user-token'] - - if (token == null) { - res.writeHead(401, 'Access invalid for user', {'Content-Type' : 'text/plain'}); - res.end('Invalid credentials'); + // start all routes! + if(!config.unlock) { + controllers.set(app); + socket.connect(server) } else { - const user = await models.Contact.findOne({ where: { isOwner: true }}) - const hashedToken = crypto.createHash('sha256').update(token).digest('base64'); - if (user.authToken == null || user.authToken != hashedToken) { - res.writeHead(401, 'Access invalid for user', {'Content-Type' : 'text/plain'}); - res.end('Invalid credentials'); - } else { - next(); - } + app.post('/unlock', async function(req,res){ + const ok = await unlocker(req,res) + if(ok) { + controllers.set(app); + socket.connect(server) + } + }) } } - -export default server diff --git a/dist/app.js b/dist/app.js index a045ea4..e8a0327 100644 --- a/dist/app.js +++ b/dist/app.js @@ -14,16 +14,14 @@ const bodyParser = require("body-parser"); const helmet = require("helmet"); const cookieParser = require("cookie-parser"); const cors = require("cors"); -const crypto = require("crypto"); const path = require("path"); -const models_1 = require("./src/models"); const logger_1 = require("./src/utils/logger"); const hub_1 = require("./src/hub"); const setup_1 = require("./src/utils/setup"); const controllers = require("./src/controllers"); const socket = require("./src/utils/socket"); const network = require("./src/network"); -let server = null; +const auth_1 = require("./src/auth"); const env = process.env.NODE_ENV || 'development'; const config = require(path.join(__dirname, 'config/app.json'))[env]; const port = process.env.PORT || config.node_http_port || 3001; @@ -86,7 +84,7 @@ function setupApp() { })); app.use(cookieParser()); if (env != 'development') { - app.use(authModule); + app.use(auth_1.authModule); } app.use('/static', express.static('public')); app.get('/app', (req, res) => res.send('INDEX')); @@ -96,51 +94,22 @@ function setupApp() { /* eslint-disable no-console */ console.log(`Node listening on ${port}.`); }); - controllers.set(app); - socket.connect(server); - }); -} -function authModule(req, res, next) { - return __awaiter(this, void 0, void 0, function* () { - if (req.path == '/app' || - req.path == '/' || - req.path == '/info' || - req.path == '/action' || - req.path == '/contacts/tokens' || - req.path == '/latest' || - req.path.startsWith('/static') || - req.path == '/contacts/set_dev') { - next(); - return; - } - if (process.env.HOSTING_PROVIDER === 'true') { - // const domain = process.env.INVITE_SERVER - const host = req.headers.origin; - console.log('=> host:', host); - const referer = req.headers.referer; - console.log('=> referer:', referer); - if (req.path === '/invoices') { - next(); - return; - } - } - const token = req.headers['x-user-token'] || req.cookies['x-user-token']; - if (token == null) { - res.writeHead(401, 'Access invalid for user', { 'Content-Type': 'text/plain' }); - res.end('Invalid credentials'); + // start all routes! + if (!config.unlock) { + controllers.set(app); + socket.connect(server); } else { - const user = yield models_1.models.Contact.findOne({ where: { isOwner: true } }); - const hashedToken = crypto.createHash('sha256').update(token).digest('base64'); - if (user.authToken == null || user.authToken != hashedToken) { - res.writeHead(401, 'Access invalid for user', { 'Content-Type': 'text/plain' }); - res.end('Invalid credentials'); - } - else { - next(); - } + app.post('/unlock', function (req, res) { + return __awaiter(this, void 0, void 0, function* () { + const ok = yield auth_1.unlocker(req, res); + if (ok) { + controllers.set(app); + socket.connect(server); + } + }); + }); } }); } -exports.default = server; //# sourceMappingURL=app.js.map \ No newline at end of file diff --git a/dist/app.js.map b/dist/app.js.map index 12605bb..7cbc04a 100644 --- a/dist/app.js.map +++ b/dist/app.js.map @@ -1 +1 @@ -{"version":3,"file":"app.js","sourceRoot":"","sources":["../app.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,mCAAkC;AAClC,0CAAyC;AACzC,iCAAgC;AAChC,8CAA6C;AAC7C,6BAA4B;AAC5B,iCAAgC;AAChC,6BAA4B;AAC5B,yCAAmC;AACnC,+CAAuC;AACvC,mCAAk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E,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAA;QAEhD,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE;YAC3B,IAAI,GAAG;gBAAE,MAAM,GAAG,CAAC;YACnB,+BAA+B;YAC/B,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,GAAG,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;QAEH,oBAAoB;QACpB,IAAG,CAAC,MAAM,CAAC,MAAM,EAAE;YAClB,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACrB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;SACtB;aAAM;YACN,GAAG,CAAC,IAAI,CAAC,SAAS,EAAE,UAAe,GAAG,EAAC,GAAG;;oBACzC,MAAM,EAAE,GAAG,MAAM,eAAQ,CAAC,GAAG,EAAC,GAAG,CAAC,CAAA;oBAClC,IAAG,EAAE,EAAE;wBACN,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;wBACrB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;qBACtB;gBACF,CAAC;aAAA,CAAC,CAAA;SACF;IACF,CAAC;CAAA"} \ No newline at end of file diff --git a/dist/src/auth.js b/dist/src/auth.js new file mode 100644 index 0000000..51f9811 --- /dev/null +++ b/dist/src/auth.js @@ -0,0 +1,129 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const crypto = require("crypto"); +const models_1 = require("./models"); +const crypto_js_1 = require("crypto-js"); +const path = require("path"); +const res_1 = require("./utils/res"); +const macaroon_1 = require("./utils/macaroon"); +const fs = require('fs'); +const env = process.env.NODE_ENV || 'development'; +const config = require(path.join(__dirname, 'config/app.json'))[env]; +function unlocker(req, res) { + return __awaiter(this, void 0, void 0, function* () { + const { password } = req.body; + if (!password) { + res_1.failure(res, 'no password'); + return false; + } + const encMacPath = config.encrypted_macaroon_path; + if (!encMacPath) { + res_1.failure(res, 'no macaroon path'); + return false; + } + let hexMac; + try { + var encMac = fs.readFileSync(config.encrypted_macaroon_path); + if (!encMac) { + res_1.failure(res, 'no macaroon'); + return false; + } + const decMac = decryptMacaroon(password, encMac); + if (!decMac) { + res_1.failure(res, 'failed to decrypt macaroon'); + return false; + } + hexMac = base64ToHex(decMac); + } + catch (e) { + res_1.failure(res, e); + return false; + } + if (hexMac) { + macaroon_1.setInMemoryMacaroon(hexMac); + res_1.success(res, 'success!'); + return true; + } + else { + res_1.failure(res, 'failed to set macaroon in memory'); + return false; + } + }); +} +exports.unlocker = unlocker; +function authModule(req, res, next) { + return __awaiter(this, void 0, void 0, function* () { + if (req.path == '/app' || + req.path == '/' || + req.path == '/info' || + req.path == '/action' || + req.path == '/contacts/tokens' || + req.path == '/latest' || + req.path.startsWith('/static') || + req.path == '/contacts/set_dev') { + next(); + return; + } + if (process.env.HOSTING_PROVIDER === 'true') { + // const domain = process.env.INVITE_SERVER + const host = req.headers.origin; + console.log('=> host:', host); + const referer = req.headers.referer; + console.log('=> referer:', referer); + if (req.path === '/invoices') { + next(); + return; + } + } + const token = req.headers['x-user-token'] || req.cookies['x-user-token']; + if (token == null) { + res.writeHead(401, 'Access invalid for user', { 'Content-Type': 'text/plain' }); + res.end('Invalid credentials'); + } + else { + const user = yield models_1.models.Contact.findOne({ where: { isOwner: true } }); + const hashedToken = crypto.createHash('sha256').update(token).digest('base64'); + if (user.authToken == null || user.authToken != hashedToken) { + res.writeHead(401, 'Access invalid for user', { 'Content-Type': 'text/plain' }); + res.end('Invalid credentials'); + } + else { + next(); + } + } + }); +} +exports.authModule = authModule; +function decryptMacaroon(password, macaroon) { + try { + const decrypted = crypto_js_1.default.AES.decrypt(macaroon || '', password).toString(crypto_js_1.default.enc.Base64); + const decryptResult = atob(decrypted); + return decryptResult; + } + catch (e) { + console.error('cipher mismatch, macaroon decryption failed'); + console.error(e); + return ''; + } +} +function base64ToHex(str) { + const raw = atob(str); + let result = ''; + for (let i = 0; i < raw.length; i++) { + const hex = raw.charCodeAt(i).toString(16); + result += (hex.length === 2 ? hex : '0' + hex); + } + return result.toUpperCase(); +} +exports.base64ToHex = base64ToHex; +const atob = a => Buffer.from(a, 'base64').toString('binary'); +//# sourceMappingURL=auth.js.map \ No newline at end of file diff --git a/dist/src/auth.js.map b/dist/src/auth.js.map new file mode 100644 index 0000000..fafeb7b --- /dev/null +++ b/dist/src/auth.js.map @@ -0,0 +1 @@ +{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/auth.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,iCAAgC;AAChC,qCAAiC;AACjC,yCAAgC;AAChC,6BAA4B;AAC5B,qCAA8C;AAC9C,+CAAoD;AACpD,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;AAExB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAErE,SAAsB,QAAQ,CAAC,GAAG,EAAE,GAAG;;QACrC,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG,CAAC,IAAI,CAAA;QAC7B,IAAG,CAAC,QAAQ,EAAE;YACZ,aAAO,CAAC,GAAG,EAAE,aAAa,CAAC,CAAA;YAC3B,OAAO,KAAK,CAAA;SACb;QAED,MAAM,UAAU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E,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/src/grpc/index.js b/dist/src/grpc/index.js index 2f94b84..3bcd997 100644 --- a/dist/src/grpc/index.js +++ b/dist/src/grpc/index.js @@ -98,7 +98,7 @@ function subscribeInvoices(parseKeysendInvoice) { }); }); call.on('status', function (status) { - console.log("Status", status); + console.log("Status", status.code, status); // The server is unavailable, trying to reconnect. if (status.code == ERR_CODE_UNAVAILABLE || status.code == ERR_CODE_STREAM_REMOVED) { i = 0; diff --git a/dist/src/grpc/index.js.map b/dist/src/grpc/index.js.map index b022968..b88c2d1 100644 --- a/dist/src/grpc/index.js.map +++ b/dist/src/grpc/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/grpc/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,0CAAyC;AACzC,gCAAsD;AACtD,2CAA0C;AAC1C,+CAA8C;AAC9C,kDAAgD;AAChD,sCAAqC;AACrC,iCAAgC;AAChC,4CAAoC;AAEpC,MAAM,oBAAoB,GAAG,EAAE,CAAA;AAC/B,MAAM,uBAAuB,GAAG,CAAC,CAAA;AAEjC,SAAgB,iBAAiB,CAAC,mBAAmB;IACpD,OAAO,IAAI,OAAO,CAAC,CAAM,OAAO,EAAC,MAAM,EAAC,EAAE;QACzC,MAAM,SAAS,GAAG,MAAM,yBAAa,EAAE,CAAA;QAEvC,IAAI,IAAI,GAAG,SAAS,CAAC,iBAAiB,EAAE,CAAA;QACxC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,UAAe,QAAQ;;gBACtC,IAAI,QAAQ,CAAC,OAAO,CAAC,KAAK,SAAS,EAAE;oBACpC,OAAM;iBACN;gBACD,iDAAiD;gBACjD,IAAG,QAAQ,CAAC,UAAU,EAAE;oBACvB,mBAAmB,CAAC,QAAQ,CAAC,CAAA;iB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EAAE;YACV,UAAU,CAAC,GAAO,EAAE;gBACnB,IAAG,GAAG,KAAG,QAAQ,EAAE,EAAE,iDAAiD;oBACrE,MAAM,cAAc,CAAC,QAAQ,CAAC,CAAA;iBAC9B;YACF,CAAC,CAAA,EAAC,IAAI,CAAC,CAAA;SACP;IACF,CAAC;CAAA"} \ No newline at end of file diff --git a/dist/src/utils/lightning.js b/dist/src/utils/lightning.js index 062e19c..957d900 100644 --- a/dist/src/utils/lightning.js +++ b/dist/src/utils/lightning.js @@ -17,6 +17,7 @@ const sha = require("js-sha256"); const crypto = require("crypto"); const path = require("path"); const constants_1 = require("../constants"); +const macaroon_1 = require("./macaroon"); // var protoLoader = require('@grpc/proto-loader') const env = process.env.NODE_ENV || 'development'; const config = require(path.join(__dirname, '../../config/app.json'))[env]; @@ -29,8 +30,7 @@ var walletUnlocker = null; const loadCredentials = () => { var lndCert = fs.readFileSync(config.tls_location); var sslCreds = grpc.credentials.createSsl(lndCert); - var m = fs.readFileSync(config.macaroon_location); - var macaroon = m.toString('hex'); + var macaroon = macaroon_1.getMacaroon(); var metadata = new grpc.Metadata(); metadata.add('macaroon', macaroon); var macaroonCreds = grpc.credentials.createFromMetadataGenerator((_args, callback) => { @@ -87,6 +87,21 @@ const loadWalletUnlocker = () => { } }; exports.loadWalletUnlocker = loadWalletUnlocker; +const unlockWallet = (wallet_password) => __awaiter(void 0, void 0, void 0, function* () { + return new Promise(function (resolve, reject) { + return __awaiter(this, void 0, void 0, function* () { + let wu = yield loadWalletUnlocker(); + wu.unlockWallet({ wallet_password }, (err, response) => { + if (err) { + reject(err); + return; + } + resolve(response); + }); + }); + }); +}); +exports.unlockWallet = unlockWallet; const getHeaders = (req) => { return { "X-User-Token": req.headers['x-user-token'], diff --git a/dist/src/utils/lightning.js.map b/dist/src/utils/lightning.js.map index e20b9da..1def7bd 100644 --- a/dist/src/utils/lightning.js.map +++ b/dist/src/utils/lightning.js.map @@ -1 +1 @@ -{"version":3,"file":"lightning.js","sourceRo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AE,EAAE,UAAS,GAAG,EAAE,QAAQ;gBAClD,IAAI,GAAG,IAAI,IAAI,EAAE;oBAChB,OAAO,CAAC,QAAQ,CAAC,CAAA;iBACjB;qBAAM;oBACN,MAAM,CAAC,GAAG,CAAC,CAAA;iBACX;YACF,CAAC,CAAC,CAAC;QACJ,CAAC,CAAC,CAAA;IACH,CAAC;CAAA;AAoCC,wCAAc;AAlChB,SAAS,aAAa,CAAC,GAAG;IACzB,IAAI,IAAI,GAAc,EAAE,CAAC;IACzB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAG,EAAE;QAC5C,IAAI,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACjD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KACd;IACF,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACtB,CAAC"} \ No newline at end of file +{"version":3,"file":"lightning.js","sourceRoot":"","sources":["../../../src/utils/lightning.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,yCAAwC;AACxC,yBAAwB;AACxB,6BAA4B;AAC5B,wCAAmC;AACnC,iCAAgC;AAChC,iCAAgC;AAChC,6BAA4B;AAC5B,4CAAoC;AACpC,yCAAsC;AAEtC,kDAAkD;AAClD,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,uBAAuB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AAEzE,MAAM,eAAe,GAAG,UAAU,CAAA;AAichC,0CAAe;AAhcjB,MAAM,wBAAwB,GAAG,SAAS,CAAA;AAicxC,4DAAwB;AA/b1B,IAAI,eAAe,GAAS,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iBACX;YACF,CAAC,CAAC,CAAC;QACJ,CAAC,CAAC,CAAA;IACH,CAAC;CAAA;AAoCC,wCAAc;AAlChB,SAAS,aAAa,CAAC,GAAG;IACzB,IAAI,IAAI,GAAc,EAAE,CAAC;IACzB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAG,EAAE;QAC5C,IAAI,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACjD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KACd;IACF,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACtB,CAAC"} \ No newline at end of file diff --git a/dist/src/utils/macaroon.js b/dist/src/utils/macaroon.js new file mode 100644 index 0000000..32e222a --- /dev/null +++ b/dist/src/utils/macaroon.js @@ -0,0 +1,22 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const fs = require("fs"); +const path = require("path"); +const env = process.env.NODE_ENV || 'development'; +const config = require(path.join(__dirname, '../../config/app.json'))[env]; +let inMemoryMacaroon = ''; // hex encoded +function getMacaroon() { + if (config.unlock) { + return inMemoryMacaroon; + } + else { + const m = fs.readFileSync(config.macaroon_location); + return m.toString('hex'); + } +} +exports.getMacaroon = getMacaroon; +function setInMemoryMacaroon(mac) { + inMemoryMacaroon = mac; +} +exports.setInMemoryMacaroon = setInMemoryMacaroon; +//# sourceMappingURL=macaroon.js.map \ No newline at end of file diff --git a/dist/src/utils/macaroon.js.map b/dist/src/utils/macaroon.js.map new file mode 100644 index 0000000..3358a80 --- /dev/null +++ b/dist/src/utils/macaroon.js.map @@ -0,0 +1 @@ +{"version":3,"file":"macaroon.js","sourceRoot":"","sources":["../../../src/utils/macaroon.ts"],"names":[],"mappings":";;AAAA,yBAAwB;AACxB,6BAA4B;AAE5B,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,uBAAuB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AAE1E,IAAI,gBAAgB,GAAW,EAAE,CAAC,CAAC,cAAc;AAEjD,SAAgB,WAAW;IACzB,IAAG,MAAM,CAAC,MAAM,EAAE;QAChB,OAAO,gBAAgB,CAAA;KACxB;SAAM;QACL,MAAM,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAA;QACnD,OAAO,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;KAC1B;AACH,CAAC;AAPD,kCAOC;AAED,SAAgB,mBAAmB,CAAC,GAAU;IAC5C,gBAAgB,GAAG,GAAG,CAAA;AACxB,CAAC;AAFD,kDAEC"} \ No newline at end of file diff --git a/dist/src/utils/unlock.js b/dist/src/utils/unlock.js new file mode 100644 index 0000000..1d9280d --- /dev/null +++ b/dist/src/utils/unlock.js @@ -0,0 +1,45 @@ +"use strict"; +var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { + function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } + return new (P || (P = Promise))(function (resolve, reject) { + function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } + function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } + function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } + step((generator = generator.apply(thisArg, _arguments || [])).next()); + }); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const path = require("path"); +const lightning_1 = require("./lightning"); +const fs = require('fs'); +const readline = require('readline'); +const env = process.env.NODE_ENV || 'development'; +const config = require(path.join(__dirname, '../../config/app.json'))[env]; +// /relay/.lnd/.lndpwd +function tryToUnlockLND() { + return __awaiter(this, void 0, void 0, function* () { + const p = config.lnd_pwd; + if (!p) + return; + var pwd = getFirstLine(config.lnd_pwd); + if (!pwd) + return; + yield lightning_1.unlockWallet(pwd); + }); +} +exports.tryToUnlockLND = tryToUnlockLND; +function getFirstLine(pathToFile) { + return __awaiter(this, void 0, void 0, function* () { + const readable = fs.createReadStream(pathToFile); + const reader = readline.createInterface({ input: readable }); + const line = yield new Promise((resolve) => { + reader.on('line', (line) => { + reader.close(); + resolve(line); + }); + }); + readable.close(); + return line; + }); +} +//# sourceMappingURL=unlock.js.map \ No newline at end of file diff --git a/dist/src/utils/unlock.js.map b/dist/src/utils/unlock.js.map new file mode 100644 index 0000000..520d844 --- /dev/null +++ b/dist/src/utils/unlock.js.map @@ -0,0 +1 @@ +{"version":3,"file":"unlock.js","sourceRoot":"","sources":["../../../src/utils/unlock.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,6BAA4B;AAC5B,2CAA0C;AAC1C,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;AACxB,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAErC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,uBAAuB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AAE1E,sBAAsB;AAEtB,SAAsB,cAAc;;QAChC,MAAM,CAAC,GAAG,MAAM,CAAC,OAAO,CAAA;QACxB,IAAI,CAAC,CAAC;YAAE,OAAM;QAEd,IAAI,GAAG,GAAG,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QACvC,IAAG,CAAC,GAAG;YAAE,OAAM;QAEf,MAAM,wBAAY,CAAC,GAAG,CAAC,CAAA;IAC3B,CAAC;CAAA;AARD,wCAQC;AAED,SAAe,YAAY,CAAC,UAAU;;QAClC,MAAM,QAAQ,GAAG,EAAE,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;QACjD,MAAM,MAAM,GAAG,QAAQ,CAAC,eAAe,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC7D,MAAM,IAAI,GAAG,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YACvC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;gBACvB,MAAM,CAAC,KAAK,EAAE,CAAC;gBACf,OAAO,CAAC,IAAI,CAAC,CAAC;YAClB,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;QACH,QAAQ,CAAC,KAAK,EAAE,CAAC;QACjB,OAAO,IAAI,CAAC;IAChB,CAAC;CAAA"} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 08b2b66..819f25b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1600,6 +1600,11 @@ "randomfill": "^1.0.3" } }, + "crypto-js": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.0.0.tgz", + "integrity": "sha512-bzHZN8Pn+gS7DQA6n+iUmBfl0hO5DJq++QP3U6uTucDtk/0iGpXd/Gg7CGR0p8tJhofJyaKoWBuJI4eAO00BBg==" + }, "crypto-random-string": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-1.0.0.tgz", diff --git a/package.json b/package.json index 3a6c3e7..6c1355a 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,7 @@ "cron": "^1.7.2", "cron-parser": "^2.13.0", "crypto-browserify": "^3.12.0", + "crypto-js": "^4.0.0", "dateformat": "^3.0.3", "decamelize": "^3.1.1", "express": "^4.16.4", diff --git a/src/auth.ts b/src/auth.ts new file mode 100644 index 0000000..8747f90 --- /dev/null +++ b/src/auth.ts @@ -0,0 +1,124 @@ +import * as crypto from 'crypto' +import { models } from './models' +import cryptoJS from 'crypto-js' +import * as path from 'path' +import { success, failure } from './utils/res' +import {setInMemoryMacaroon} from './utils/macaroon' +const fs = require('fs') + +const env = process.env.NODE_ENV || 'development'; +const config = require(path.join(__dirname, 'config/app.json'))[env]; + +export async function unlocker(req, res): Promise { + const { password } = req.body + if(!password) { + failure(res, 'no password') + return false + } + + const encMacPath = config.encrypted_macaroon_path + if(!encMacPath) { + failure(res, 'no macaroon path') + return false + } + + let hexMac:string + + try { + + var encMac = fs.readFileSync(config.encrypted_macaroon_path); + if(!encMac) { + failure(res, 'no macaroon') + return false + } + + const decMac = decryptMacaroon(password, encMac) + if(!decMac) { + failure(res, 'failed to decrypt macaroon') + return false + } + + hexMac = base64ToHex(decMac) + + } catch(e) { + failure(res, e) + return false + } + + if(hexMac) { + setInMemoryMacaroon(hexMac) + success(res, 'success!') + return true + } else { + failure(res, 'failed to set macaroon in memory') + return false + } +} + +export async function authModule(req, res, next) { + if ( + req.path == '/app' || + req.path == '/' || + req.path == '/info' || + req.path == '/action' || + req.path == '/contacts/tokens' || + req.path == '/latest' || + req.path.startsWith('/static') || + req.path == '/contacts/set_dev' + ) { + next() + return + } + + if (process.env.HOSTING_PROVIDER === 'true') { + // const domain = process.env.INVITE_SERVER + const host = req.headers.origin + console.log('=> host:', host) + const referer = req.headers.referer + console.log('=> referer:', referer) + if (req.path === '/invoices') { + next() + return + } + } + + const token = req.headers['x-user-token'] || req.cookies['x-user-token'] + + if (token == null) { + res.writeHead(401, 'Access invalid for user', { 'Content-Type': 'text/plain' }); + res.end('Invalid credentials'); + } else { + const user = await models.Contact.findOne({ where: { isOwner: true } }) + const hashedToken = crypto.createHash('sha256').update(token).digest('base64'); + if (user.authToken == null || user.authToken != hashedToken) { + res.writeHead(401, 'Access invalid for user', { 'Content-Type': 'text/plain' }); + res.end('Invalid credentials'); + } else { + next(); + } + } +} + +function decryptMacaroon(password: string, macaroon: string) { + try { + const decrypted = cryptoJS.AES.decrypt(macaroon || '', password).toString(cryptoJS.enc.Base64) + const decryptResult = atob(decrypted) + return decryptResult + } catch (e) { + console.error('cipher mismatch, macaroon decryption failed') + console.error(e) + return '' + } +} + +export function base64ToHex (str) { + const raw = atob(str) + let result = '' + for (let i = 0; i < raw.length; i++) { + const hex = raw.charCodeAt(i).toString(16) + result += (hex.length === 2 ? hex : '0' + hex) + } + return result.toUpperCase() +} + +const atob = a => Buffer.from(a, 'base64').toString('binary') diff --git a/src/grpc/index.ts b/src/grpc/index.ts index 875dd7f..9d99c02 100644 --- a/src/grpc/index.ts +++ b/src/grpc/index.ts @@ -95,7 +95,7 @@ export function subscribeInvoices(parseKeysendInvoice) { } }); call.on('status', function(status) { - console.log("Status", status); + console.log("Status", status.code, status); // The server is unavailable, trying to reconnect. if (status.code == ERR_CODE_UNAVAILABLE || status.code == ERR_CODE_STREAM_REMOVED) { i = 0 diff --git a/src/utils/lightning.ts b/src/utils/lightning.ts index 679c15c..8999c3d 100644 --- a/src/utils/lightning.ts +++ b/src/utils/lightning.ts @@ -6,6 +6,7 @@ import * as sha from 'js-sha256' import * as crypto from 'crypto' import * as path from 'path' import constants from '../constants' +import {getMacaroon} from './macaroon' // var protoLoader = require('@grpc/proto-loader') const env = process.env.NODE_ENV || 'development'; @@ -20,8 +21,7 @@ var walletUnlocker = null; const loadCredentials = () => { var lndCert = fs.readFileSync(config.tls_location); var sslCreds = grpc.credentials.createSsl(lndCert); - var m = fs.readFileSync(config.macaroon_location); - var macaroon = m.toString('hex'); + var macaroon = getMacaroon() var metadata = new grpc.Metadata() metadata.add('macaroon', macaroon) var macaroonCreds = grpc.credentials.createFromMetadataGenerator((_args, callback) => { @@ -76,6 +76,22 @@ const loadWalletUnlocker = () => { } } +const unlockWallet = async (wallet_password) => { + return new Promise(async function(resolve, reject) { + let wu = await loadWalletUnlocker() + wu.unlockWallet( + { wallet_password }, + (err, response) => { + if(err) { + reject(err) + return + } + resolve(response) + } + ) + }) +} + const getHeaders = (req) => { return { "X-User-Token": req.headers['x-user-token'], @@ -455,4 +471,5 @@ export { queryRoute, listChannels, channelBalance, + unlockWallet, } diff --git a/src/utils/macaroon.ts b/src/utils/macaroon.ts new file mode 100644 index 0000000..44d3e8d --- /dev/null +++ b/src/utils/macaroon.ts @@ -0,0 +1,20 @@ +import * as fs from 'fs' +import * as path from 'path' + +const env = process.env.NODE_ENV || 'development'; +const config = require(path.join(__dirname, '../../config/app.json'))[env] + +let inMemoryMacaroon: string = ''; // hex encoded + +export function getMacaroon() { + if(config.unlock) { + return inMemoryMacaroon + } else { + const m = fs.readFileSync(config.macaroon_location) + return m.toString('hex'); + } +} + +export function setInMemoryMacaroon(mac:string) { + inMemoryMacaroon = mac +} \ No newline at end of file diff --git a/src/utils/unlock.ts b/src/utils/unlock.ts new file mode 100644 index 0000000..b9b58c2 --- /dev/null +++ b/src/utils/unlock.ts @@ -0,0 +1,34 @@ +import * as path from 'path' +import { unlockWallet } from './lightning' +const fs = require('fs') +const readline = require('readline'); + +const env = process.env.NODE_ENV || 'development'; +const config = require(path.join(__dirname, '../../config/app.json'))[env] + +// /relay/.lnd/.lndpwd + +export async function tryToUnlockLND() { + const p = config.lnd_pwd + if (!p) return + + var pwd = getFirstLine(config.lnd_pwd); + if(!pwd) return + + await unlockWallet(pwd) +} + +async function getFirstLine(pathToFile) { + const readable = fs.createReadStream(pathToFile); + const reader = readline.createInterface({ input: readable }); + const line = await new Promise((resolve) => { + reader.on('line', (line) => { + reader.close(); + resolve(line); + }); + }); + readable.close(); + return line; +} + + From be0f4e736e2f09582cfc2a1f486a9512f203c414 Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Mon, 23 Nov 2020 14:54:06 -0800 Subject: [PATCH 16/38] fix auth path --- dist/src/auth.js | 2 +- dist/src/auth.js.map | 2 +- src/auth.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/src/auth.js b/dist/src/auth.js index 51f9811..7df83e9 100644 --- a/dist/src/auth.js +++ b/dist/src/auth.js @@ -17,7 +17,7 @@ const res_1 = require("./utils/res"); const macaroon_1 = require("./utils/macaroon"); const fs = require('fs'); const env = process.env.NODE_ENV || 'development'; -const config = require(path.join(__dirname, 'config/app.json'))[env]; +const config = require(path.join(__dirname, '../config/app.json'))[env]; function unlocker(req, res) { return __awaiter(this, void 0, void 0, function* () { const { password } = req.body; diff --git a/dist/src/auth.js.map b/dist/src/auth.js.map index fafeb7b..ed5dfe9 100644 --- a/dist/src/auth.js.map +++ b/dist/src/auth.js.map @@ -1 +1 @@ -{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/auth.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,iCAAgC;AAChC,qCAAiC;AACjC,yCAAgC;AAChC,6BAA4B;AAC5B,qCAA8C;AAC9C,+CAAoD;AACpD,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;AAExB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAErE,SAAsB,QAAQ,CAAC,GAAG,EAAE,GAAG;;QACrC,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG,CAAC,IAAI,CAAA;QAC7B,IAAG,CAAC,QAAQ,EAAE;YACZ,aAAO,CAAC,GAAG,EAAE,aAAa,CAAC,CAAA;YAC3B,OAAO,KAAK,CAAA;SACb;QAED,MAAM,UAAU,GAAG,MAAM,CAAC,uBAAuB,CAAA;QACjD,IAAG,CAAC,UAAU,EAAE;YACd,aAAO,CAAC,GAAG,EAAE,kBAAkB,CAAC,CAAA;YAChC,OAAO,KAAK,CAAA;SACb;QAED,IAAI,MAAa,CAAA;QAEjB,IAAI;YAEF,IAAI,MAAM,GAAG,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC;YAC7D,IAAG,CAAC,MAAM,EAAE;gBACV,aAAO,CAAC,GAAG,EAAE,aAAa,CAAC,CAAA;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,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACnC,MAAM,GAAG,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;QAC1C,MAAM,IAAI,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,CAAC,CAAA;KAC/C;IACD,OAAO,MAAM,CAAC,WAAW,EAAE,CAAA;AAC7B,CAAC;AARD,kCAQC;AAED,MAAM,IAAI,GAAG,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA"} \ No newline at end of file diff --git a/src/auth.ts b/src/auth.ts index 8747f90..baa43b1 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -7,7 +7,7 @@ import {setInMemoryMacaroon} from './utils/macaroon' const fs = require('fs') const env = process.env.NODE_ENV || 'development'; -const config = require(path.join(__dirname, 'config/app.json'))[env]; +const config = require(path.join(__dirname, '../config/app.json'))[env]; export async function unlocker(req, res): Promise { const { password } = req.body From b38e17f4edc556ca2d2c258b64d3309b4cb7c06c Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Mon, 23 Nov 2020 14:57:19 -0800 Subject: [PATCH 17/38] log --- dist/src/grpc/index.js | 4 +++- dist/src/grpc/index.js.map | 2 +- src/grpc/index.ts | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/dist/src/grpc/index.js b/dist/src/grpc/index.js index 3bcd997..b5c2707 100644 --- a/dist/src/grpc/index.js +++ b/dist/src/grpc/index.js @@ -138,13 +138,15 @@ function reconnectToLND(innerCtx) { return __awaiter(this, void 0, void 0, function* () { ctx = innerCtx; i++; - console.log(`=> [lnd] reconnecting... attempt #${i}`); + const now = moment().format('YYYY-MM-DD HH:mm:ss').trim(); + console.log(`=> ${now} [lnd] reconnecting... attempt #${i}`); try { yield network.initGrpcSubscriptions(); const now = moment().format('YYYY-MM-DD HH:mm:ss').trim(); console.log(`=> [lnd] reconnected! ${now}`); } catch (e) { + console.log("COULD NOT RECONNECT", e, e.message, e.code); setTimeout(() => __awaiter(this, void 0, void 0, function* () { if (ctx === innerCtx) { // if another retry fires, then this will not run yield reconnectToLND(innerCtx); diff --git a/dist/src/grpc/index.js.map b/dist/src/grpc/index.js.map index b88c2d1..1a0a029 100644 --- a/dist/src/grpc/index.js.map +++ b/dist/src/grpc/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/grpc/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,0CAAyC;AACzC,gCAAsD;AACtD,2CAA0C;AAC1C,+CAA8C;AAC9C,kDAAgD;AAChD,sCAAqC;AACrC,iCAAgC;AAChC,4CAAoC;AAEpC,MAAM,oBAAoB,GAAG,EAAE,CAAA;AAC/B,MAAM,uBAAuB,GAAG,CAAC,CAAA;AAEjC,SAAgB,iBAAiB,CAAC,mBAAmB;IACpD,OAAO,IAAI,OAAO,CAAC,CAAM,OAAO,EAAC,MAAM,EAAC,EAAE;QACzC,MAAM,SAAS,GAAG,MAAM,yBAAa,EAAE,CAAA;QAEvC,IAAI,IAAI,GAAG,SAAS,CAAC,iBAAiB,EAAE,CAAA;QACxC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,UAAe,QAAQ;;gBACtC,IAAI,QAAQ,CAAC,OAAO,CAAC,KAAK,SAAS,EAAE;oBACpC,OAAM;iBACN;gBACD,iDAAiD;gBACjD,IAAG,QAAQ,CAAC,UAAU,EAAE;oBACvB,mBAAmB,CAAC,QAAQ,CAAC,CAAA;iBAC7B;qBAAM;oBAEN,IAAI,qBAAqB,GAAG,WAAW,CAAC,MAAM,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC,CAAC;oBAC5E,IAAI,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OAAM,CAAC,EAAE;YACV,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAC,CAAC,EAAC,CAAC,CAAC,OAAO,EAAC,CAAC,CAAC,IAAI,CAAC,CAAA;YACrD,UAAU,CAAC,GAAO,EAAE;gBACnB,IAAG,GAAG,KAAG,QAAQ,EAAE,EAAE,iDAAiD;oBACrE,MAAM,cAAc,CAAC,QAAQ,CAAC,CAAA;iBAC9B;YACF,CAAC,CAAA,EAAC,IAAI,CAAC,CAAA;SACP;IACF,CAAC;CAAA"} \ No newline at end of file diff --git a/src/grpc/index.ts b/src/grpc/index.ts index 9d99c02..10c8549 100644 --- a/src/grpc/index.ts +++ b/src/grpc/index.ts @@ -132,12 +132,14 @@ var ctx = 0 async function reconnectToLND(innerCtx:number){ ctx = innerCtx i++ - console.log(`=> [lnd] reconnecting... attempt #${i}`) + const now = moment().format('YYYY-MM-DD HH:mm:ss').trim(); + console.log(`=> ${now} [lnd] reconnecting... attempt #${i}`) try { await network.initGrpcSubscriptions() const now = moment().format('YYYY-MM-DD HH:mm:ss').trim(); console.log(`=> [lnd] reconnected! ${now}`) } catch(e) { + console.log("COULD NOT RECONNECT",e,e.message,e.code) setTimeout(async()=>{ // retry each 2 secs if(ctx===innerCtx) { // if another retry fires, then this will not run await reconnectToLND(innerCtx) From a66568b0b935c6fe2d4641f50a9772db1082e290 Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Mon, 23 Nov 2020 15:06:12 -0800 Subject: [PATCH 18/38] refactor LND initial connect --- app.ts | 23 +++++------------------ dist/app.js | 24 +++++------------------- dist/app.js.map | 2 +- dist/src/grpc/index.js | 36 ++++++++++++++++++++---------------- dist/src/grpc/index.js.map | 2 +- src/grpc/index.ts | 35 +++++++++++++++++++---------------- 6 files changed, 51 insertions(+), 71 deletions(-) diff --git a/app.ts b/app.ts index a25368d..3cccfcf 100644 --- a/app.ts +++ b/app.ts @@ -11,6 +11,7 @@ import * as controllers from './src/controllers' import * as socket from './src/utils/socket' import * as network from './src/network' import {authModule, unlocker} from './src/auth' +import * as grpc from './src/grpc' const env = process.env.NODE_ENV || 'development'; const config = require(path.join(__dirname, 'config/app.json'))[env]; @@ -22,8 +23,6 @@ console.log('=> config.node_http_port:',config.node_http_port) process.env.GRPC_SSL_CIPHER_SUITES = 'HIGH+ECDSA' -var i = 0 - // START SETUP! async function start(){ await setupDatabase() @@ -33,25 +32,13 @@ async function start(){ start() async function connectToLND(){ - i++ - console.log(`=> [lnd] connecting... attempt #${i}`) - try { - await network.initGrpcSubscriptions() // LND - await mainSetup() // DB + express - await network.initTribesSubscriptions() // MQTT - } catch(e) { - if(e.details) { - console.log(`=> [lnd] error details: ${e.details}`) - } else { - console.log(`=> [lnd] error: ${e.message}`) - } - setTimeout(async()=>{ // retry each 2 secs - await connectToLND() - },2000) - } + await grpc.reconnectToLND(Math.random()) // recursive + console.log(">> SETUP MAIN") + await mainSetup() } async function mainSetup(){ + await network.initTribesSubscriptions() if (config.hub_api_url) { // pingHubInterval(15000) checkInvitesHubInterval(5000) diff --git a/dist/app.js b/dist/app.js index e8a0327..9ea93f9 100644 --- a/dist/app.js +++ b/dist/app.js @@ -22,6 +22,7 @@ const controllers = require("./src/controllers"); const socket = require("./src/utils/socket"); const network = require("./src/network"); const auth_1 = require("./src/auth"); +const grpc = require("./src/grpc"); const env = process.env.NODE_ENV || 'development'; const config = require(path.join(__dirname, 'config/app.json'))[env]; const port = process.env.PORT || config.node_http_port || 3001; @@ -29,7 +30,6 @@ console.log("=> env:", env); console.log('=> process.env.PORT:', process.env.PORT); console.log('=> config.node_http_port:', config.node_http_port); process.env.GRPC_SSL_CIPHER_SUITES = 'HIGH+ECDSA'; -var i = 0; // START SETUP! function start() { return __awaiter(this, void 0, void 0, function* () { @@ -41,28 +41,14 @@ function start() { start(); function connectToLND() { return __awaiter(this, void 0, void 0, function* () { - i++; - console.log(`=> [lnd] connecting... attempt #${i}`); - try { - yield network.initGrpcSubscriptions(); // LND - yield mainSetup(); // DB + express - yield network.initTribesSubscriptions(); // MQTT - } - catch (e) { - if (e.details) { - console.log(`=> [lnd] error details: ${e.details}`); - } - else { - console.log(`=> [lnd] error: ${e.message}`); - } - setTimeout(() => __awaiter(this, void 0, void 0, function* () { - yield connectToLND(); - }), 2000); - } + yield grpc.reconnectToLND(Math.random()); // recursive + console.log(">> SETUP MAIN"); + yield mainSetup(); }); } function mainSetup() { return __awaiter(this, void 0, void 0, function* () { + yield network.initTribesSubscriptions(); if (config.hub_api_url) { // pingHubInterval(15000) hub_1.checkInvitesHubInterval(5000); diff --git a/dist/app.js.map b/dist/app.js.map index 7cbc04a..93c2c69 100644 --- a/dist/app.js.map +++ b/dist/app.js.map @@ -1 +1 @@ -{"version":3,"file":"app.js","sourceRoot":"","sources":["../app.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,mCAAkC;AAClC,0CAAyC;AACzC,iCAAgC;AAChC,8CAA6C;AAC7C,6BAA4B;AAC5B,6BAA4B;AAC5B,+CAAuC;AACvC,mCAAkE;AAClE,6CAA0D;AAC1D,iDAAgD;AAChD,6CAA4C;AAC5C,yCAAwC;AACxC,qCAA+C;AAE/C,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AACrE,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,MAAM,CAAC,cAAc,IAAI,IAAI,CAAA;AAE9D,OAAO,CAAC,GAAG,CAAC,SAAS,EAAC,GAAG,CAAC,CAAA;AAC1B,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;AACpD,OAAO,CAAC,GAAG,CAAC,2BAA2B,EAAC,MAAM,CAAC,cAAc,CAAC,CAAA;AAE9D,OAAO,CAAC,GAAG,CA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,CAAC;QAC7C,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAA;QAEhD,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE;YAC3B,IAAI,GAAG;gBAAE,MAAM,GAAG,CAAC;YACnB,+BAA+B;YAC/B,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,GAAG,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;QAEH,oBAAoB;QACpB,IAAG,CAAC,MAAM,CAAC,MAAM,EAAE;YAClB,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACrB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;SACtB;aAAM;YACN,GAAG,CAAC,IAAI,CAAC,SAAS,EAAE,UAAe,GAAG,EAAC,GAAG;;oBACzC,MAAM,EAAE,GAAG,MAAM,eAAQ,CAAC,GAAG,EAAC,GAAG,CAAC,CAAA;oBAClC,IAAG,EAAE,EAAE;wBACN,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;wBACrB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;qBACtB;gBACF,CAAC;aAAA,CAAC,CAAA;SACF;IACF,CAAC;CAAA"} \ No newline at end of file diff --git a/dist/src/grpc/index.js b/dist/src/grpc/index.js index b5c2707..cce7053 100644 --- a/dist/src/grpc/index.js +++ b/dist/src/grpc/index.js @@ -136,23 +136,27 @@ var i = 0; var ctx = 0; function reconnectToLND(innerCtx) { return __awaiter(this, void 0, void 0, function* () { - ctx = innerCtx; - i++; - const now = moment().format('YYYY-MM-DD HH:mm:ss').trim(); - console.log(`=> ${now} [lnd] reconnecting... attempt #${i}`); - try { - yield network.initGrpcSubscriptions(); + return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { + ctx = innerCtx; + i++; const now = moment().format('YYYY-MM-DD HH:mm:ss').trim(); - console.log(`=> [lnd] reconnected! ${now}`); - } - catch (e) { - console.log("COULD NOT RECONNECT", e, e.message, e.code); - setTimeout(() => __awaiter(this, void 0, void 0, function* () { - if (ctx === innerCtx) { // if another retry fires, then this will not run - yield reconnectToLND(innerCtx); - } - }), 2000); - } + console.log(`=> ${now} [lnd] reconnecting... attempt #${i}`); + try { + yield network.initGrpcSubscriptions(); + const now = moment().format('YYYY-MM-DD HH:mm:ss').trim(); + console.log(`=> [lnd] connected! ${now}`); + resolve(); + } + catch (e) { + console.log("COULD NOT RECONNECT", e, e.message, e.code); + setTimeout(() => __awaiter(this, void 0, void 0, function* () { + if (ctx === innerCtx) { // if another retry fires, then this will not run + yield reconnectToLND(innerCtx); + } + }), 2000); + } + })); }); } +exports.reconnectToLND = reconnectToLND; //# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/src/grpc/index.js.map b/dist/src/grpc/index.js.map index 1a0a029..d7c70e3 100644 --- a/dist/src/grpc/index.js.map +++ b/dist/src/grpc/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/grpc/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,0CAAyC;AACzC,gCAAsD;AACtD,2CAA0C;AAC1C,+CAA8C;AAC9C,kDAAgD;AAChD,sCAAqC;AACrC,iCAAgC;AAChC,4CAAoC;AAEpC,MAAM,oBAAoB,GAAG,EAAE,CAAA;AAC/B,MAAM,uBAAuB,GAAG,CAAC,CAAA;AAEjC,SAAgB,iBAAiB,CAAC,mBAAmB;IACpD,OAAO,IAAI,OAAO,CAAC,CAAM,OAAO,EAAC,MAAM,EAAC,EAAE;QACzC,MAAM,SAAS,GAAG,MAAM,yBAAa,EAAE,CAAA;QAEvC,IAAI,IAAI,GAAG,SAAS,CAAC,iBAAiB,EAAE,CAAA;QACxC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,UAAe,QAAQ;;gBACtC,IAAI,QAA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,CAAC,CAAA;AACX,SAAsB,cAAc,CAAC,QAAe;;QACnD,OAAO,IAAI,OAAO,CAAE,CAAO,OAAO,EAAC,MAAM,EAAC,EAAE;YAC3C,GAAG,GAAG,QAAQ,CAAA;YACd,CAAC,EAAE,CAAA;YACH,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,IAAI,EAAE,CAAC;YAC1D,OAAO,CAAC,GAAG,CAAC,MAAM,GAAG,mCAAmC,CAAC,EAAE,CAAC,CAAA;YAC5D,IAAI;gBACH,MAAM,OAAO,CAAC,qBAAqB,EAAE,CAAA;gBACrC,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,IAAI,EAAE,CAAC;gBAC1D,OAAO,CAAC,GAAG,CAAC,uBAAuB,GAAG,EAAE,CAAC,CAAA;gBACzC,OAAO,EAAE,CAAA;aACT;YAAC,OAAM,CAAC,EAAE;gBACV,OAAO,CAAC,GAAG,CAAC,qBAAqB,EAAC,CAAC,EAAC,CAAC,CAAC,OAAO,EAAC,CAAC,CAAC,IAAI,CAAC,CAAA;gBACrD,UAAU,CAAC,GAAO,EAAE;oBACnB,IAAG,GAAG,KAAG,QAAQ,EAAE,EAAE,iDAAiD;wBACrE,MAAM,cAAc,CAAC,QAAQ,CAAC,CAAA;qBAC9B;gBACF,CAAC,CAAA,EAAC,IAAI,CAAC,CAAA;aACP;QACF,CAAC,CAAA,CAAC,CAAA;IACH,CAAC;CAAA;AApBD,wCAoBC"} \ No newline at end of file diff --git a/src/grpc/index.ts b/src/grpc/index.ts index 10c8549..4234daa 100644 --- a/src/grpc/index.ts +++ b/src/grpc/index.ts @@ -129,22 +129,25 @@ export function subscribeInvoices(parseKeysendInvoice) { var i = 0 var ctx = 0 -async function reconnectToLND(innerCtx:number){ - ctx = innerCtx - i++ - const now = moment().format('YYYY-MM-DD HH:mm:ss').trim(); - console.log(`=> ${now} [lnd] reconnecting... attempt #${i}`) - try { - await network.initGrpcSubscriptions() +export async function reconnectToLND(innerCtx:number) { + return new Promise( async (resolve,reject)=>{ + ctx = innerCtx + i++ const now = moment().format('YYYY-MM-DD HH:mm:ss').trim(); - console.log(`=> [lnd] reconnected! ${now}`) - } catch(e) { - console.log("COULD NOT RECONNECT",e,e.message,e.code) - setTimeout(async()=>{ // retry each 2 secs - if(ctx===innerCtx) { // if another retry fires, then this will not run - await reconnectToLND(innerCtx) - } - },2000) - } + console.log(`=> ${now} [lnd] reconnecting... attempt #${i}`) + try { + await network.initGrpcSubscriptions() + const now = moment().format('YYYY-MM-DD HH:mm:ss').trim(); + console.log(`=> [lnd] connected! ${now}`) + resolve() + } catch(e) { + console.log("COULD NOT RECONNECT",e,e.message,e.code) + setTimeout(async()=>{ // retry each 2 secs + if(ctx===innerCtx) { // if another retry fires, then this will not run + await reconnectToLND(innerCtx) + } + },2000) + } + }) } From b7f4a7a1b887036c4c43ee500568faf406a7e676 Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Mon, 23 Nov 2020 15:16:23 -0800 Subject: [PATCH 19/38] lg --- dist/src/grpc/index.js | 6 +++++- dist/src/grpc/index.js.map | 2 +- src/grpc/index.ts | 6 +++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/dist/src/grpc/index.js b/dist/src/grpc/index.js index cce7053..0436bc9 100644 --- a/dist/src/grpc/index.js +++ b/dist/src/grpc/index.js @@ -20,6 +20,7 @@ const moment = require("moment"); const constants_1 = require("../constants"); const ERR_CODE_UNAVAILABLE = 14; const ERR_CODE_STREAM_REMOVED = 2; +const ERR_CODE_UNIMPLEMENTED = 12; // locked function subscribeInvoices(parseKeysendInvoice) { return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { const lightning = yield lightning_1.loadLightning(); @@ -148,7 +149,10 @@ function reconnectToLND(innerCtx) { resolve(); } catch (e) { - console.log("COULD NOT RECONNECT", e, e.message, e.code); + console.log(`=> ${now} [lnd] error connecting ${e.message}`); + if (e.code === ERR_CODE_UNIMPLEMENTED) { + console.log("UNLOCK EHRE!!!!!"); + } setTimeout(() => __awaiter(this, void 0, void 0, function* () { if (ctx === innerCtx) { // if another retry fires, then this will not run yield reconnectToLND(innerCtx); diff --git a/dist/src/grpc/index.js.map b/dist/src/grpc/index.js.map index d7c70e3..14049c9 100644 --- a/dist/src/grpc/index.js.map +++ b/dist/src/grpc/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/grpc/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,0CAAyC;AACzC,gCAAsD;AACtD,2CAA0C;AAC1C,+CAA8C;AAC9C,kDAAgD;AAChD,sCAAqC;AACrC,iCAAgC;AAChC,4CAAoC;AAEpC,MAAM,oBAAoB,GAAG,EAAE,CAAA;AAC/B,MAAM,uBAAuB,GAAG,CAAC,CAAA;AAEjC,SAAgB,iBAAiB,CAAC,mBAAmB;IACpD,OAAO,IAAI,OAAO,CAAC,CAAM,OAAO,EAAC,MAAM,EAAC,EAAE;QACzC,MAAM,SAAS,GAAG,MAAM,yBAAa,EAAE,CAAA;QAEvC,IAAI,IAAI,GAAG,SAAS,CAAC,iBAAiB,EAAE,CAAA;QACxC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,UAAe,QAAQ;;gBACtC,IAAI,QAAQ,CAAC,OAAO,CAAC,KAAK,SAAS,EAAE;oBACpC,OAAM;iBACN;gBACD,iDAAiD;gBACjD,IAAG,QAAQ,CAAC,UAAU,EAAE;oBACvB,mBAAmB,CAAC,QAAQ,CAAC,CAAA;iBAC7B;qBAAM;oBAEN,IAAI,qBAAqB,GAAG,WAAW,CAAC,MAAM,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC,CAAC;oBAC5E,IAAI,WAAW,GAAG,EAAE,CAAC;oBACrB,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC,MAAM,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CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,IAAI,EAAE,CAAC;YAC1D,OAAO,CAAC,GAAG,CAAC,MAAM,GAAG,mCAAmC,CAAC,EAAE,CAAC,CAAA;YAC5D,IAAI;gBACH,MAAM,OAAO,CAAC,qBAAqB,EAAE,CAAA;gBACrC,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,IAAI,EAAE,CAAC;gBAC1D,OAAO,CAAC,GAAG,CAAC,uBAAuB,GAAG,EAAE,CAAC,CAAA;gBACzC,OAAO,EAAE,CAAA;aACT;YAAC,OAAM,CAAC,EAAE;gBACV,OAAO,CAAC,GAAG,CAAC,MAAM,GAAG,2BAA2B,CAAC,CAAC,OAAO,EAAE,CAAC,CAAA;gBAC5D,IAAG,CAAC,CAAC,IAAI,KAAG,sBAAsB,EAAE;oBACnC,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAA;iBAC/B;gBACD,UAAU,CAAC,GAAO,EAAE;oBACnB,IAAG,GAAG,KAAG,QAAQ,EAAE,EAAE,iDAAiD;wBACrE,MAAM,cAAc,CAAC,QAAQ,CAAC,CAAA;qBAC9B;gBACF,CAAC,CAAA,EAAC,IAAI,CAAC,CAAA;aACP;QACF,CAAC,CAAA,CAAC,CAAA;IACH,CAAC;CAAA;AAvBD,wCAuBC"} \ No newline at end of file diff --git a/src/grpc/index.ts b/src/grpc/index.ts index 4234daa..4803bbc 100644 --- a/src/grpc/index.ts +++ b/src/grpc/index.ts @@ -10,6 +10,7 @@ import constants from '../constants' const ERR_CODE_UNAVAILABLE = 14 const ERR_CODE_STREAM_REMOVED = 2 +const ERR_CODE_UNIMPLEMENTED = 12 // locked export function subscribeInvoices(parseKeysendInvoice) { return new Promise(async(resolve,reject)=>{ @@ -141,7 +142,10 @@ export async function reconnectToLND(innerCtx:number) { console.log(`=> [lnd] connected! ${now}`) resolve() } catch(e) { - console.log("COULD NOT RECONNECT",e,e.message,e.code) + console.log(`=> ${now} [lnd] error connecting ${e.message}`) + if(e.code===ERR_CODE_UNIMPLEMENTED) { + console.log("UNLOCK EHRE!!!!!") + } setTimeout(async()=>{ // retry each 2 secs if(ctx===innerCtx) { // if another retry fires, then this will not run await reconnectToLND(innerCtx) From 10fbea2e5998dbfa95c14cc7c8001f4731d8e049 Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Mon, 23 Nov 2020 15:20:21 -0800 Subject: [PATCH 20/38] lg --- dist/src/grpc/index.js | 4 ++-- dist/src/grpc/index.js.map | 2 +- dist/src/utils/unlock.js | 6 ++++-- dist/src/utils/unlock.js.map | 2 +- src/grpc/index.ts | 4 ++-- src/utils/unlock.ts | 8 ++++++-- 6 files changed, 16 insertions(+), 10 deletions(-) diff --git a/dist/src/grpc/index.js b/dist/src/grpc/index.js index 0436bc9..539bb72 100644 --- a/dist/src/grpc/index.js +++ b/dist/src/grpc/index.js @@ -18,6 +18,7 @@ const lightning_1 = require("../utils/lightning"); const network = require("../network"); const moment = require("moment"); const constants_1 = require("../constants"); +const unlock_1 = require("../utils/unlock"); const ERR_CODE_UNAVAILABLE = 14; const ERR_CODE_STREAM_REMOVED = 2; const ERR_CODE_UNIMPLEMENTED = 12; // locked @@ -149,9 +150,8 @@ function reconnectToLND(innerCtx) { resolve(); } catch (e) { - console.log(`=> ${now} [lnd] error connecting ${e.message}`); if (e.code === ERR_CODE_UNIMPLEMENTED) { - console.log("UNLOCK EHRE!!!!!"); + yield unlock_1.tryToUnlockLND(); } setTimeout(() => __awaiter(this, void 0, void 0, function* () { if (ctx === innerCtx) { // if another retry fires, then this will not run diff --git a/dist/src/grpc/index.js.map b/dist/src/grpc/index.js.map index 14049c9..82691d8 100644 --- a/dist/src/grpc/index.js.map +++ b/dist/src/grpc/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/grpc/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,0CAAyC;AACzC,g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,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,IAAI,EAAE,CAAC;gBAC1D,OAAO,CAAC,GAAG,CAAC,uBAAuB,GAAG,EAAE,CAAC,CAAA;gBACzC,OAAO,EAAE,CAAA;aACT;YAAC,OAAM,CAAC,EAAE;gBACV,IAAG,CAAC,CAAC,IAAI,KAAG,sBAAsB,EAAE;oBACnC,MAAM,uBAAc,EAAE,CAAA;iBACtB;gBACD,UAAU,CAAC,GAAO,EAAE;oBACnB,IAAG,GAAG,KAAG,QAAQ,EAAE,EAAE,iDAAiD;wBACrE,MAAM,cAAc,CAAC,QAAQ,CAAC,CAAA;qBAC9B;gBACF,CAAC,CAAA,EAAC,IAAI,CAAC,CAAA;aACP;QACF,CAAC,CAAA,CAAC,CAAA;IACH,CAAC;CAAA;AAtBD,wCAsBC"} \ No newline at end of file diff --git a/dist/src/utils/unlock.js b/dist/src/utils/unlock.js index 1d9280d..e09dc66 100644 --- a/dist/src/utils/unlock.js +++ b/dist/src/utils/unlock.js @@ -18,12 +18,14 @@ const config = require(path.join(__dirname, '../../config/app.json'))[env]; // /relay/.lnd/.lndpwd function tryToUnlockLND() { return __awaiter(this, void 0, void 0, function* () { - const p = config.lnd_pwd; + const p = config.lnd_pwd_path; if (!p) return; - var pwd = getFirstLine(config.lnd_pwd); + console.log('==>', p); + var pwd = getFirstLine(config.lnd_pwd_path); if (!pwd) return; + console.log('==>', pwd); yield lightning_1.unlockWallet(pwd); }); } diff --git a/dist/src/utils/unlock.js.map b/dist/src/utils/unlock.js.map index 520d844..4a7a2e9 100644 --- a/dist/src/utils/unlock.js.map +++ b/dist/src/utils/unlock.js.map @@ -1 +1 @@ -{"version":3,"file":"unlock.js","sourceRoot":"","sources":["../../../src/utils/unlock.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,6BAA4B;AAC5B,2CAA0C;AAC1C,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;AACxB,MAAM,QAAQ,GAAG,OAAO,CA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ts index 4803bbc..2d5d482 100644 --- a/src/grpc/index.ts +++ b/src/grpc/index.ts @@ -7,6 +7,7 @@ import {loadLightning} from '../utils/lightning' import * as network from '../network' import * as moment from 'moment' import constants from '../constants' +import {tryToUnlockLND} from '../utils/unlock' const ERR_CODE_UNAVAILABLE = 14 const ERR_CODE_STREAM_REMOVED = 2 @@ -142,9 +143,8 @@ export async function reconnectToLND(innerCtx:number) { console.log(`=> [lnd] connected! ${now}`) resolve() } catch(e) { - console.log(`=> ${now} [lnd] error connecting ${e.message}`) if(e.code===ERR_CODE_UNIMPLEMENTED) { - console.log("UNLOCK EHRE!!!!!") + await tryToUnlockLND() } setTimeout(async()=>{ // retry each 2 secs if(ctx===innerCtx) { // if another retry fires, then this will not run diff --git a/src/utils/unlock.ts b/src/utils/unlock.ts index b9b58c2..88270e7 100644 --- a/src/utils/unlock.ts +++ b/src/utils/unlock.ts @@ -9,12 +9,16 @@ const config = require(path.join(__dirname, '../../config/app.json'))[env] // /relay/.lnd/.lndpwd export async function tryToUnlockLND() { - const p = config.lnd_pwd + const p = config.lnd_pwd_path if (!p) return - var pwd = getFirstLine(config.lnd_pwd); + console.log('==>',p) + + var pwd = getFirstLine(config.lnd_pwd_path); if(!pwd) return + console.log('==>',pwd) + await unlockWallet(pwd) } From f7d015d7fef4f494e66340191cdd8bef7c69d8ea Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Mon, 23 Nov 2020 15:36:45 -0800 Subject: [PATCH 21/38] proto files --- dist/src/utils/lightning.js | 4 +- dist/src/utils/lightning.js.map | 2 +- dist/src/utils/signer.js | 2 +- dist/src/utils/signer.js.map | 2 +- dist/src/utils/unlock.js | 3 +- dist/src/utils/unlock.js.map | 2 +- proto/router.proto | 661 ++++++ proto/rpc.proto | 3640 +++++++++++++++++++++++++++++++ proto/signer.proto | 228 ++ proto/walletunlocker.proto | 238 ++ src/utils/lightning.ts | 4 +- src/utils/signer.ts | 2 +- src/utils/unlock.ts | 4 +- 13 files changed, 4781 insertions(+), 11 deletions(-) create mode 100644 proto/router.proto create mode 100644 proto/rpc.proto create mode 100644 proto/signer.proto create mode 100644 proto/walletunlocker.proto diff --git a/dist/src/utils/lightning.js b/dist/src/utils/lightning.js index 957d900..1713cb1 100644 --- a/dist/src/utils/lightning.js +++ b/dist/src/utils/lightning.js @@ -58,7 +58,7 @@ const loadLightning = () => { else { try { var credentials = loadCredentials(); - var lnrpcDescriptor = grpc.load("rpc.proto"); + var lnrpcDescriptor = grpc.load("proto/rpc.proto"); var lnrpc = lnrpcDescriptor.lnrpc; lightningClient = new lnrpc.Lightning(config.node_ip + ':' + config.lnd_port, credentials); return lightningClient; @@ -76,7 +76,7 @@ const loadWalletUnlocker = () => { else { var credentials = loadCredentials(); try { - var lnrpcDescriptor = grpc.load("rpc.proto"); + var lnrpcDescriptor = grpc.load("proto/walletunlocker.proto"); var lnrpc = lnrpcDescriptor.lnrpc; walletUnlocker = new lnrpc.WalletUnlocker(config.node_ip + ':' + config.lnd_port, credentials); return walletUnlocker; diff --git a/dist/src/utils/lightning.js.map b/dist/src/utils/lightning.js.map index 1def7bd..a6a7ecf 100644 --- a/dist/src/utils/lightning.js.map +++ b/dist/src/utils/lightning.js.map @@ -1 +1 @@ -{"version":3,"file":"lightning.js","sourceRoot":"","sources":["../../../src/utils/lightning.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,yCAAwC;AACxC,yBAAwB;AACxB,6BAA4B;AAC5B,wCAAmC;AACnC,iCAAgC;AAChC,iCAAgC;AAChC,6BAA4B;AAC5B,4CAAoC;AACpC,yCAAsC;AAEtC,kDAAkD;AAClD,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,uBAAuB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AAEzE,MAAM,eAAe,GAAG,UAAU,CAAA;AAichC,0CAAe;AAhc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O,CAAC,QAAQ,CAAC,CAAA;iBACjB;qBAAM;oBACN,MAAM,CAAC,GAAG,CAAC,CAAA;iBACX;YACF,CAAC,CAAC,CAAC;QACJ,CAAC,CAAC,CAAA;IACH,CAAC;CAAA;AAoCC,wCAAc;AAlChB,SAAS,aAAa,CAAC,GAAG;IACzB,IAAI,IAAI,GAAc,EAAE,CAAC;IACzB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAG,EAAE;QAC5C,IAAI,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACjD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KACd;IACF,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACtB,CAAC"} \ No newline at end of file +{"version":3,"file":"lightning.js","sourceRoot":"","sources":["../../../src/utils/lightning.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,yCAAwC;AACxC,yBAAwB;AACxB,6BAA4B;AAC5B,wCAAmC;AACnC,iCAAgC;AAChC,iCAAgC;AAChC,6BAA4B;AAC5B,4CAAoC;AACpC,yCAAsC;AAEtC,kDAAkD;AAClD,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,uBAAuB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AAEzE,MAAM,eAAe,GAAG,UAAU,CAAA;AAichC,0CAAe;AAhcjB,MAAM,wBAAwB,GAAG,SAAS,CAAA;AAicxC,4DAAwB;AA/b1B,IAAI,eAAe,GAAS,IAAI,CAAC;AACjC,IAAI,cAAc,GAAU,IAAI,CAAC;AAEjC,MAAM,eAAe,GAAG,GAAG,EAA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AAc;AAlChB,SAAS,aAAa,CAAC,GAAG;IACzB,IAAI,IAAI,GAAc,EAAE,CAAC;IACzB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAG,EAAE;QAC5C,IAAI,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACjD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KACd;IACF,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACtB,CAAC"} \ No newline at end of file diff --git a/dist/src/utils/signer.js b/dist/src/utils/signer.js index aa4db2a..49a9606 100644 --- a/dist/src/utils/signer.js +++ b/dist/src/utils/signer.js @@ -24,7 +24,7 @@ exports.loadSigner = () => { else { try { var credentials = lightning_1.loadCredentials(); - var lnrpcDescriptor = grpc.load("signer.proto"); + var lnrpcDescriptor = grpc.load("proto/signer.proto"); var signer = lnrpcDescriptor.signrpc; signerClient = new signer.Signer(config.node_ip + ':' + config.lnd_port, credentials); return signerClient; diff --git a/dist/src/utils/signer.js.map b/dist/src/utils/signer.js.map index eb99428..483f047 100644 --- a/dist/src/utils/signer.js.map +++ b/dist/src/utils/signer.js.map @@ -1 +1 @@ -{"version":3,"file":"signer.js","sourceRoot":"","sources":["../../../src/utils/signer.ts"],"names":[],"mappings":";;;;;;;;;;;AACA,6BAA4B;AAC5B,2CAA2C;AAC3C,6BAA4B;AAC5B,yCAAwC;AAExC,kDAAkD;AAClD,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,uBAAuB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AAEzE,IAAI,YAAY,GAAS,IAAI,C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GAAG,CAAA;SACX;QAAC,OAAM,CAAC,EAAE;YACT,MAAM,CAAC,CAAA;SACR;IACH,CAAC;CAAA;AAPD,8BAOC;AAED,SAAsB,WAAW,CAAC,KAAY,EAAC,GAAU,EAAC,MAAa;;QACrE,IAAI;YACF,MAAM,CAAC,GAAG,MAAM,aAAa,CAAC,aAAa,CAAC,KAAK,CAAC,EAAC,GAAG,EAAC,MAAM,CAAC,CAAA;YAC9D,OAAO,CAAC,CAAA;SACT;QAAC,OAAM,CAAC,EAAE;YACT,MAAM,CAAC,CAAA;SACR;IACH,CAAC;CAAA;AAPD,kCAOC;AAED,SAAS,aAAa,CAAC,GAAG;IACzB,IAAI,IAAI,GAAc,EAAE,CAAC;IACzB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAG,EAAE;QAC5C,IAAI,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACjD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KACd;IACF,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACtB,CAAC"} \ No newline at end of file diff --git a/dist/src/utils/unlock.js b/dist/src/utils/unlock.js index e09dc66..4833c59 100644 --- a/dist/src/utils/unlock.js +++ b/dist/src/utils/unlock.js @@ -15,6 +15,7 @@ const fs = require('fs'); const readline = require('readline'); const env = process.env.NODE_ENV || 'development'; const config = require(path.join(__dirname, '../../config/app.json'))[env]; +console.log(JSON.stringify(config, null, 2)); // /relay/.lnd/.lndpwd function tryToUnlockLND() { return __awaiter(this, void 0, void 0, function* () { @@ -22,7 +23,7 @@ function tryToUnlockLND() { if (!p) return; console.log('==>', p); - var pwd = getFirstLine(config.lnd_pwd_path); + var pwd = yield getFirstLine(config.lnd_pwd_path); if (!pwd) return; console.log('==>', pwd); diff --git a/dist/src/utils/unlock.js.map b/dist/src/utils/unlock.js.map index 4a7a2e9..dca74b8 100644 --- a/dist/src/utils/unlock.js.map +++ b/dist/src/utils/unlock.js.map @@ -1 +1 @@ -{"version":3,"file":"unlock.js","sourceRoot":"","sources":["../../../src/utils/unlock.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,6BAA4B;AAC5B,2CAA0C;AAC1C,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;AACxB,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAErC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,uBAAuB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AAE1E,sBAAsB;AAEtB,SAAsB,cAAc;;QAChC,MAAM,CAAC,GAAG,MAAM,CAAC,YAAY,CAAA;QAC7B,IAAI,CAAC,CAAC;YAAE,OAAM;QAEd,OAAO,CAAC,GAAG,CAAC,KAAK,EAAC,CAAC,CAAC,CAAA;QAEpB,IAAI,GAAG,GAAG,YAAY,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;QAC5C,IAAG,CAAC,GAAG;YAAE,OAAM;QAEf,OAAO,CAAC,GAAG,CAAC,KAAK,EAAC,GAAG,CAAC,CAAA;QAEtB,MAAM,wBAAY,CAAC,GAAG,CAAC,CAAA;IAC3B,CAAC;CAAA;AAZD,wCAYC;AAED,SAAe,YAAY,CAAC,UAAU;;QAClC,MAAM,QAAQ,GAAG,EAAE,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;QACjD,MAAM,MAAM,GAAG,QAAQ,CAAC,eAAe,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC7D,MAAM,IAAI,GAAG,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,E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AAe,YAAY,CAAC,UAAU;;QAClC,MAAM,QAAQ,GAAG,EAAE,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;QACjD,MAAM,MAAM,GAAG,QAAQ,CAAC,eAAe,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC7D,MAAM,IAAI,GAAG,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YACvC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;gBACvB,MAAM,CAAC,KAAK,EAAE,CAAC;gBACf,OAAO,CAAC,IAAI,CAAC,CAAC;YAClB,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;QACH,QAAQ,CAAC,KAAK,EAAE,CAAC;QACjB,OAAO,IAAI,CAAC;IAChB,CAAC;CAAA"} \ No newline at end of file diff --git a/proto/router.proto b/proto/router.proto new file mode 100644 index 0000000..2253c9f --- /dev/null +++ b/proto/router.proto @@ -0,0 +1,661 @@ +syntax = "proto3"; + +import "rpc.proto"; + +package routerrpc; + +option go_package = "github.com/lightningnetwork/lnd/lnrpc/routerrpc"; + +// Router is a service that offers advanced interaction with the router +// subsystem of the daemon. +service Router { + /* + SendPaymentV2 attempts to route a payment described by the passed + PaymentRequest to the final destination. The call returns a stream of + payment updates. + */ + rpc SendPaymentV2 (SendPaymentRequest) returns (stream lnrpc.Payment); + + /* + TrackPaymentV2 returns an update stream for the payment identified by the + payment hash. + */ + rpc TrackPaymentV2 (TrackPaymentRequest) returns (stream lnrpc.Payment); + + /* + EstimateRouteFee allows callers to obtain a lower bound w.r.t how much it + may cost to send an HTLC to the target end destination. + */ + rpc EstimateRouteFee (RouteFeeRequest) returns (RouteFeeResponse); + + /* + Deprecated, use SendToRouteV2. SendToRoute attempts to make a payment via + the specified route. This method differs from SendPayment in that it + allows users to specify a full route manually. This can be used for + things like rebalancing, and atomic swaps. It differs from the newer + SendToRouteV2 in that it doesn't return the full HTLC information. + */ + rpc SendToRoute (SendToRouteRequest) returns (SendToRouteResponse) { + option deprecated = true; + } + + /* + SendToRouteV2 attempts to make a payment via the specified route. This + method differs from SendPayment in that it allows users to specify a full + route manually. This can be used for things like rebalancing, and atomic + swaps. + */ + rpc SendToRouteV2 (SendToRouteRequest) returns (lnrpc.HTLCAttempt); + + /* + ResetMissionControl clears all mission control state and starts with a clean + slate. + */ + rpc ResetMissionControl (ResetMissionControlRequest) + returns (ResetMissionControlResponse); + + /* + QueryMissionControl exposes the internal mission control state to callers. + It is a development feature. + */ + rpc QueryMissionControl (QueryMissionControlRequest) + returns (QueryMissionControlResponse); + + /* + QueryProbability returns the current success probability estimate for a + given node pair and amount. + */ + rpc QueryProbability (QueryProbabilityRequest) + returns (QueryProbabilityResponse); + + /* + BuildRoute builds a fully specified route based on a list of hop public + keys. It retrieves the relevant channel policies from the graph in order to + calculate the correct fees and time locks. + */ + rpc BuildRoute (BuildRouteRequest) returns (BuildRouteResponse); + + /* + SubscribeHtlcEvents creates a uni-directional stream from the server to + the client which delivers a stream of htlc events. + */ + rpc SubscribeHtlcEvents (SubscribeHtlcEventsRequest) + returns (stream HtlcEvent); + + /* + Deprecated, use SendPaymentV2. SendPayment attempts to route a payment + described by the passed PaymentRequest to the final destination. The call + returns a stream of payment status updates. + */ + rpc SendPayment (SendPaymentRequest) returns (stream PaymentStatus) { + option deprecated = true; + } + + /* + Deprecated, use TrackPaymentV2. TrackPayment returns an update stream for + the payment identified by the payment hash. + */ + rpc TrackPayment (TrackPaymentRequest) returns (stream PaymentStatus) { + option deprecated = true; + } + + /** + HtlcInterceptor dispatches a bi-directional streaming RPC in which + Forwarded HTLC requests are sent to the client and the client responds with + a boolean that tells LND if this htlc should be intercepted. + In case of interception, the htlc can be either settled, cancelled or + resumed later by using the ResolveHoldForward endpoint. + */ + rpc HtlcInterceptor (stream ForwardHtlcInterceptResponse) + returns (stream ForwardHtlcInterceptRequest); +} + +message SendPaymentRequest { + // The identity pubkey of the payment recipient + bytes dest = 1; + + /* + Number of satoshis to send. + + The fields amt and amt_msat are mutually exclusive. + */ + int64 amt = 2; + + /* + Number of millisatoshis to send. + + The fields amt and amt_msat are mutually exclusive. + */ + int64 amt_msat = 12; + + // The hash to use within the payment's HTLC + bytes payment_hash = 3; + + /* + The CLTV delta from the current height that should be used to set the + timelock for the final hop. + */ + int32 final_cltv_delta = 4; + + /* + A bare-bones invoice for a payment within the Lightning Network. With the + details of the invoice, the sender has all the data necessary to send a + payment to the recipient. The amount in the payment request may be zero. In + that case it is required to set the amt field as well. If no payment request + is specified, the following fields are required: dest, amt and payment_hash. + */ + string payment_request = 5; + + /* + An upper limit on the amount of time we should spend when attempting to + fulfill the payment. This is expressed in seconds. If we cannot make a + successful payment within this time frame, an error will be returned. + This field must be non-zero. + */ + int32 timeout_seconds = 6; + + /* + The maximum number of satoshis that will be paid as a fee of the payment. + If this field is left to the default value of 0, only zero-fee routes will + be considered. This usually means single hop routes connecting directly to + the destination. To send the payment without a fee limit, use max int here. + + The fields fee_limit_sat and fee_limit_msat are mutually exclusive. + */ + int64 fee_limit_sat = 7; + + /* + The maximum number of millisatoshis that will be paid as a fee of the + payment. If this field is left to the default value of 0, only zero-fee + routes will be considered. This usually means single hop routes connecting + directly to the destination. To send the payment without a fee limit, use + max int here. + + The fields fee_limit_sat and fee_limit_msat are mutually exclusive. + */ + int64 fee_limit_msat = 13; + + /* + Deprecated, use outgoing_chan_ids. The channel id of the channel that must + be taken to the first hop. If zero, any channel may be used (unless + outgoing_chan_ids are set). + */ + uint64 outgoing_chan_id = 8 [jstype = JS_STRING, deprecated = true]; + + /* + The channel ids of the channels are allowed for the first hop. If empty, + any channel may be used. + */ + repeated uint64 outgoing_chan_ids = 19; + + /* + The pubkey of the last hop of the route. If empty, any hop may be used. + */ + bytes last_hop_pubkey = 14; + + /* + An optional maximum total time lock for the route. This should not exceed + lnd's `--max-cltv-expiry` setting. If zero, then the value of + `--max-cltv-expiry` is enforced. + */ + int32 cltv_limit = 9; + + /* + Optional route hints to reach the destination through private channels. + */ + repeated lnrpc.RouteHint route_hints = 10; + + /* + An optional field that can be used to pass an arbitrary set of TLV records + to a peer which understands the new records. This can be used to pass + application specific data during the payment attempt. Record types are + required to be in the custom range >= 65536. When using REST, the values + must be encoded as base64. + */ + map dest_custom_records = 11; + + // If set, circular payments to self are permitted. + bool allow_self_payment = 15; + + /* + Features assumed to be supported by the final node. All transitive feature + dependencies must also be set properly. For a given feature bit pair, either + optional or remote may be set, but not both. If this field is nil or empty, + the router will try to load destination features from the graph as a + fallback. + */ + repeated lnrpc.FeatureBit dest_features = 16; + + /* + The maximum number of partial payments that may be use to complete the full + amount. + */ + uint32 max_parts = 17; + + /* + If set, only the final payment update is streamed back. Intermediate updates + that show which htlcs are still in flight are suppressed. + */ + bool no_inflight_updates = 18; +} + +message TrackPaymentRequest { + // The hash of the payment to look up. + bytes payment_hash = 1; + + /* + If set, only the final payment update is streamed back. Intermediate updates + that show which htlcs are still in flight are suppressed. + */ + bool no_inflight_updates = 2; +} + +message RouteFeeRequest { + /* + The destination once wishes to obtain a routing fee quote to. + */ + bytes dest = 1; + + /* + The amount one wishes to send to the target destination. + */ + int64 amt_sat = 2; +} + +message RouteFeeResponse { + /* + A lower bound of the estimated fee to the target destination within the + network, expressed in milli-satoshis. + */ + int64 routing_fee_msat = 1; + + /* + An estimate of the worst case time delay that can occur. Note that callers + will still need to factor in the final CLTV delta of the last hop into this + value. + */ + int64 time_lock_delay = 2; +} + +message SendToRouteRequest { + // The payment hash to use for the HTLC. + bytes payment_hash = 1; + + // Route that should be used to attempt to complete the payment. + lnrpc.Route route = 2; +} + +message SendToRouteResponse { + // The preimage obtained by making the payment. + bytes preimage = 1; + + // The failure message in case the payment failed. + lnrpc.Failure failure = 2; +} + +message ResetMissionControlRequest { +} + +message ResetMissionControlResponse { +} + +message QueryMissionControlRequest { +} + +// QueryMissionControlResponse contains mission control state. +message QueryMissionControlResponse { + reserved 1; + + // Node pair-level mission control state. + repeated PairHistory pairs = 2; +} + +// PairHistory contains the mission control state for a particular node pair. +message PairHistory { + // The source node pubkey of the pair. + bytes node_from = 1; + + // The destination node pubkey of the pair. + bytes node_to = 2; + + reserved 3, 4, 5, 6; + + PairData history = 7; +} + +message PairData { + // Time of last failure. + int64 fail_time = 1; + + /* + Lowest amount that failed to forward rounded to whole sats. This may be + set to zero if the failure is independent of amount. + */ + int64 fail_amt_sat = 2; + + /* + Lowest amount that failed to forward in millisats. This may be + set to zero if the failure is independent of amount. + */ + int64 fail_amt_msat = 4; + + reserved 3; + + // Time of last success. + int64 success_time = 5; + + // Highest amount that we could successfully forward rounded to whole sats. + int64 success_amt_sat = 6; + + // Highest amount that we could successfully forward in millisats. + int64 success_amt_msat = 7; +} + +message QueryProbabilityRequest { + // The source node pubkey of the pair. + bytes from_node = 1; + + // The destination node pubkey of the pair. + bytes to_node = 2; + + // The amount for which to calculate a probability. + int64 amt_msat = 3; +} + +message QueryProbabilityResponse { + // The success probability for the requested pair. + double probability = 1; + + // The historical data for the requested pair. + PairData history = 2; +} + +message BuildRouteRequest { + /* + The amount to send expressed in msat. If set to zero, the minimum routable + amount is used. + */ + int64 amt_msat = 1; + + /* + CLTV delta from the current height that should be used for the timelock + of the final hop + */ + int32 final_cltv_delta = 2; + + /* + The channel id of the channel that must be taken to the first hop. If zero, + any channel may be used. + */ + uint64 outgoing_chan_id = 3 [jstype = JS_STRING]; + + /* + A list of hops that defines the route. This does not include the source hop + pubkey. + */ + repeated bytes hop_pubkeys = 4; +} + +message BuildRouteResponse { + /* + Fully specified route that can be used to execute the payment. + */ + lnrpc.Route route = 1; +} + +message SubscribeHtlcEventsRequest { +} + +/* +HtlcEvent contains the htlc event that was processed. These are served on a +best-effort basis; events are not persisted, delivery is not guaranteed +(in the event of a crash in the switch, forward events may be lost) and +some events may be replayed upon restart. Events consumed from this package +should be de-duplicated by the htlc's unique combination of incoming and +outgoing channel id and htlc id. [EXPERIMENTAL] +*/ +message HtlcEvent { + /* + The short channel id that the incoming htlc arrived at our node on. This + value is zero for sends. + */ + uint64 incoming_channel_id = 1; + + /* + The short channel id that the outgoing htlc left our node on. This value + is zero for receives. + */ + uint64 outgoing_channel_id = 2; + + /* + Incoming id is the index of the incoming htlc in the incoming channel. + This value is zero for sends. + */ + uint64 incoming_htlc_id = 3; + + /* + Outgoing id is the index of the outgoing htlc in the outgoing channel. + This value is zero for receives. + */ + uint64 outgoing_htlc_id = 4; + + /* + The time in unix nanoseconds that the event occurred. + */ + uint64 timestamp_ns = 5; + + enum EventType { + UNKNOWN = 0; + SEND = 1; + RECEIVE = 2; + FORWARD = 3; + } + + /* + The event type indicates whether the htlc was part of a send, receive or + forward. + */ + EventType event_type = 6; + + oneof event { + ForwardEvent forward_event = 7; + ForwardFailEvent forward_fail_event = 8; + SettleEvent settle_event = 9; + LinkFailEvent link_fail_event = 10; + } +} + +message HtlcInfo { + // The timelock on the incoming htlc. + uint32 incoming_timelock = 1; + + // The timelock on the outgoing htlc. + uint32 outgoing_timelock = 2; + + // The amount of the incoming htlc. + uint64 incoming_amt_msat = 3; + + // The amount of the outgoing htlc. + uint64 outgoing_amt_msat = 4; +} + +message ForwardEvent { + // Info contains details about the htlc that was forwarded. + HtlcInfo info = 1; +} + +message ForwardFailEvent { +} + +message SettleEvent { +} + +message LinkFailEvent { + // Info contains details about the htlc that we failed. + HtlcInfo info = 1; + + // FailureCode is the BOLT error code for the failure. + lnrpc.Failure.FailureCode wire_failure = 2; + + /* + FailureDetail provides additional information about the reason for the + failure. This detail enriches the information provided by the wire message + and may be 'no detail' if the wire message requires no additional metadata. + */ + FailureDetail failure_detail = 3; + + // A string representation of the link failure. + string failure_string = 4; +} + +enum FailureDetail { + UNKNOWN = 0; + NO_DETAIL = 1; + ONION_DECODE = 2; + LINK_NOT_ELIGIBLE = 3; + ON_CHAIN_TIMEOUT = 4; + HTLC_EXCEEDS_MAX = 5; + INSUFFICIENT_BALANCE = 6; + INCOMPLETE_FORWARD = 7; + HTLC_ADD_FAILED = 8; + FORWARDS_DISABLED = 9; + INVOICE_CANCELED = 10; + INVOICE_UNDERPAID = 11; + INVOICE_EXPIRY_TOO_SOON = 12; + INVOICE_NOT_OPEN = 13; + MPP_INVOICE_TIMEOUT = 14; + ADDRESS_MISMATCH = 15; + SET_TOTAL_MISMATCH = 16; + SET_TOTAL_TOO_LOW = 17; + SET_OVERPAID = 18; + UNKNOWN_INVOICE = 19; + INVALID_KEYSEND = 20; + MPP_IN_PROGRESS = 21; + CIRCULAR_ROUTE = 22; +} + +enum PaymentState { + /* + Payment is still in flight. + */ + IN_FLIGHT = 0; + + /* + Payment completed successfully. + */ + SUCCEEDED = 1; + + /* + There are more routes to try, but the payment timeout was exceeded. + */ + FAILED_TIMEOUT = 2; + + /* + All possible routes were tried and failed permanently. Or were no + routes to the destination at all. + */ + FAILED_NO_ROUTE = 3; + + /* + A non-recoverable error has occured. + */ + FAILED_ERROR = 4; + + /* + Payment details incorrect (unknown hash, invalid amt or + invalid final cltv delta) + */ + FAILED_INCORRECT_PAYMENT_DETAILS = 5; + + /* + Insufficient local balance. + */ + FAILED_INSUFFICIENT_BALANCE = 6; +} + +message PaymentStatus { + // Current state the payment is in. + PaymentState state = 1; + + /* + The pre-image of the payment when state is SUCCEEDED. + */ + bytes preimage = 2; + + reserved 3; + + /* + The HTLCs made in attempt to settle the payment [EXPERIMENTAL]. + */ + repeated lnrpc.HTLCAttempt htlcs = 4; +} + +message CircuitKey { + /// The id of the channel that the is part of this circuit. + uint64 chan_id = 1; + + /// The index of the incoming htlc in the incoming channel. + uint64 htlc_id = 2; +} + +message ForwardHtlcInterceptRequest { + /* + The key of this forwarded htlc. It defines the incoming channel id and + the index in this channel. + */ + CircuitKey incoming_circuit_key = 1; + + // The incoming htlc amount. + uint64 incoming_amount_msat = 5; + + // The incoming htlc expiry. + uint32 incoming_expiry = 6; + + /* + The htlc payment hash. This value is not guaranteed to be unique per + request. + */ + bytes payment_hash = 2; + + // The requested outgoing channel id for this forwarded htlc. Because of + // non-strict forwarding, this isn't necessarily the channel over which the + // packet will be forwarded eventually. A different channel to the same peer + // may be selected as well. + uint64 outgoing_requested_chan_id = 7; + + // The outgoing htlc amount. + uint64 outgoing_amount_msat = 3; + + // The outgoing htlc expiry. + uint32 outgoing_expiry = 4; + + // Any custom records that were present in the payload. + map custom_records = 8; +} + +/** +ForwardHtlcInterceptResponse enables the caller to resolve a previously hold +forward. The caller can choose either to: +- `Resume`: Execute the default behavior (usually forward). +- `Reject`: Fail the htlc backwards. +- `Settle`: Settle this htlc with a given preimage. +*/ +message ForwardHtlcInterceptResponse { + /** + The key of this forwarded htlc. It defines the incoming channel id and + the index in this channel. + */ + CircuitKey incoming_circuit_key = 1; + + // The resolve action for this intercepted htlc. + ResolveHoldForwardAction action = 2; + + // The preimage in case the resolve action is Settle. + bytes preimage = 3; +} + +enum ResolveHoldForwardAction { + SETTLE = 0; + FAIL = 1; + RESUME = 2; +} \ No newline at end of file diff --git a/proto/rpc.proto b/proto/rpc.proto new file mode 100644 index 0000000..e8fdd6e --- /dev/null +++ b/proto/rpc.proto @@ -0,0 +1,3640 @@ +syntax = "proto3"; + +package lnrpc; + +option go_package = "github.com/lightningnetwork/lnd/lnrpc"; + +/* + * Comments in this file will be directly parsed into the API + * Documentation as descriptions of the associated method, message, or field. + * These descriptions should go right above the definition of the object, and + * can be in either block or // comment format. + * + * An RPC method can be matched to an lncli command by placing a line in the + * beginning of the description in exactly the following format: + * lncli: `methodname` + * + * Failure to specify the exact name of the command will cause documentation + * generation to fail. + * + * More information on how exactly the gRPC documentation is generated from + * this proto file can be found here: + * https://github.com/lightninglabs/lightning-api + */ + +// Lightning is the main RPC server of the daemon. +service Lightning { + /* lncli: `walletbalance` + WalletBalance returns total unspent outputs(confirmed and unconfirmed), all + confirmed unspent outputs and all unconfirmed unspent outputs under control + of the wallet. + */ + rpc WalletBalance (WalletBalanceRequest) returns (WalletBalanceResponse); + + /* lncli: `channelbalance` + ChannelBalance returns a report on the total funds across all open channels, + categorized in local/remote, pending local/remote and unsettled local/remote + balances. + */ + rpc ChannelBalance (ChannelBalanceRequest) returns (ChannelBalanceResponse); + + /* lncli: `listchaintxns` + GetTransactions returns a list describing all the known transactions + relevant to the wallet. + */ + rpc GetTransactions (GetTransactionsRequest) returns (TransactionDetails); + + /* lncli: `estimatefee` + EstimateFee asks the chain backend to estimate the fee rate and total fees + for a transaction that pays to multiple specified outputs. + + When using REST, the `AddrToAmount` map type can be set by appending + `&AddrToAmount[
]=` to the URL. Unfortunately this + map type doesn't appear in the REST API documentation because of a bug in + the grpc-gateway library. + */ + rpc EstimateFee (EstimateFeeRequest) returns (EstimateFeeResponse); + + /* lncli: `sendcoins` + SendCoins executes a request to send coins to a particular address. Unlike + SendMany, this RPC call only allows creating a single output at a time. If + neither target_conf, or sat_per_byte are set, then the internal wallet will + consult its fee model to determine a fee for the default confirmation + target. + */ + rpc SendCoins (SendCoinsRequest) returns (SendCoinsResponse); + + /* lncli: `listunspent` + Deprecated, use walletrpc.ListUnspent instead. + + ListUnspent returns a list of all utxos spendable by the wallet with a + number of confirmations between the specified minimum and maximum. + */ + rpc ListUnspent (ListUnspentRequest) returns (ListUnspentResponse); + + /* + SubscribeTransactions creates a uni-directional stream from the server to + the client in which any newly discovered transactions relevant to the + wallet are sent over. + */ + rpc SubscribeTransactions (GetTransactionsRequest) + returns (stream Transaction); + + /* lncli: `sendmany` + SendMany handles a request for a transaction that creates multiple specified + outputs in parallel. If neither target_conf, or sat_per_byte are set, then + the internal wallet will consult its fee model to determine a fee for the + default confirmation target. + */ + rpc SendMany (SendManyRequest) returns (SendManyResponse); + + /* lncli: `newaddress` + NewAddress creates a new address under control of the local wallet. + */ + rpc NewAddress (NewAddressRequest) returns (NewAddressResponse); + + /* lncli: `signmessage` + SignMessage signs a message with this node's private key. The returned + signature string is `zbase32` encoded and pubkey recoverable, meaning that + only the message digest and signature are needed for verification. + */ + rpc SignMessage (SignMessageRequest) returns (SignMessageResponse); + + /* lncli: `verifymessage` + VerifyMessage verifies a signature over a msg. The signature must be + zbase32 encoded and signed by an active node in the resident node's + channel database. In addition to returning the validity of the signature, + VerifyMessage also returns the recovered pubkey from the signature. + */ + rpc VerifyMessage (VerifyMessageRequest) returns (VerifyMessageResponse); + + /* lncli: `connect` + ConnectPeer attempts to establish a connection to a remote peer. This is at + the networking level, and is used for communication between nodes. This is + distinct from establishing a channel with a peer. + */ + rpc ConnectPeer (ConnectPeerRequest) returns (ConnectPeerResponse); + + /* lncli: `disconnect` + DisconnectPeer attempts to disconnect one peer from another identified by a + given pubKey. In the case that we currently have a pending or active channel + with the target peer, then this action will be not be allowed. + */ + rpc DisconnectPeer (DisconnectPeerRequest) returns (DisconnectPeerResponse); + + /* lncli: `listpeers` + ListPeers returns a verbose listing of all currently active peers. + */ + rpc ListPeers (ListPeersRequest) returns (ListPeersResponse); + + /* + SubscribePeerEvents creates a uni-directional stream from the server to + the client in which any events relevant to the state of peers are sent + over. Events include peers going online and offline. + */ + rpc SubscribePeerEvents (PeerEventSubscription) returns (stream PeerEvent); + + /* lncli: `getinfo` + GetInfo returns general information concerning the lightning node including + it's identity pubkey, alias, the chains it is connected to, and information + concerning the number of open+pending channels. + */ + rpc GetInfo (GetInfoRequest) returns (GetInfoResponse); + + /** lncli: `getrecoveryinfo` + GetRecoveryInfo returns information concerning the recovery mode including + whether it's in a recovery mode, whether the recovery is finished, and the + progress made so far. + */ + rpc GetRecoveryInfo (GetRecoveryInfoRequest) + returns (GetRecoveryInfoResponse); + + // TODO(roasbeef): merge with below with bool? + /* lncli: `pendingchannels` + PendingChannels returns a list of all the channels that are currently + considered "pending". A channel is pending if it has finished the funding + workflow and is waiting for confirmations for the funding txn, or is in the + process of closure, either initiated cooperatively or non-cooperatively. + */ + rpc PendingChannels (PendingChannelsRequest) + returns (PendingChannelsResponse); + + /* lncli: `listchannels` + ListChannels returns a description of all the open channels that this node + is a participant in. + */ + rpc ListChannels (ListChannelsRequest) returns (ListChannelsResponse); + + /* + SubscribeChannelEvents creates a uni-directional stream from the server to + the client in which any updates relevant to the state of the channels are + sent over. Events include new active channels, inactive channels, and closed + channels. + */ + rpc SubscribeChannelEvents (ChannelEventSubscription) + returns (stream ChannelEventUpdate); + + /* lncli: `closedchannels` + ClosedChannels returns a description of all the closed channels that + this node was a participant in. + */ + rpc ClosedChannels (ClosedChannelsRequest) returns (ClosedChannelsResponse); + + /* + OpenChannelSync is a synchronous version of the OpenChannel RPC call. This + call is meant to be consumed by clients to the REST proxy. As with all + other sync calls, all byte slices are intended to be populated as hex + encoded strings. + */ + rpc OpenChannelSync (OpenChannelRequest) returns (ChannelPoint); + + /* lncli: `openchannel` + OpenChannel attempts to open a singly funded channel specified in the + request to a remote peer. Users are able to specify a target number of + blocks that the funding transaction should be confirmed in, or a manual fee + rate to us for the funding transaction. If neither are specified, then a + lax block confirmation target is used. Each OpenStatusUpdate will return + the pending channel ID of the in-progress channel. Depending on the + arguments specified in the OpenChannelRequest, this pending channel ID can + then be used to manually progress the channel funding flow. + */ + rpc OpenChannel (OpenChannelRequest) returns (stream OpenStatusUpdate); + + /* + FundingStateStep is an advanced funding related call that allows the caller + to either execute some preparatory steps for a funding workflow, or + manually progress a funding workflow. The primary way a funding flow is + identified is via its pending channel ID. As an example, this method can be + used to specify that we're expecting a funding flow for a particular + pending channel ID, for which we need to use specific parameters. + Alternatively, this can be used to interactively drive PSBT signing for + funding for partially complete funding transactions. + */ + rpc FundingStateStep (FundingTransitionMsg) returns (FundingStateStepResp); + + /* + ChannelAcceptor dispatches a bi-directional streaming RPC in which + OpenChannel requests are sent to the client and the client responds with + a boolean that tells LND whether or not to accept the channel. This allows + node operators to specify their own criteria for accepting inbound channels + through a single persistent connection. + */ + rpc ChannelAcceptor (stream ChannelAcceptResponse) + returns (stream ChannelAcceptRequest); + + /* lncli: `closechannel` + CloseChannel attempts to close an active channel identified by its channel + outpoint (ChannelPoint). The actions of this method can additionally be + augmented to attempt a force close after a timeout period in the case of an + inactive peer. If a non-force close (cooperative closure) is requested, + then the user can specify either a target number of blocks until the + closure transaction is confirmed, or a manual fee rate. If neither are + specified, then a default lax, block confirmation target is used. + */ + rpc CloseChannel (CloseChannelRequest) returns (stream CloseStatusUpdate); + + /* lncli: `abandonchannel` + AbandonChannel removes all channel state from the database except for a + close summary. This method can be used to get rid of permanently unusable + channels due to bugs fixed in newer versions of lnd. This method can also be + used to remove externally funded channels where the funding transaction was + never broadcast. Only available for non-externally funded channels in dev + build. + */ + rpc AbandonChannel (AbandonChannelRequest) returns (AbandonChannelResponse); + + /* lncli: `sendpayment` + Deprecated, use routerrpc.SendPaymentV2. SendPayment dispatches a + bi-directional streaming RPC for sending payments through the Lightning + Network. A single RPC invocation creates a persistent bi-directional + stream allowing clients to rapidly send payments through the Lightning + Network with a single persistent connection. + */ + rpc SendPayment (stream SendRequest) returns (stream SendResponse) { + option deprecated = true; + } + + /* + SendPaymentSync is the synchronous non-streaming version of SendPayment. + This RPC is intended to be consumed by clients of the REST proxy. + Additionally, this RPC expects the destination's public key and the payment + hash (if any) to be encoded as hex strings. + */ + rpc SendPaymentSync (SendRequest) returns (SendResponse); + + /* lncli: `sendtoroute` + Deprecated, use routerrpc.SendToRouteV2. SendToRoute is a bi-directional + streaming RPC for sending payment through the Lightning Network. This + method differs from SendPayment in that it allows users to specify a full + route manually. This can be used for things like rebalancing, and atomic + swaps. + */ + rpc SendToRoute (stream SendToRouteRequest) returns (stream SendResponse) { + option deprecated = true; + } + + /* + SendToRouteSync is a synchronous version of SendToRoute. It Will block + until the payment either fails or succeeds. + */ + rpc SendToRouteSync (SendToRouteRequest) returns (SendResponse); + + /* lncli: `addinvoice` + AddInvoice attempts to add a new invoice to the invoice database. Any + duplicated invoices are rejected, therefore all invoices *must* have a + unique payment preimage. + */ + rpc AddInvoice (Invoice) returns (AddInvoiceResponse); + + /* lncli: `listinvoices` + ListInvoices returns a list of all the invoices currently stored within the + database. Any active debug invoices are ignored. It has full support for + paginated responses, allowing users to query for specific invoices through + their add_index. This can be done by using either the first_index_offset or + last_index_offset fields included in the response as the index_offset of the + next request. By default, the first 100 invoices created will be returned. + Backwards pagination is also supported through the Reversed flag. + */ + rpc ListInvoices (ListInvoiceRequest) returns (ListInvoiceResponse); + + /* lncli: `lookupinvoice` + LookupInvoice attempts to look up an invoice according to its payment hash. + The passed payment hash *must* be exactly 32 bytes, if not, an error is + returned. + */ + rpc LookupInvoice (PaymentHash) returns (Invoice); + + /* + SubscribeInvoices returns a uni-directional stream (server -> client) for + notifying the client of newly added/settled invoices. The caller can + optionally specify the add_index and/or the settle_index. If the add_index + is specified, then we'll first start by sending add invoice events for all + invoices with an add_index greater than the specified value. If the + settle_index is specified, the next, we'll send out all settle events for + invoices with a settle_index greater than the specified value. One or both + of these fields can be set. If no fields are set, then we'll only send out + the latest add/settle events. + */ + rpc SubscribeInvoices (InvoiceSubscription) returns (stream Invoice); + + /* lncli: `decodepayreq` + DecodePayReq takes an encoded payment request string and attempts to decode + it, returning a full description of the conditions encoded within the + payment request. + */ + rpc DecodePayReq (PayReqString) returns (PayReq); + + /* lncli: `listpayments` + ListPayments returns a list of all outgoing payments. + */ + rpc ListPayments (ListPaymentsRequest) returns (ListPaymentsResponse); + + /* + DeleteAllPayments deletes all outgoing payments from DB. + */ + rpc DeleteAllPayments (DeleteAllPaymentsRequest) + returns (DeleteAllPaymentsResponse); + + /* lncli: `describegraph` + DescribeGraph returns a description of the latest graph state from the + point of view of the node. The graph information is partitioned into two + components: all the nodes/vertexes, and all the edges that connect the + vertexes themselves. As this is a directed graph, the edges also contain + the node directional specific routing policy which includes: the time lock + delta, fee information, etc. + */ + rpc DescribeGraph (ChannelGraphRequest) returns (ChannelGraph); + + /* lncli: `getnodemetrics` + GetNodeMetrics returns node metrics calculated from the graph. Currently + the only supported metric is betweenness centrality of individual nodes. + */ + rpc GetNodeMetrics (NodeMetricsRequest) returns (NodeMetricsResponse); + + /* lncli: `getchaninfo` + GetChanInfo returns the latest authenticated network announcement for the + given channel identified by its channel ID: an 8-byte integer which + uniquely identifies the location of transaction's funding output within the + blockchain. + */ + rpc GetChanInfo (ChanInfoRequest) returns (ChannelEdge); + + /* lncli: `getnodeinfo` + GetNodeInfo returns the latest advertised, aggregated, and authenticated + channel information for the specified node identified by its public key. + */ + rpc GetNodeInfo (NodeInfoRequest) returns (NodeInfo); + + /* lncli: `queryroutes` + QueryRoutes attempts to query the daemon's Channel Router for a possible + route to a target destination capable of carrying a specific amount of + satoshis. The returned route contains the full details required to craft and + send an HTLC, also including the necessary information that should be + present within the Sphinx packet encapsulated within the HTLC. + + When using REST, the `dest_custom_records` map type can be set by appending + `&dest_custom_records[]=` + to the URL. Unfortunately this map type doesn't appear in the REST API + documentation because of a bug in the grpc-gateway library. + */ + rpc QueryRoutes (QueryRoutesRequest) returns (QueryRoutesResponse); + + /* lncli: `getnetworkinfo` + GetNetworkInfo returns some basic stats about the known channel graph from + the point of view of the node. + */ + rpc GetNetworkInfo (NetworkInfoRequest) returns (NetworkInfo); + + /* lncli: `stop` + StopDaemon will send a shutdown request to the interrupt handler, triggering + a graceful shutdown of the daemon. + */ + rpc StopDaemon (StopRequest) returns (StopResponse); + + /* + SubscribeChannelGraph launches a streaming RPC that allows the caller to + receive notifications upon any changes to the channel graph topology from + the point of view of the responding node. Events notified include: new + nodes coming online, nodes updating their authenticated attributes, new + channels being advertised, updates in the routing policy for a directional + channel edge, and when channels are closed on-chain. + */ + rpc SubscribeChannelGraph (GraphTopologySubscription) + returns (stream GraphTopologyUpdate); + + /* lncli: `debuglevel` + DebugLevel allows a caller to programmatically set the logging verbosity of + lnd. The logging can be targeted according to a coarse daemon-wide logging + level, or in a granular fashion to specify the logging for a target + sub-system. + */ + rpc DebugLevel (DebugLevelRequest) returns (DebugLevelResponse); + + /* lncli: `feereport` + FeeReport allows the caller to obtain a report detailing the current fee + schedule enforced by the node globally for each channel. + */ + rpc FeeReport (FeeReportRequest) returns (FeeReportResponse); + + /* lncli: `updatechanpolicy` + UpdateChannelPolicy allows the caller to update the fee schedule and + channel policies for all channels globally, or a particular channel. + */ + rpc UpdateChannelPolicy (PolicyUpdateRequest) + returns (PolicyUpdateResponse); + + /* lncli: `fwdinghistory` + ForwardingHistory allows the caller to query the htlcswitch for a record of + all HTLCs forwarded within the target time range, and integer offset + within that time range. If no time-range is specified, then the first chunk + of the past 24 hrs of forwarding history are returned. + + A list of forwarding events are returned. The size of each forwarding event + is 40 bytes, and the max message size able to be returned in gRPC is 4 MiB. + As a result each message can only contain 50k entries. Each response has + the index offset of the last entry. The index offset can be provided to the + request to allow the caller to skip a series of records. + */ + rpc ForwardingHistory (ForwardingHistoryRequest) + returns (ForwardingHistoryResponse); + + /* lncli: `exportchanbackup` + ExportChannelBackup attempts to return an encrypted static channel backup + for the target channel identified by it channel point. The backup is + encrypted with a key generated from the aezeed seed of the user. The + returned backup can either be restored using the RestoreChannelBackup + method once lnd is running, or via the InitWallet and UnlockWallet methods + from the WalletUnlocker service. + */ + rpc ExportChannelBackup (ExportChannelBackupRequest) + returns (ChannelBackup); + + /* + ExportAllChannelBackups returns static channel backups for all existing + channels known to lnd. A set of regular singular static channel backups for + each channel are returned. Additionally, a multi-channel backup is returned + as well, which contains a single encrypted blob containing the backups of + each channel. + */ + rpc ExportAllChannelBackups (ChanBackupExportRequest) + returns (ChanBackupSnapshot); + + /* + VerifyChanBackup allows a caller to verify the integrity of a channel backup + snapshot. This method will accept either a packed Single or a packed Multi. + Specifying both will result in an error. + */ + rpc VerifyChanBackup (ChanBackupSnapshot) + returns (VerifyChanBackupResponse); + + /* lncli: `restorechanbackup` + RestoreChannelBackups accepts a set of singular channel backups, or a + single encrypted multi-chan backup and attempts to recover any funds + remaining within the channel. If we are able to unpack the backup, then the + new channel will be shown under listchannels, as well as pending channels. + */ + rpc RestoreChannelBackups (RestoreChanBackupRequest) + returns (RestoreBackupResponse); + + /* + SubscribeChannelBackups allows a client to sub-subscribe to the most up to + date information concerning the state of all channel backups. Each time a + new channel is added, we return the new set of channels, along with a + multi-chan backup containing the backup info for all channels. Each time a + channel is closed, we send a new update, which contains new new chan back + ups, but the updated set of encrypted multi-chan backups with the closed + channel(s) removed. + */ + rpc SubscribeChannelBackups (ChannelBackupSubscription) + returns (stream ChanBackupSnapshot); + + /* lncli: `bakemacaroon` + BakeMacaroon allows the creation of a new macaroon with custom read and + write permissions. No first-party caveats are added since this can be done + offline. + */ + rpc BakeMacaroon (BakeMacaroonRequest) returns (BakeMacaroonResponse); + + /* lncli: `listmacaroonids` + ListMacaroonIDs returns all root key IDs that are in use. + */ + rpc ListMacaroonIDs (ListMacaroonIDsRequest) + returns (ListMacaroonIDsResponse); + + /* lncli: `deletemacaroonid` + DeleteMacaroonID deletes the specified macaroon ID and invalidates all + macaroons derived from that ID. + */ + rpc DeleteMacaroonID (DeleteMacaroonIDRequest) + returns (DeleteMacaroonIDResponse); + + /* lncli: `listpermissions` + ListPermissions lists all RPC method URIs and their required macaroon + permissions to access them. + */ + rpc ListPermissions (ListPermissionsRequest) + returns (ListPermissionsResponse); +} + +message Utxo { + // The type of address + AddressType address_type = 1; + + // The address + string address = 2; + + // The value of the unspent coin in satoshis + int64 amount_sat = 3; + + // The pkscript in hex + string pk_script = 4; + + // The outpoint in format txid:n + OutPoint outpoint = 5; + + // The number of confirmations for the Utxo + int64 confirmations = 6; +} + +message Transaction { + // The transaction hash + string tx_hash = 1; + + // The transaction amount, denominated in satoshis + int64 amount = 2; + + // The number of confirmations + int32 num_confirmations = 3; + + // The hash of the block this transaction was included in + string block_hash = 4; + + // The height of the block this transaction was included in + int32 block_height = 5; + + // Timestamp of this transaction + int64 time_stamp = 6; + + // Fees paid for this transaction + int64 total_fees = 7; + + // Addresses that received funds for this transaction + repeated string dest_addresses = 8; + + // The raw transaction hex. + string raw_tx_hex = 9; + + // A label that was optionally set on transaction broadcast. + string label = 10; +} +message GetTransactionsRequest { + /* + The height from which to list transactions, inclusive. If this value is + greater than end_height, transactions will be read in reverse. + */ + int32 start_height = 1; + + /* + The height until which to list transactions, inclusive. To include + unconfirmed transactions, this value should be set to -1, which will + return transactions from start_height until the current chain tip and + unconfirmed transactions. If no end_height is provided, the call will + default to this option. + */ + int32 end_height = 2; +} + +message TransactionDetails { + // The list of transactions relevant to the wallet. + repeated Transaction transactions = 1; +} + +message FeeLimit { + oneof limit { + /* + The fee limit expressed as a fixed amount of satoshis. + + The fields fixed and fixed_msat are mutually exclusive. + */ + int64 fixed = 1; + + /* + The fee limit expressed as a fixed amount of millisatoshis. + + The fields fixed and fixed_msat are mutually exclusive. + */ + int64 fixed_msat = 3; + + // The fee limit expressed as a percentage of the payment amount. + int64 percent = 2; + } +} + +message SendRequest { + /* + The identity pubkey of the payment recipient. When using REST, this field + must be encoded as base64. + */ + bytes dest = 1; + + /* + The hex-encoded identity pubkey of the payment recipient. Deprecated now + that the REST gateway supports base64 encoding of bytes fields. + */ + string dest_string = 2 [deprecated = true]; + + /* + The amount to send expressed in satoshis. + + The fields amt and amt_msat are mutually exclusive. + */ + int64 amt = 3; + + /* + The amount to send expressed in millisatoshis. + + The fields amt and amt_msat are mutually exclusive. + */ + int64 amt_msat = 12; + + /* + The hash to use within the payment's HTLC. When using REST, this field + must be encoded as base64. + */ + bytes payment_hash = 4; + + /* + The hex-encoded hash to use within the payment's HTLC. Deprecated now + that the REST gateway supports base64 encoding of bytes fields. + */ + string payment_hash_string = 5 [deprecated = true]; + + /* + A bare-bones invoice for a payment within the Lightning Network. With the + details of the invoice, the sender has all the data necessary to send a + payment to the recipient. + */ + string payment_request = 6; + + /* + The CLTV delta from the current height that should be used to set the + timelock for the final hop. + */ + int32 final_cltv_delta = 7; + + /* + The maximum number of satoshis that will be paid as a fee of the payment. + This value can be represented either as a percentage of the amount being + sent, or as a fixed amount of the maximum fee the user is willing the pay to + send the payment. + */ + FeeLimit fee_limit = 8; + + /* + The channel id of the channel that must be taken to the first hop. If zero, + any channel may be used. + */ + uint64 outgoing_chan_id = 9 [jstype = JS_STRING]; + + /* + The pubkey of the last hop of the route. If empty, any hop may be used. + */ + bytes last_hop_pubkey = 13; + + /* + An optional maximum total time lock for the route. This should not exceed + lnd's `--max-cltv-expiry` setting. If zero, then the value of + `--max-cltv-expiry` is enforced. + */ + uint32 cltv_limit = 10; + + /* + An optional field that can be used to pass an arbitrary set of TLV records + to a peer which understands the new records. This can be used to pass + application specific data during the payment attempt. Record types are + required to be in the custom range >= 65536. When using REST, the values + must be encoded as base64. + */ + map dest_custom_records = 11; + + // If set, circular payments to self are permitted. + bool allow_self_payment = 14; + + /* + Features assumed to be supported by the final node. All transitive feature + dependencies must also be set properly. For a given feature bit pair, either + optional or remote may be set, but not both. If this field is nil or empty, + the router will try to load destination features from the graph as a + fallback. + */ + repeated FeatureBit dest_features = 15; +} + +message SendResponse { + string payment_error = 1; + bytes payment_preimage = 2; + Route payment_route = 3; + bytes payment_hash = 4; +} + +message SendToRouteRequest { + /* + The payment hash to use for the HTLC. When using REST, this field must be + encoded as base64. + */ + bytes payment_hash = 1; + + /* + An optional hex-encoded payment hash to be used for the HTLC. Deprecated now + that the REST gateway supports base64 encoding of bytes fields. + */ + string payment_hash_string = 2 [deprecated = true]; + + reserved 3; + + // Route that should be used to attempt to complete the payment. + Route route = 4; +} + +message ChannelAcceptRequest { + // The pubkey of the node that wishes to open an inbound channel. + bytes node_pubkey = 1; + + // The hash of the genesis block that the proposed channel resides in. + bytes chain_hash = 2; + + // The pending channel id. + bytes pending_chan_id = 3; + + // The funding amount in satoshis that initiator wishes to use in the + // channel. + uint64 funding_amt = 4; + + // The push amount of the proposed channel in millisatoshis. + uint64 push_amt = 5; + + // The dust limit of the initiator's commitment tx. + uint64 dust_limit = 6; + + // The maximum amount of coins in millisatoshis that can be pending in this + // channel. + uint64 max_value_in_flight = 7; + + // The minimum amount of satoshis the initiator requires us to have at all + // times. + uint64 channel_reserve = 8; + + // The smallest HTLC in millisatoshis that the initiator will accept. + uint64 min_htlc = 9; + + // The initial fee rate that the initiator suggests for both commitment + // transactions. + uint64 fee_per_kw = 10; + + /* + The number of blocks to use for the relative time lock in the pay-to-self + output of both commitment transactions. + */ + uint32 csv_delay = 11; + + // The total number of incoming HTLC's that the initiator will accept. + uint32 max_accepted_htlcs = 12; + + // A bit-field which the initiator uses to specify proposed channel + // behavior. + uint32 channel_flags = 13; +} + +message ChannelAcceptResponse { + // Whether or not the client accepts the channel. + bool accept = 1; + + // The pending channel id to which this response applies. + bytes pending_chan_id = 2; +} + +message ChannelPoint { + oneof funding_txid { + /* + Txid of the funding transaction. When using REST, this field must be + encoded as base64. + */ + bytes funding_txid_bytes = 1; + + /* + Hex-encoded string representing the byte-reversed hash of the funding + transaction. + */ + string funding_txid_str = 2; + } + + // The index of the output of the funding transaction + uint32 output_index = 3; +} + +message OutPoint { + // Raw bytes representing the transaction id. + bytes txid_bytes = 1; + + // Reversed, hex-encoded string representing the transaction id. + string txid_str = 2; + + // The index of the output on the transaction. + uint32 output_index = 3; +} + +message LightningAddress { + // The identity pubkey of the Lightning node + string pubkey = 1; + + // The network location of the lightning node, e.g. `69.69.69.69:1337` or + // `localhost:10011` + string host = 2; +} + +message EstimateFeeRequest { + // The map from addresses to amounts for the transaction. + map AddrToAmount = 1; + + // The target number of blocks that this transaction should be confirmed + // by. + int32 target_conf = 2; +} + +message EstimateFeeResponse { + // The total fee in satoshis. + int64 fee_sat = 1; + + // The fee rate in satoshi/byte. + int64 feerate_sat_per_byte = 2; +} + +message SendManyRequest { + // The map from addresses to amounts + map AddrToAmount = 1; + + // The target number of blocks that this transaction should be confirmed + // by. + int32 target_conf = 3; + + // A manual fee rate set in sat/byte that should be used when crafting the + // transaction. + int64 sat_per_byte = 5; + + // An optional label for the transaction, limited to 500 characters. + string label = 6; + + // The minimum number of confirmations each one of your outputs used for + // the transaction must satisfy. + int32 min_confs = 7; + + // Whether unconfirmed outputs should be used as inputs for the transaction. + bool spend_unconfirmed = 8; +} +message SendManyResponse { + // The id of the transaction + string txid = 1; +} + +message SendCoinsRequest { + // The address to send coins to + string addr = 1; + + // The amount in satoshis to send + int64 amount = 2; + + // The target number of blocks that this transaction should be confirmed + // by. + int32 target_conf = 3; + + // A manual fee rate set in sat/byte that should be used when crafting the + // transaction. + int64 sat_per_byte = 5; + + /* + If set, then the amount field will be ignored, and lnd will attempt to + send all the coins under control of the internal wallet to the specified + address. + */ + bool send_all = 6; + + // An optional label for the transaction, limited to 500 characters. + string label = 7; + + // The minimum number of confirmations each one of your outputs used for + // the transaction must satisfy. + int32 min_confs = 8; + + // Whether unconfirmed outputs should be used as inputs for the transaction. + bool spend_unconfirmed = 9; +} +message SendCoinsResponse { + // The transaction ID of the transaction + string txid = 1; +} + +message ListUnspentRequest { + // The minimum number of confirmations to be included. + int32 min_confs = 1; + + // The maximum number of confirmations to be included. + int32 max_confs = 2; +} +message ListUnspentResponse { + // A list of utxos + repeated Utxo utxos = 1; +} + +/* +`AddressType` has to be one of: + +- `p2wkh`: Pay to witness key hash (`WITNESS_PUBKEY_HASH` = 0) +- `np2wkh`: Pay to nested witness key hash (`NESTED_PUBKEY_HASH` = 1) +*/ +enum AddressType { + WITNESS_PUBKEY_HASH = 0; + NESTED_PUBKEY_HASH = 1; + UNUSED_WITNESS_PUBKEY_HASH = 2; + UNUSED_NESTED_PUBKEY_HASH = 3; +} + +message NewAddressRequest { + // The address type + AddressType type = 1; +} +message NewAddressResponse { + // The newly generated wallet address + string address = 1; +} + +message SignMessageRequest { + /* + The message to be signed. When using REST, this field must be encoded as + base64. + */ + bytes msg = 1; +} +message SignMessageResponse { + // The signature for the given message + string signature = 1; +} + +message VerifyMessageRequest { + /* + The message over which the signature is to be verified. When using REST, + this field must be encoded as base64. + */ + bytes msg = 1; + + // The signature to be verified over the given message + string signature = 2; +} +message VerifyMessageResponse { + // Whether the signature was valid over the given message + bool valid = 1; + + // The pubkey recovered from the signature + string pubkey = 2; +} + +message ConnectPeerRequest { + // Lightning address of the peer, in the format `@host` + LightningAddress addr = 1; + + /* If set, the daemon will attempt to persistently connect to the target + * peer. Otherwise, the call will be synchronous. */ + bool perm = 2; + + /* + The connection timeout value (in seconds) for this request. It won't affect + other requests. + */ + uint64 timeout = 3; +} +message ConnectPeerResponse { +} + +message DisconnectPeerRequest { + // The pubkey of the node to disconnect from + string pub_key = 1; +} +message DisconnectPeerResponse { +} + +message HTLC { + bool incoming = 1; + int64 amount = 2; + bytes hash_lock = 3; + uint32 expiration_height = 4; +} + +enum CommitmentType { + /* + A channel using the legacy commitment format having tweaked to_remote + keys. + */ + LEGACY = 0; + + /* + A channel that uses the modern commitment format where the key in the + output of the remote party does not change each state. This makes back + up and recovery easier as when the channel is closed, the funds go + directly to that key. + */ + STATIC_REMOTE_KEY = 1; + + /* + A channel that uses a commitment format that has anchor outputs on the + commitments, allowing fee bumping after a force close transaction has + been broadcast. + */ + ANCHORS = 2; + + /* + Returned when the commitment type isn't known or unavailable. + */ + UNKNOWN_COMMITMENT_TYPE = 999; +} + +message ChannelConstraints { + /* + The CSV delay expressed in relative blocks. If the channel is force closed, + we will need to wait for this many blocks before we can regain our funds. + */ + uint32 csv_delay = 1; + + // The minimum satoshis this node is required to reserve in its balance. + uint64 chan_reserve_sat = 2; + + // The dust limit (in satoshis) of the initiator's commitment tx. + uint64 dust_limit_sat = 3; + + // The maximum amount of coins in millisatoshis that can be pending in this + // channel. + uint64 max_pending_amt_msat = 4; + + // The smallest HTLC in millisatoshis that the initiator will accept. + uint64 min_htlc_msat = 5; + + // The total number of incoming HTLC's that the initiator will accept. + uint32 max_accepted_htlcs = 6; +} + +message Channel { + // Whether this channel is active or not + bool active = 1; + + // The identity pubkey of the remote node + string remote_pubkey = 2; + + /* + The outpoint (txid:index) of the funding transaction. With this value, Bob + will be able to generate a signature for Alice's version of the commitment + transaction. + */ + string channel_point = 3; + + /* + The unique channel ID for the channel. The first 3 bytes are the block + height, the next 3 the index within the block, and the last 2 bytes are the + output index for the channel. + */ + uint64 chan_id = 4 [jstype = JS_STRING]; + + // The total amount of funds held in this channel + int64 capacity = 5; + + // This node's current balance in this channel + int64 local_balance = 6; + + // The counterparty's current balance in this channel + int64 remote_balance = 7; + + /* + The amount calculated to be paid in fees for the current set of commitment + transactions. The fee amount is persisted with the channel in order to + allow the fee amount to be removed and recalculated with each channel state + update, including updates that happen after a system restart. + */ + int64 commit_fee = 8; + + // The weight of the commitment transaction + int64 commit_weight = 9; + + /* + The required number of satoshis per kilo-weight that the requester will pay + at all times, for both the funding transaction and commitment transaction. + This value can later be updated once the channel is open. + */ + int64 fee_per_kw = 10; + + // The unsettled balance in this channel + int64 unsettled_balance = 11; + + /* + The total number of satoshis we've sent within this channel. + */ + int64 total_satoshis_sent = 12; + + /* + The total number of satoshis we've received within this channel. + */ + int64 total_satoshis_received = 13; + + /* + The total number of updates conducted within this channel. + */ + uint64 num_updates = 14; + + /* + The list of active, uncleared HTLCs currently pending within the channel. + */ + repeated HTLC pending_htlcs = 15; + + /* + Deprecated. The CSV delay expressed in relative blocks. If the channel is + force closed, we will need to wait for this many blocks before we can regain + our funds. + */ + uint32 csv_delay = 16 [deprecated = true]; + + // Whether this channel is advertised to the network or not. + bool private = 17; + + // True if we were the ones that created the channel. + bool initiator = 18; + + // A set of flags showing the current state of the channel. + string chan_status_flags = 19; + + // Deprecated. The minimum satoshis this node is required to reserve in its + // balance. + int64 local_chan_reserve_sat = 20 [deprecated = true]; + + /* + Deprecated. The minimum satoshis the other node is required to reserve in + its balance. + */ + int64 remote_chan_reserve_sat = 21 [deprecated = true]; + + // Deprecated. Use commitment_type. + bool static_remote_key = 22 [deprecated = true]; + + // The commitment type used by this channel. + CommitmentType commitment_type = 26; + + /* + The number of seconds that the channel has been monitored by the channel + scoring system. Scores are currently not persisted, so this value may be + less than the lifetime of the channel [EXPERIMENTAL]. + */ + int64 lifetime = 23; + + /* + The number of seconds that the remote peer has been observed as being online + by the channel scoring system over the lifetime of the channel + [EXPERIMENTAL]. + */ + int64 uptime = 24; + + /* + Close address is the address that we will enforce payout to on cooperative + close if the channel was opened utilizing option upfront shutdown. This + value can be set on channel open by setting close_address in an open channel + request. If this value is not set, you can still choose a payout address by + cooperatively closing with the delivery_address field set. + */ + string close_address = 25; + + /* + The amount that the initiator of the channel optionally pushed to the remote + party on channel open. This amount will be zero if the channel initiator did + not push any funds to the remote peer. If the initiator field is true, we + pushed this amount to our peer, if it is false, the remote peer pushed this + amount to us. + */ + uint64 push_amount_sat = 27; + + /* + This uint32 indicates if this channel is to be considered 'frozen'. A + frozen channel doest not allow a cooperative channel close by the + initiator. The thaw_height is the height that this restriction stops + applying to the channel. This field is optional, not setting it or using a + value of zero will mean the channel has no additional restrictions. The + height can be interpreted in two ways: as a relative height if the value is + less than 500,000, or as an absolute height otherwise. + */ + uint32 thaw_height = 28; + + // List constraints for the local node. + ChannelConstraints local_constraints = 29; + + // List constraints for the remote node. + ChannelConstraints remote_constraints = 30; +} + +message ListChannelsRequest { + bool active_only = 1; + bool inactive_only = 2; + bool public_only = 3; + bool private_only = 4; + + /* + Filters the response for channels with a target peer's pubkey. If peer is + empty, all channels will be returned. + */ + bytes peer = 5; +} +message ListChannelsResponse { + // The list of active channels + repeated Channel channels = 11; +} + +enum Initiator { + INITIATOR_UNKNOWN = 0; + INITIATOR_LOCAL = 1; + INITIATOR_REMOTE = 2; + INITIATOR_BOTH = 3; +} + +message ChannelCloseSummary { + // The outpoint (txid:index) of the funding transaction. + string channel_point = 1; + + // The unique channel ID for the channel. + uint64 chan_id = 2 [jstype = JS_STRING]; + + // The hash of the genesis block that this channel resides within. + string chain_hash = 3; + + // The txid of the transaction which ultimately closed this channel. + string closing_tx_hash = 4; + + // Public key of the remote peer that we formerly had a channel with. + string remote_pubkey = 5; + + // Total capacity of the channel. + int64 capacity = 6; + + // Height at which the funding transaction was spent. + uint32 close_height = 7; + + // Settled balance at the time of channel closure + int64 settled_balance = 8; + + // The sum of all the time-locked outputs at the time of channel closure + int64 time_locked_balance = 9; + + enum ClosureType { + COOPERATIVE_CLOSE = 0; + LOCAL_FORCE_CLOSE = 1; + REMOTE_FORCE_CLOSE = 2; + BREACH_CLOSE = 3; + FUNDING_CANCELED = 4; + ABANDONED = 5; + } + + // Details on how the channel was closed. + ClosureType close_type = 10; + + /* + Open initiator is the party that initiated opening the channel. Note that + this value may be unknown if the channel was closed before we migrated to + store open channel information after close. + */ + Initiator open_initiator = 11; + + /* + Close initiator indicates which party initiated the close. This value will + be unknown for channels that were cooperatively closed before we started + tracking cooperative close initiators. Note that this indicates which party + initiated a close, and it is possible for both to initiate cooperative or + force closes, although only one party's close will be confirmed on chain. + */ + Initiator close_initiator = 12; + + repeated Resolution resolutions = 13; +} + +enum ResolutionType { + TYPE_UNKNOWN = 0; + + // We resolved an anchor output. + ANCHOR = 1; + + /* + We are resolving an incoming htlc on chain. This if this htlc is + claimed, we swept the incoming htlc with the preimage. If it is timed + out, our peer swept the timeout path. + */ + INCOMING_HTLC = 2; + + /* + We are resolving an outgoing htlc on chain. If this htlc is claimed, + the remote party swept the htlc with the preimage. If it is timed out, + we swept it with the timeout path. + */ + OUTGOING_HTLC = 3; + + // We force closed and need to sweep our time locked commitment output. + COMMIT = 4; +} + +enum ResolutionOutcome { + // Outcome unknown. + OUTCOME_UNKNOWN = 0; + + // An output was claimed on chain. + CLAIMED = 1; + + // An output was left unclaimed on chain. + UNCLAIMED = 2; + + /* + ResolverOutcomeAbandoned indicates that an output that we did not + claim on chain, for example an anchor that we did not sweep and a + third party claimed on chain, or a htlc that we could not decode + so left unclaimed. + */ + ABANDONED = 3; + + /* + If we force closed our channel, our htlcs need to be claimed in two + stages. This outcome represents the broadcast of a timeout or success + transaction for this two stage htlc claim. + */ + FIRST_STAGE = 4; + + // A htlc was timed out on chain. + TIMEOUT = 5; +} + +message Resolution { + // The type of output we are resolving. + ResolutionType resolution_type = 1; + + // The outcome of our on chain action that resolved the outpoint. + ResolutionOutcome outcome = 2; + + // The outpoint that was spent by the resolution. + OutPoint outpoint = 3; + + // The amount that was claimed by the resolution. + uint64 amount_sat = 4; + + // The hex-encoded transaction ID of the sweep transaction that spent the + // output. + string sweep_txid = 5; +} + +message ClosedChannelsRequest { + bool cooperative = 1; + bool local_force = 2; + bool remote_force = 3; + bool breach = 4; + bool funding_canceled = 5; + bool abandoned = 6; +} + +message ClosedChannelsResponse { + repeated ChannelCloseSummary channels = 1; +} + +message Peer { + // The identity pubkey of the peer + string pub_key = 1; + + // Network address of the peer; eg `127.0.0.1:10011` + string address = 3; + + // Bytes of data transmitted to this peer + uint64 bytes_sent = 4; + + // Bytes of data transmitted from this peer + uint64 bytes_recv = 5; + + // Satoshis sent to this peer + int64 sat_sent = 6; + + // Satoshis received from this peer + int64 sat_recv = 7; + + // A channel is inbound if the counterparty initiated the channel + bool inbound = 8; + + // Ping time to this peer + int64 ping_time = 9; + + enum SyncType { + /* + Denotes that we cannot determine the peer's current sync type. + */ + UNKNOWN_SYNC = 0; + + /* + Denotes that we are actively receiving new graph updates from the peer. + */ + ACTIVE_SYNC = 1; + + /* + Denotes that we are not receiving new graph updates from the peer. + */ + PASSIVE_SYNC = 2; + } + + // The type of sync we are currently performing with this peer. + SyncType sync_type = 10; + + // Features advertised by the remote peer in their init message. + map features = 11; + + /* + The latest errors received from our peer with timestamps, limited to the 10 + most recent errors. These errors are tracked across peer connections, but + are not persisted across lnd restarts. Note that these errors are only + stored for peers that we have channels open with, to prevent peers from + spamming us with errors at no cost. + */ + repeated TimestampedError errors = 12; + + /* + The number of times we have recorded this peer going offline or coming + online, recorded across restarts. Note that this value is decreased over + time if the peer has not recently flapped, so that we can forgive peers + with historically high flap counts. + */ + int32 flap_count = 13; + + /* + The timestamp of the last flap we observed for this peer. If this value is + zero, we have not observed any flaps for this peer. + */ + int64 last_flap_ns = 14; +} + +message TimestampedError { + // The unix timestamp in seconds when the error occurred. + uint64 timestamp = 1; + + // The string representation of the error sent by our peer. + string error = 2; +} + +message ListPeersRequest { + /* + If true, only the last error that our peer sent us will be returned with + the peer's information, rather than the full set of historic errors we have + stored. + */ + bool latest_error = 1; +} +message ListPeersResponse { + // The list of currently connected peers + repeated Peer peers = 1; +} + +message PeerEventSubscription { +} + +message PeerEvent { + // The identity pubkey of the peer. + string pub_key = 1; + + enum EventType { + PEER_ONLINE = 0; + PEER_OFFLINE = 1; + } + + EventType type = 2; +} + +message GetInfoRequest { +} +message GetInfoResponse { + // The version of the LND software that the node is running. + string version = 14; + + // The SHA1 commit hash that the daemon is compiled with. + string commit_hash = 20; + + // The identity pubkey of the current node. + string identity_pubkey = 1; + + // If applicable, the alias of the current node, e.g. "bob" + string alias = 2; + + // The color of the current node in hex code format + string color = 17; + + // Number of pending channels + uint32 num_pending_channels = 3; + + // Number of active channels + uint32 num_active_channels = 4; + + // Number of inactive channels + uint32 num_inactive_channels = 15; + + // Number of peers + uint32 num_peers = 5; + + // The node's current view of the height of the best block + uint32 block_height = 6; + + // The node's current view of the hash of the best block + string block_hash = 8; + + // Timestamp of the block best known to the wallet + int64 best_header_timestamp = 13; + + // Whether the wallet's view is synced to the main chain + bool synced_to_chain = 9; + + // Whether we consider ourselves synced with the public channel graph. + bool synced_to_graph = 18; + + /* + Whether the current node is connected to testnet. This field is + deprecated and the network field should be used instead + **/ + bool testnet = 10 [deprecated = true]; + + reserved 11; + + // A list of active chains the node is connected to + repeated Chain chains = 16; + + // The URIs of the current node. + repeated string uris = 12; + + /* + Features that our node has advertised in our init message, node + announcements and invoices. + */ + map features = 19; +} + +message GetRecoveryInfoRequest { +} +message GetRecoveryInfoResponse { + // Whether the wallet is in recovery mode + bool recovery_mode = 1; + + // Whether the wallet recovery progress is finished + bool recovery_finished = 2; + + // The recovery progress, ranging from 0 to 1. + double progress = 3; +} + +message Chain { + // The blockchain the node is on (eg bitcoin, litecoin) + string chain = 1; + + // The network the node is on (eg regtest, testnet, mainnet) + string network = 2; +} + +message ConfirmationUpdate { + bytes block_sha = 1; + int32 block_height = 2; + + uint32 num_confs_left = 3; +} + +message ChannelOpenUpdate { + ChannelPoint channel_point = 1; +} + +message ChannelCloseUpdate { + bytes closing_txid = 1; + + bool success = 2; +} + +message CloseChannelRequest { + /* + The outpoint (txid:index) of the funding transaction. With this value, Bob + will be able to generate a signature for Alice's version of the commitment + transaction. + */ + ChannelPoint channel_point = 1; + + // If true, then the channel will be closed forcibly. This means the + // current commitment transaction will be signed and broadcast. + bool force = 2; + + // The target number of blocks that the closure transaction should be + // confirmed by. + int32 target_conf = 3; + + // A manual fee rate set in sat/byte that should be used when crafting the + // closure transaction. + int64 sat_per_byte = 4; + + /* + An optional address to send funds to in the case of a cooperative close. + If the channel was opened with an upfront shutdown script and this field + is set, the request to close will fail because the channel must pay out + to the upfront shutdown addresss. + */ + string delivery_address = 5; +} + +message CloseStatusUpdate { + oneof update { + PendingUpdate close_pending = 1; + ChannelCloseUpdate chan_close = 3; + } +} + +message PendingUpdate { + bytes txid = 1; + uint32 output_index = 2; +} + +message ReadyForPsbtFunding { + /* + The P2WSH address of the channel funding multisig address that the below + specified amount in satoshis needs to be sent to. + */ + string funding_address = 1; + + /* + The exact amount in satoshis that needs to be sent to the above address to + fund the pending channel. + */ + int64 funding_amount = 2; + + /* + A raw PSBT that contains the pending channel output. If a base PSBT was + provided in the PsbtShim, this is the base PSBT with one additional output. + If no base PSBT was specified, this is an otherwise empty PSBT with exactly + one output. + */ + bytes psbt = 3; +} + +message OpenChannelRequest { + /* + The pubkey of the node to open a channel with. When using REST, this field + must be encoded as base64. + */ + bytes node_pubkey = 2; + + /* + The hex encoded pubkey of the node to open a channel with. Deprecated now + that the REST gateway supports base64 encoding of bytes fields. + */ + string node_pubkey_string = 3 [deprecated = true]; + + // The number of satoshis the wallet should commit to the channel + int64 local_funding_amount = 4; + + // The number of satoshis to push to the remote side as part of the initial + // commitment state + int64 push_sat = 5; + + // The target number of blocks that the funding transaction should be + // confirmed by. + int32 target_conf = 6; + + // A manual fee rate set in sat/byte that should be used when crafting the + // funding transaction. + int64 sat_per_byte = 7; + + // Whether this channel should be private, not announced to the greater + // network. + bool private = 8; + + // The minimum value in millisatoshi we will require for incoming HTLCs on + // the channel. + int64 min_htlc_msat = 9; + + // The delay we require on the remote's commitment transaction. If this is + // not set, it will be scaled automatically with the channel size. + uint32 remote_csv_delay = 10; + + // The minimum number of confirmations each one of your outputs used for + // the funding transaction must satisfy. + int32 min_confs = 11; + + // Whether unconfirmed outputs should be used as inputs for the funding + // transaction. + bool spend_unconfirmed = 12; + + /* + Close address is an optional address which specifies the address to which + funds should be paid out to upon cooperative close. This field may only be + set if the peer supports the option upfront feature bit (call listpeers + to check). The remote peer will only accept cooperative closes to this + address if it is set. + + Note: If this value is set on channel creation, you will *not* be able to + cooperatively close out to a different address. + */ + string close_address = 13; + + /* + Funding shims are an optional argument that allow the caller to intercept + certain funding functionality. For example, a shim can be provided to use a + particular key for the commitment key (ideally cold) rather than use one + that is generated by the wallet as normal, or signal that signing will be + carried out in an interactive manner (PSBT based). + */ + FundingShim funding_shim = 14; + + /* + The maximum amount of coins in millisatoshi that can be pending within + the channel. It only applies to the remote party. + */ + uint64 remote_max_value_in_flight_msat = 15; + + /* + The maximum number of concurrent HTLCs we will allow the remote party to add + to the commitment transaction. + */ + uint32 remote_max_htlcs = 16; +} +message OpenStatusUpdate { + oneof update { + /* + Signals that the channel is now fully negotiated and the funding + transaction published. + */ + PendingUpdate chan_pending = 1; + + /* + Signals that the channel's funding transaction has now reached the + required number of confirmations on chain and can be used. + */ + ChannelOpenUpdate chan_open = 3; + + /* + Signals that the funding process has been suspended and the construction + of a PSBT that funds the channel PK script is now required. + */ + ReadyForPsbtFunding psbt_fund = 5; + } + + /* + The pending channel ID of the created channel. This value may be used to + further the funding flow manually via the FundingStateStep method. + */ + bytes pending_chan_id = 4; +} + +message KeyLocator { + // The family of key being identified. + int32 key_family = 1; + + // The precise index of the key being identified. + int32 key_index = 2; +} + +message KeyDescriptor { + /* + The raw bytes of the key being identified. + */ + bytes raw_key_bytes = 1; + + /* + The key locator that identifies which key to use for signing. + */ + KeyLocator key_loc = 2; +} + +message ChanPointShim { + /* + The size of the pre-crafted output to be used as the channel point for this + channel funding. + */ + int64 amt = 1; + + // The target channel point to refrence in created commitment transactions. + ChannelPoint chan_point = 2; + + // Our local key to use when creating the multi-sig output. + KeyDescriptor local_key = 3; + + // The key of the remote party to use when creating the multi-sig output. + bytes remote_key = 4; + + /* + If non-zero, then this will be used as the pending channel ID on the wire + protocol to initate the funding request. This is an optional field, and + should only be set if the responder is already expecting a specific pending + channel ID. + */ + bytes pending_chan_id = 5; + + /* + This uint32 indicates if this channel is to be considered 'frozen'. A frozen + channel does not allow a cooperative channel close by the initiator. The + thaw_height is the height that this restriction stops applying to the + channel. The height can be interpreted in two ways: as a relative height if + the value is less than 500,000, or as an absolute height otherwise. + */ + uint32 thaw_height = 6; +} + +message PsbtShim { + /* + A unique identifier of 32 random bytes that will be used as the pending + channel ID to identify the PSBT state machine when interacting with it and + on the wire protocol to initiate the funding request. + */ + bytes pending_chan_id = 1; + + /* + An optional base PSBT the new channel output will be added to. If this is + non-empty, it must be a binary serialized PSBT. + */ + bytes base_psbt = 2; + + /* + If a channel should be part of a batch (multiple channel openings in one + transaction), it can be dangerous if the whole batch transaction is + published too early before all channel opening negotiations are completed. + This flag prevents this particular channel from broadcasting the transaction + after the negotiation with the remote peer. In a batch of channel openings + this flag should be set to true for every channel but the very last. + */ + bool no_publish = 3; +} + +message FundingShim { + oneof shim { + /* + A channel shim where the channel point was fully constructed outside + of lnd's wallet and the transaction might already be published. + */ + ChanPointShim chan_point_shim = 1; + + /* + A channel shim that uses a PSBT to fund and sign the channel funding + transaction. + */ + PsbtShim psbt_shim = 2; + } +} + +message FundingShimCancel { + // The pending channel ID of the channel to cancel the funding shim for. + bytes pending_chan_id = 1; +} + +message FundingPsbtVerify { + /* + The funded but not yet signed PSBT that sends the exact channel capacity + amount to the PK script returned in the open channel message in a previous + step. + */ + bytes funded_psbt = 1; + + // The pending channel ID of the channel to get the PSBT for. + bytes pending_chan_id = 2; +} + +message FundingPsbtFinalize { + /* + The funded PSBT that contains all witness data to send the exact channel + capacity amount to the PK script returned in the open channel message in a + previous step. Cannot be set at the same time as final_raw_tx. + */ + bytes signed_psbt = 1; + + // The pending channel ID of the channel to get the PSBT for. + bytes pending_chan_id = 2; + + /* + As an alternative to the signed PSBT with all witness data, the final raw + wire format transaction can also be specified directly. Cannot be set at the + same time as signed_psbt. + */ + bytes final_raw_tx = 3; +} + +message FundingTransitionMsg { + oneof trigger { + /* + The funding shim to register. This should be used before any + channel funding has began by the remote party, as it is intended as a + preparatory step for the full channel funding. + */ + FundingShim shim_register = 1; + + // Used to cancel an existing registered funding shim. + FundingShimCancel shim_cancel = 2; + + /* + Used to continue a funding flow that was initiated to be executed + through a PSBT. This step verifies that the PSBT contains the correct + outputs to fund the channel. + */ + FundingPsbtVerify psbt_verify = 3; + + /* + Used to continue a funding flow that was initiated to be executed + through a PSBT. This step finalizes the funded and signed PSBT, finishes + negotiation with the peer and finally publishes the resulting funding + transaction. + */ + FundingPsbtFinalize psbt_finalize = 4; + } +} + +message FundingStateStepResp { +} + +message PendingHTLC { + // The direction within the channel that the htlc was sent + bool incoming = 1; + + // The total value of the htlc + int64 amount = 2; + + // The final output to be swept back to the user's wallet + string outpoint = 3; + + // The next block height at which we can spend the current stage + uint32 maturity_height = 4; + + /* + The number of blocks remaining until the current stage can be swept. + Negative values indicate how many blocks have passed since becoming + mature. + */ + int32 blocks_til_maturity = 5; + + // Indicates whether the htlc is in its first or second stage of recovery + uint32 stage = 6; +} + +message PendingChannelsRequest { +} +message PendingChannelsResponse { + message PendingChannel { + string remote_node_pub = 1; + string channel_point = 2; + + int64 capacity = 3; + + int64 local_balance = 4; + int64 remote_balance = 5; + + // The minimum satoshis this node is required to reserve in its + // balance. + int64 local_chan_reserve_sat = 6; + + /* + The minimum satoshis the other node is required to reserve in its + balance. + */ + int64 remote_chan_reserve_sat = 7; + + // The party that initiated opening the channel. + Initiator initiator = 8; + + // The commitment type used by this channel. + CommitmentType commitment_type = 9; + } + + message PendingOpenChannel { + // The pending channel + PendingChannel channel = 1; + + // The height at which this channel will be confirmed + uint32 confirmation_height = 2; + + /* + The amount calculated to be paid in fees for the current set of + commitment transactions. The fee amount is persisted with the channel + in order to allow the fee amount to be removed and recalculated with + each channel state update, including updates that happen after a system + restart. + */ + int64 commit_fee = 4; + + // The weight of the commitment transaction + int64 commit_weight = 5; + + /* + The required number of satoshis per kilo-weight that the requester will + pay at all times, for both the funding transaction and commitment + transaction. This value can later be updated once the channel is open. + */ + int64 fee_per_kw = 6; + } + + message WaitingCloseChannel { + // The pending channel waiting for closing tx to confirm + PendingChannel channel = 1; + + // The balance in satoshis encumbered in this channel + int64 limbo_balance = 2; + + /* + A list of valid commitment transactions. Any of these can confirm at + this point. + */ + Commitments commitments = 3; + } + + message Commitments { + // Hash of the local version of the commitment tx. + string local_txid = 1; + + // Hash of the remote version of the commitment tx. + string remote_txid = 2; + + // Hash of the remote pending version of the commitment tx. + string remote_pending_txid = 3; + + /* + The amount in satoshis calculated to be paid in fees for the local + commitment. + */ + uint64 local_commit_fee_sat = 4; + + /* + The amount in satoshis calculated to be paid in fees for the remote + commitment. + */ + uint64 remote_commit_fee_sat = 5; + + /* + The amount in satoshis calculated to be paid in fees for the remote + pending commitment. + */ + uint64 remote_pending_commit_fee_sat = 6; + } + + message ClosedChannel { + // The pending channel to be closed + PendingChannel channel = 1; + + // The transaction id of the closing transaction + string closing_txid = 2; + } + + message ForceClosedChannel { + // The pending channel to be force closed + PendingChannel channel = 1; + + // The transaction id of the closing transaction + string closing_txid = 2; + + // The balance in satoshis encumbered in this pending channel + int64 limbo_balance = 3; + + // The height at which funds can be swept into the wallet + uint32 maturity_height = 4; + + /* + Remaining # of blocks until the commitment output can be swept. + Negative values indicate how many blocks have passed since becoming + mature. + */ + int32 blocks_til_maturity = 5; + + // The total value of funds successfully recovered from this channel + int64 recovered_balance = 6; + + repeated PendingHTLC pending_htlcs = 8; + + enum AnchorState { + LIMBO = 0; + RECOVERED = 1; + LOST = 2; + } + + AnchorState anchor = 9; + } + + // The balance in satoshis encumbered in pending channels + int64 total_limbo_balance = 1; + + // Channels pending opening + repeated PendingOpenChannel pending_open_channels = 2; + + /* + Deprecated: Channels pending closing previously contained cooperatively + closed channels with a single confirmation. These channels are now + considered closed from the time we see them on chain. + */ + repeated ClosedChannel pending_closing_channels = 3 [deprecated = true]; + + // Channels pending force closing + repeated ForceClosedChannel pending_force_closing_channels = 4; + + // Channels waiting for closing tx to confirm + repeated WaitingCloseChannel waiting_close_channels = 5; +} + +message ChannelEventSubscription { +} + +message ChannelEventUpdate { + oneof channel { + Channel open_channel = 1; + ChannelCloseSummary closed_channel = 2; + ChannelPoint active_channel = 3; + ChannelPoint inactive_channel = 4; + PendingUpdate pending_open_channel = 6; + } + + enum UpdateType { + OPEN_CHANNEL = 0; + CLOSED_CHANNEL = 1; + ACTIVE_CHANNEL = 2; + INACTIVE_CHANNEL = 3; + PENDING_OPEN_CHANNEL = 4; + } + + UpdateType type = 5; +} + +message WalletBalanceRequest { +} +message WalletBalanceResponse { + // The balance of the wallet + int64 total_balance = 1; + + // The confirmed balance of a wallet(with >= 1 confirmations) + int64 confirmed_balance = 2; + + // The unconfirmed balance of a wallet(with 0 confirmations) + int64 unconfirmed_balance = 3; +} + +message Amount { + // Value denominated in satoshis. + uint64 sat = 1; + + // Value denominated in milli-satoshis. + uint64 msat = 2; +} + +message ChannelBalanceRequest { +} +message ChannelBalanceResponse { + // Deprecated. Sum of channels balances denominated in satoshis + int64 balance = 1 [deprecated = true]; + + // Deprecated. Sum of channels pending balances denominated in satoshis + int64 pending_open_balance = 2 [deprecated = true]; + + // Sum of channels local balances. + Amount local_balance = 3; + + // Sum of channels remote balances. + Amount remote_balance = 4; + + // Sum of channels local unsettled balances. + Amount unsettled_local_balance = 5; + + // Sum of channels remote unsettled balances. + Amount unsettled_remote_balance = 6; + + // Sum of channels pending local balances. + Amount pending_open_local_balance = 7; + + // Sum of channels pending remote balances. + Amount pending_open_remote_balance = 8; +} + +message QueryRoutesRequest { + // The 33-byte hex-encoded public key for the payment destination + string pub_key = 1; + + /* + The amount to send expressed in satoshis. + + The fields amt and amt_msat are mutually exclusive. + */ + int64 amt = 2; + + /* + The amount to send expressed in millisatoshis. + + The fields amt and amt_msat are mutually exclusive. + */ + int64 amt_msat = 12; + + reserved 3; + + /* + An optional CLTV delta from the current height that should be used for the + timelock of the final hop. Note that unlike SendPayment, QueryRoutes does + not add any additional block padding on top of final_ctlv_delta. This + padding of a few blocks needs to be added manually or otherwise failures may + happen when a block comes in while the payment is in flight. + */ + int32 final_cltv_delta = 4; + + /* + The maximum number of satoshis that will be paid as a fee of the payment. + This value can be represented either as a percentage of the amount being + sent, or as a fixed amount of the maximum fee the user is willing the pay to + send the payment. + */ + FeeLimit fee_limit = 5; + + /* + A list of nodes to ignore during path finding. When using REST, these fields + must be encoded as base64. + */ + repeated bytes ignored_nodes = 6; + + /* + Deprecated. A list of edges to ignore during path finding. + */ + repeated EdgeLocator ignored_edges = 7 [deprecated = true]; + + /* + The source node where the request route should originated from. If empty, + self is assumed. + */ + string source_pub_key = 8; + + /* + If set to true, edge probabilities from mission control will be used to get + the optimal route. + */ + bool use_mission_control = 9; + + /* + A list of directed node pairs that will be ignored during path finding. + */ + repeated NodePair ignored_pairs = 10; + + /* + An optional maximum total time lock for the route. If the source is empty or + ourselves, this should not exceed lnd's `--max-cltv-expiry` setting. If + zero, then the value of `--max-cltv-expiry` is used as the limit. + */ + uint32 cltv_limit = 11; + + /* + An optional field that can be used to pass an arbitrary set of TLV records + to a peer which understands the new records. This can be used to pass + application specific data during the payment attempt. If the destination + does not support the specified recrods, and error will be returned. + Record types are required to be in the custom range >= 65536. When using + REST, the values must be encoded as base64. + */ + map dest_custom_records = 13; + + /* + The channel id of the channel that must be taken to the first hop. If zero, + any channel may be used. + */ + uint64 outgoing_chan_id = 14 [jstype = JS_STRING]; + + /* + The pubkey of the last hop of the route. If empty, any hop may be used. + */ + bytes last_hop_pubkey = 15; + + /* + Optional route hints to reach the destination through private channels. + */ + repeated lnrpc.RouteHint route_hints = 16; + + /* + Features assumed to be supported by the final node. All transitive feature + dependencies must also be set properly. For a given feature bit pair, either + optional or remote may be set, but not both. If this field is nil or empty, + the router will try to load destination features from the graph as a + fallback. + */ + repeated lnrpc.FeatureBit dest_features = 17; +} + +message NodePair { + /* + The sending node of the pair. When using REST, this field must be encoded as + base64. + */ + bytes from = 1; + + /* + The receiving node of the pair. When using REST, this field must be encoded + as base64. + */ + bytes to = 2; +} + +message EdgeLocator { + // The short channel id of this edge. + uint64 channel_id = 1 [jstype = JS_STRING]; + + /* + The direction of this edge. If direction_reverse is false, the direction + of this edge is from the channel endpoint with the lexicographically smaller + pub key to the endpoint with the larger pub key. If direction_reverse is + is true, the edge goes the other way. + */ + bool direction_reverse = 2; +} + +message QueryRoutesResponse { + /* + The route that results from the path finding operation. This is still a + repeated field to retain backwards compatibility. + */ + repeated Route routes = 1; + + /* + The success probability of the returned route based on the current mission + control state. [EXPERIMENTAL] + */ + double success_prob = 2; +} + +message Hop { + /* + The unique channel ID for the channel. The first 3 bytes are the block + height, the next 3 the index within the block, and the last 2 bytes are the + output index for the channel. + */ + uint64 chan_id = 1 [jstype = JS_STRING]; + int64 chan_capacity = 2; + int64 amt_to_forward = 3 [deprecated = true]; + int64 fee = 4 [deprecated = true]; + uint32 expiry = 5; + int64 amt_to_forward_msat = 6; + int64 fee_msat = 7; + + /* + An optional public key of the hop. If the public key is given, the payment + can be executed without relying on a copy of the channel graph. + */ + string pub_key = 8; + + /* + If set to true, then this hop will be encoded using the new variable length + TLV format. Note that if any custom tlv_records below are specified, then + this field MUST be set to true for them to be encoded properly. + */ + bool tlv_payload = 9; + + /* + An optional TLV record that signals the use of an MPP payment. If present, + the receiver will enforce that that the same mpp_record is included in the + final hop payload of all non-zero payments in the HTLC set. If empty, a + regular single-shot payment is or was attempted. + */ + MPPRecord mpp_record = 10; + + /* + An optional set of key-value TLV records. This is useful within the context + of the SendToRoute call as it allows callers to specify arbitrary K-V pairs + to drop off at each hop within the onion. + */ + map custom_records = 11; +} + +message MPPRecord { + /* + A unique, random identifier used to authenticate the sender as the intended + payer of a multi-path payment. The payment_addr must be the same for all + subpayments, and match the payment_addr provided in the receiver's invoice. + The same payment_addr must be used on all subpayments. + */ + bytes payment_addr = 11; + + /* + The total amount in milli-satoshis being sent as part of a larger multi-path + payment. The caller is responsible for ensuring subpayments to the same node + and payment_hash sum exactly to total_amt_msat. The same + total_amt_msat must be used on all subpayments. + */ + int64 total_amt_msat = 10; +} + +/* +A path through the channel graph which runs over one or more channels in +succession. This struct carries all the information required to craft the +Sphinx onion packet, and send the payment along the first hop in the path. A +route is only selected as valid if all the channels have sufficient capacity to +carry the initial payment amount after fees are accounted for. +*/ +message Route { + /* + The cumulative (final) time lock across the entire route. This is the CLTV + value that should be extended to the first hop in the route. All other hops + will decrement the time-lock as advertised, leaving enough time for all + hops to wait for or present the payment preimage to complete the payment. + */ + uint32 total_time_lock = 1; + + /* + The sum of the fees paid at each hop within the final route. In the case + of a one-hop payment, this value will be zero as we don't need to pay a fee + to ourselves. + */ + int64 total_fees = 2 [deprecated = true]; + + /* + The total amount of funds required to complete a payment over this route. + This value includes the cumulative fees at each hop. As a result, the HTLC + extended to the first-hop in the route will need to have at least this many + satoshis, otherwise the route will fail at an intermediate node due to an + insufficient amount of fees. + */ + int64 total_amt = 3 [deprecated = true]; + + /* + Contains details concerning the specific forwarding details at each hop. + */ + repeated Hop hops = 4; + + /* + The total fees in millisatoshis. + */ + int64 total_fees_msat = 5; + + /* + The total amount in millisatoshis. + */ + int64 total_amt_msat = 6; +} + +message NodeInfoRequest { + // The 33-byte hex-encoded compressed public of the target node + string pub_key = 1; + + // If true, will include all known channels associated with the node. + bool include_channels = 2; +} + +message NodeInfo { + /* + An individual vertex/node within the channel graph. A node is + connected to other nodes by one or more channel edges emanating from it. As + the graph is directed, a node will also have an incoming edge attached to + it for each outgoing edge. + */ + LightningNode node = 1; + + // The total number of channels for the node. + uint32 num_channels = 2; + + // The sum of all channels capacity for the node, denominated in satoshis. + int64 total_capacity = 3; + + // A list of all public channels for the node. + repeated ChannelEdge channels = 4; +} + +/* +An individual vertex/node within the channel graph. A node is +connected to other nodes by one or more channel edges emanating from it. As the +graph is directed, a node will also have an incoming edge attached to it for +each outgoing edge. +*/ +message LightningNode { + uint32 last_update = 1; + string pub_key = 2; + string alias = 3; + repeated NodeAddress addresses = 4; + string color = 5; + map features = 6; +} + +message NodeAddress { + string network = 1; + string addr = 2; +} + +message RoutingPolicy { + uint32 time_lock_delta = 1; + int64 min_htlc = 2; + int64 fee_base_msat = 3; + int64 fee_rate_milli_msat = 4; + bool disabled = 5; + uint64 max_htlc_msat = 6; + uint32 last_update = 7; +} + +/* +A fully authenticated channel along with all its unique attributes. +Once an authenticated channel announcement has been processed on the network, +then an instance of ChannelEdgeInfo encapsulating the channels attributes is +stored. The other portions relevant to routing policy of a channel are stored +within a ChannelEdgePolicy for each direction of the channel. +*/ +message ChannelEdge { + /* + The unique channel ID for the channel. The first 3 bytes are the block + height, the next 3 the index within the block, and the last 2 bytes are the + output index for the channel. + */ + uint64 channel_id = 1 [jstype = JS_STRING]; + string chan_point = 2; + + uint32 last_update = 3 [deprecated = true]; + + string node1_pub = 4; + string node2_pub = 5; + + int64 capacity = 6; + + RoutingPolicy node1_policy = 7; + RoutingPolicy node2_policy = 8; +} + +message ChannelGraphRequest { + /* + Whether unannounced channels are included in the response or not. If set, + unannounced channels are included. Unannounced channels are both private + channels, and public channels that are not yet announced to the network. + */ + bool include_unannounced = 1; +} + +// Returns a new instance of the directed channel graph. +message ChannelGraph { + // The list of `LightningNode`s in this channel graph + repeated LightningNode nodes = 1; + + // The list of `ChannelEdge`s in this channel graph + repeated ChannelEdge edges = 2; +} + +enum NodeMetricType { + UNKNOWN = 0; + BETWEENNESS_CENTRALITY = 1; +} + +message NodeMetricsRequest { + // The requested node metrics. + repeated NodeMetricType types = 1; +} + +message NodeMetricsResponse { + /* + Betweenness centrality is the sum of the ratio of shortest paths that pass + through the node for each pair of nodes in the graph (not counting paths + starting or ending at this node). + Map of node pubkey to betweenness centrality of the node. Normalized + values are in the [0,1] closed interval. + */ + map betweenness_centrality = 1; +} + +message FloatMetric { + // Arbitrary float value. + double value = 1; + + // The value normalized to [0,1] or [-1,1]. + double normalized_value = 2; +} + +message ChanInfoRequest { + /* + The unique channel ID for the channel. The first 3 bytes are the block + height, the next 3 the index within the block, and the last 2 bytes are the + output index for the channel. + */ + uint64 chan_id = 1 [jstype = JS_STRING]; +} + +message NetworkInfoRequest { +} +message NetworkInfo { + uint32 graph_diameter = 1; + double avg_out_degree = 2; + uint32 max_out_degree = 3; + + uint32 num_nodes = 4; + uint32 num_channels = 5; + + int64 total_network_capacity = 6; + + double avg_channel_size = 7; + int64 min_channel_size = 8; + int64 max_channel_size = 9; + int64 median_channel_size_sat = 10; + + // The number of edges marked as zombies. + uint64 num_zombie_chans = 11; + + // TODO(roasbeef): fee rate info, expiry + // * also additional RPC for tracking fee info once in +} + +message StopRequest { +} +message StopResponse { +} + +message GraphTopologySubscription { +} +message GraphTopologyUpdate { + repeated NodeUpdate node_updates = 1; + repeated ChannelEdgeUpdate channel_updates = 2; + repeated ClosedChannelUpdate closed_chans = 3; +} +message NodeUpdate { + repeated string addresses = 1; + string identity_key = 2; + bytes global_features = 3; + string alias = 4; + string color = 5; +} +message ChannelEdgeUpdate { + /* + The unique channel ID for the channel. The first 3 bytes are the block + height, the next 3 the index within the block, and the last 2 bytes are the + output index for the channel. + */ + uint64 chan_id = 1 [jstype = JS_STRING]; + + ChannelPoint chan_point = 2; + + int64 capacity = 3; + + RoutingPolicy routing_policy = 4; + + string advertising_node = 5; + string connecting_node = 6; +} +message ClosedChannelUpdate { + /* + The unique channel ID for the channel. The first 3 bytes are the block + height, the next 3 the index within the block, and the last 2 bytes are the + output index for the channel. + */ + uint64 chan_id = 1 [jstype = JS_STRING]; + int64 capacity = 2; + uint32 closed_height = 3; + ChannelPoint chan_point = 4; +} + +message HopHint { + // The public key of the node at the start of the channel. + string node_id = 1; + + // The unique identifier of the channel. + uint64 chan_id = 2 [jstype = JS_STRING]; + + // The base fee of the channel denominated in millisatoshis. + uint32 fee_base_msat = 3; + + /* + The fee rate of the channel for sending one satoshi across it denominated in + millionths of a satoshi. + */ + uint32 fee_proportional_millionths = 4; + + // The time-lock delta of the channel. + uint32 cltv_expiry_delta = 5; +} + +message RouteHint { + /* + A list of hop hints that when chained together can assist in reaching a + specific destination. + */ + repeated HopHint hop_hints = 1; +} + +message Invoice { + /* + An optional memo to attach along with the invoice. Used for record keeping + purposes for the invoice's creator, and will also be set in the description + field of the encoded payment request if the description_hash field is not + being used. + */ + string memo = 1; + + reserved 2; + + /* + The hex-encoded preimage (32 byte) which will allow settling an incoming + HTLC payable to this preimage. When using REST, this field must be encoded + as base64. + */ + bytes r_preimage = 3; + + /* + The hash of the preimage. When using REST, this field must be encoded as + base64. + */ + bytes r_hash = 4; + + /* + The value of this invoice in satoshis + + The fields value and value_msat are mutually exclusive. + */ + int64 value = 5; + + /* + The value of this invoice in millisatoshis + + The fields value and value_msat are mutually exclusive. + */ + int64 value_msat = 23; + + // Whether this invoice has been fulfilled + bool settled = 6 [deprecated = true]; + + // When this invoice was created + int64 creation_date = 7; + + // When this invoice was settled + int64 settle_date = 8; + + /* + A bare-bones invoice for a payment within the Lightning Network. With the + details of the invoice, the sender has all the data necessary to send a + payment to the recipient. + */ + string payment_request = 9; + + /* + Hash (SHA-256) of a description of the payment. Used if the description of + payment (memo) is too long to naturally fit within the description field + of an encoded payment request. When using REST, this field must be encoded + as base64. + */ + bytes description_hash = 10; + + // Payment request expiry time in seconds. Default is 3600 (1 hour). + int64 expiry = 11; + + // Fallback on-chain address. + string fallback_addr = 12; + + // Delta to use for the time-lock of the CLTV extended to the final hop. + uint64 cltv_expiry = 13; + + /* + Route hints that can each be individually used to assist in reaching the + invoice's destination. + */ + repeated RouteHint route_hints = 14; + + // Whether this invoice should include routing hints for private channels. + bool private = 15; + + /* + The "add" index of this invoice. Each newly created invoice will increment + this index making it monotonically increasing. Callers to the + SubscribeInvoices call can use this to instantly get notified of all added + invoices with an add_index greater than this one. + */ + uint64 add_index = 16; + + /* + The "settle" index of this invoice. Each newly settled invoice will + increment this index making it monotonically increasing. Callers to the + SubscribeInvoices call can use this to instantly get notified of all + settled invoices with an settle_index greater than this one. + */ + uint64 settle_index = 17; + + // Deprecated, use amt_paid_sat or amt_paid_msat. + int64 amt_paid = 18 [deprecated = true]; + + /* + The amount that was accepted for this invoice, in satoshis. This will ONLY + be set if this invoice has been settled. We provide this field as if the + invoice was created with a zero value, then we need to record what amount + was ultimately accepted. Additionally, it's possible that the sender paid + MORE that was specified in the original invoice. So we'll record that here + as well. + */ + int64 amt_paid_sat = 19; + + /* + The amount that was accepted for this invoice, in millisatoshis. This will + ONLY be set if this invoice has been settled. We provide this field as if + the invoice was created with a zero value, then we need to record what + amount was ultimately accepted. Additionally, it's possible that the sender + paid MORE that was specified in the original invoice. So we'll record that + here as well. + */ + int64 amt_paid_msat = 20; + + enum InvoiceState { + OPEN = 0; + SETTLED = 1; + CANCELED = 2; + ACCEPTED = 3; + } + + /* + The state the invoice is in. + */ + InvoiceState state = 21; + + // List of HTLCs paying to this invoice [EXPERIMENTAL]. + repeated InvoiceHTLC htlcs = 22; + + // List of features advertised on the invoice. + map features = 24; + + /* + Indicates if this invoice was a spontaneous payment that arrived via keysend + [EXPERIMENTAL]. + */ + bool is_keysend = 25; +} + +enum InvoiceHTLCState { + ACCEPTED = 0; + SETTLED = 1; + CANCELED = 2; +} + +// Details of an HTLC that paid to an invoice +message InvoiceHTLC { + // Short channel id over which the htlc was received. + uint64 chan_id = 1 [jstype = JS_STRING]; + + // Index identifying the htlc on the channel. + uint64 htlc_index = 2; + + // The amount of the htlc in msat. + uint64 amt_msat = 3; + + // Block height at which this htlc was accepted. + int32 accept_height = 4; + + // Time at which this htlc was accepted. + int64 accept_time = 5; + + // Time at which this htlc was settled or canceled. + int64 resolve_time = 6; + + // Block height at which this htlc expires. + int32 expiry_height = 7; + + // Current state the htlc is in. + InvoiceHTLCState state = 8; + + // Custom tlv records. + map custom_records = 9; + + // The total amount of the mpp payment in msat. + uint64 mpp_total_amt_msat = 10; +} + +message AddInvoiceResponse { + bytes r_hash = 1; + + /* + A bare-bones invoice for a payment within the Lightning Network. With the + details of the invoice, the sender has all the data necessary to send a + payment to the recipient. + */ + string payment_request = 2; + + /* + The "add" index of this invoice. Each newly created invoice will increment + this index making it monotonically increasing. Callers to the + SubscribeInvoices call can use this to instantly get notified of all added + invoices with an add_index greater than this one. + */ + uint64 add_index = 16; +} +message PaymentHash { + /* + The hex-encoded payment hash of the invoice to be looked up. The passed + payment hash must be exactly 32 bytes, otherwise an error is returned. + Deprecated now that the REST gateway supports base64 encoding of bytes + fields. + */ + string r_hash_str = 1 [deprecated = true]; + + /* + The payment hash of the invoice to be looked up. When using REST, this field + must be encoded as base64. + */ + bytes r_hash = 2; +} + +message ListInvoiceRequest { + /* + If set, only invoices that are not settled and not canceled will be returned + in the response. + */ + bool pending_only = 1; + + /* + The index of an invoice that will be used as either the start or end of a + query to determine which invoices should be returned in the response. + */ + uint64 index_offset = 4; + + // The max number of invoices to return in the response to this query. + uint64 num_max_invoices = 5; + + /* + If set, the invoices returned will result from seeking backwards from the + specified index offset. This can be used to paginate backwards. + */ + bool reversed = 6; +} +message ListInvoiceResponse { + /* + A list of invoices from the time slice of the time series specified in the + request. + */ + repeated Invoice invoices = 1; + + /* + The index of the last item in the set of returned invoices. This can be used + to seek further, pagination style. + */ + uint64 last_index_offset = 2; + + /* + The index of the last item in the set of returned invoices. This can be used + to seek backwards, pagination style. + */ + uint64 first_index_offset = 3; +} + +message InvoiceSubscription { + /* + If specified (non-zero), then we'll first start by sending out + notifications for all added indexes with an add_index greater than this + value. This allows callers to catch up on any events they missed while they + weren't connected to the streaming RPC. + */ + uint64 add_index = 1; + + /* + If specified (non-zero), then we'll first start by sending out + notifications for all settled indexes with an settle_index greater than + this value. This allows callers to catch up on any events they missed while + they weren't connected to the streaming RPC. + */ + uint64 settle_index = 2; +} + +enum PaymentFailureReason { + /* + Payment isn't failed (yet). + */ + FAILURE_REASON_NONE = 0; + + /* + There are more routes to try, but the payment timeout was exceeded. + */ + FAILURE_REASON_TIMEOUT = 1; + + /* + All possible routes were tried and failed permanently. Or were no + routes to the destination at all. + */ + FAILURE_REASON_NO_ROUTE = 2; + + /* + A non-recoverable error has occured. + */ + FAILURE_REASON_ERROR = 3; + + /* + Payment details incorrect (unknown hash, invalid amt or + invalid final cltv delta) + */ + FAILURE_REASON_INCORRECT_PAYMENT_DETAILS = 4; + + /* + Insufficient local balance. + */ + FAILURE_REASON_INSUFFICIENT_BALANCE = 5; +} + +message Payment { + // The payment hash + string payment_hash = 1; + + // Deprecated, use value_sat or value_msat. + int64 value = 2 [deprecated = true]; + + // Deprecated, use creation_time_ns + int64 creation_date = 3 [deprecated = true]; + + reserved 4; + + // Deprecated, use fee_sat or fee_msat. + int64 fee = 5 [deprecated = true]; + + // The payment preimage + string payment_preimage = 6; + + // The value of the payment in satoshis + int64 value_sat = 7; + + // The value of the payment in milli-satoshis + int64 value_msat = 8; + + // The optional payment request being fulfilled. + string payment_request = 9; + + enum PaymentStatus { + UNKNOWN = 0; + IN_FLIGHT = 1; + SUCCEEDED = 2; + FAILED = 3; + } + + // The status of the payment. + PaymentStatus status = 10; + + // The fee paid for this payment in satoshis + int64 fee_sat = 11; + + // The fee paid for this payment in milli-satoshis + int64 fee_msat = 12; + + // The time in UNIX nanoseconds at which the payment was created. + int64 creation_time_ns = 13; + + // The HTLCs made in attempt to settle the payment. + repeated HTLCAttempt htlcs = 14; + + /* + The creation index of this payment. Each payment can be uniquely identified + by this index, which may not strictly increment by 1 for payments made in + older versions of lnd. + */ + uint64 payment_index = 15; + + PaymentFailureReason failure_reason = 16; +} + +message HTLCAttempt { + enum HTLCStatus { + IN_FLIGHT = 0; + SUCCEEDED = 1; + FAILED = 2; + } + + // The status of the HTLC. + HTLCStatus status = 1; + + // The route taken by this HTLC. + Route route = 2; + + // The time in UNIX nanoseconds at which this HTLC was sent. + int64 attempt_time_ns = 3; + + /* + The time in UNIX nanoseconds at which this HTLC was settled or failed. + This value will not be set if the HTLC is still IN_FLIGHT. + */ + int64 resolve_time_ns = 4; + + // Detailed htlc failure info. + Failure failure = 5; + + // The preimage that was used to settle the HTLC. + bytes preimage = 6; +} + +message ListPaymentsRequest { + /* + If true, then return payments that have not yet fully completed. This means + that pending payments, as well as failed payments will show up if this + field is set to true. This flag doesn't change the meaning of the indices, + which are tied to individual payments. + */ + bool include_incomplete = 1; + + /* + The index of a payment that will be used as either the start or end of a + query to determine which payments should be returned in the response. The + index_offset is exclusive. In the case of a zero index_offset, the query + will start with the oldest payment when paginating forwards, or will end + with the most recent payment when paginating backwards. + */ + uint64 index_offset = 2; + + // The maximal number of payments returned in the response to this query. + uint64 max_payments = 3; + + /* + If set, the payments returned will result from seeking backwards from the + specified index offset. This can be used to paginate backwards. The order + of the returned payments is always oldest first (ascending index order). + */ + bool reversed = 4; +} + +message ListPaymentsResponse { + // The list of payments + repeated Payment payments = 1; + + /* + The index of the first item in the set of returned payments. This can be + used as the index_offset to continue seeking backwards in the next request. + */ + uint64 first_index_offset = 2; + + /* + The index of the last item in the set of returned payments. This can be used + as the index_offset to continue seeking forwards in the next request. + */ + uint64 last_index_offset = 3; +} + +message DeleteAllPaymentsRequest { +} + +message DeleteAllPaymentsResponse { +} + +message AbandonChannelRequest { + ChannelPoint channel_point = 1; + + bool pending_funding_shim_only = 2; +} + +message AbandonChannelResponse { +} + +message DebugLevelRequest { + bool show = 1; + string level_spec = 2; +} +message DebugLevelResponse { + string sub_systems = 1; +} + +message PayReqString { + // The payment request string to be decoded + string pay_req = 1; +} +message PayReq { + string destination = 1; + string payment_hash = 2; + int64 num_satoshis = 3; + int64 timestamp = 4; + int64 expiry = 5; + string description = 6; + string description_hash = 7; + string fallback_addr = 8; + int64 cltv_expiry = 9; + repeated RouteHint route_hints = 10; + bytes payment_addr = 11; + int64 num_msat = 12; + map features = 13; +} + +enum FeatureBit { + DATALOSS_PROTECT_REQ = 0; + DATALOSS_PROTECT_OPT = 1; + INITIAL_ROUING_SYNC = 3; + UPFRONT_SHUTDOWN_SCRIPT_REQ = 4; + UPFRONT_SHUTDOWN_SCRIPT_OPT = 5; + GOSSIP_QUERIES_REQ = 6; + GOSSIP_QUERIES_OPT = 7; + TLV_ONION_REQ = 8; + TLV_ONION_OPT = 9; + EXT_GOSSIP_QUERIES_REQ = 10; + EXT_GOSSIP_QUERIES_OPT = 11; + STATIC_REMOTE_KEY_REQ = 12; + STATIC_REMOTE_KEY_OPT = 13; + PAYMENT_ADDR_REQ = 14; + PAYMENT_ADDR_OPT = 15; + MPP_REQ = 16; + MPP_OPT = 17; +} + +message Feature { + string name = 2; + bool is_required = 3; + bool is_known = 4; +} + +message FeeReportRequest { +} +message ChannelFeeReport { + // The short channel id that this fee report belongs to. + uint64 chan_id = 5 [jstype = JS_STRING]; + + // The channel that this fee report belongs to. + string channel_point = 1; + + // The base fee charged regardless of the number of milli-satoshis sent. + int64 base_fee_msat = 2; + + // The amount charged per milli-satoshis transferred expressed in + // millionths of a satoshi. + int64 fee_per_mil = 3; + + // The effective fee rate in milli-satoshis. Computed by dividing the + // fee_per_mil value by 1 million. + double fee_rate = 4; +} +message FeeReportResponse { + // An array of channel fee reports which describes the current fee schedule + // for each channel. + repeated ChannelFeeReport channel_fees = 1; + + // The total amount of fee revenue (in satoshis) the switch has collected + // over the past 24 hrs. + uint64 day_fee_sum = 2; + + // The total amount of fee revenue (in satoshis) the switch has collected + // over the past 1 week. + uint64 week_fee_sum = 3; + + // The total amount of fee revenue (in satoshis) the switch has collected + // over the past 1 month. + uint64 month_fee_sum = 4; +} + +message PolicyUpdateRequest { + oneof scope { + // If set, then this update applies to all currently active channels. + bool global = 1; + + // If set, this update will target a specific channel. + ChannelPoint chan_point = 2; + } + + // The base fee charged regardless of the number of milli-satoshis sent. + int64 base_fee_msat = 3; + + // The effective fee rate in milli-satoshis. The precision of this value + // goes up to 6 decimal places, so 1e-6. + double fee_rate = 4; + + // The required timelock delta for HTLCs forwarded over the channel. + uint32 time_lock_delta = 5; + + // If set, the maximum HTLC size in milli-satoshis. If unset, the maximum + // HTLC will be unchanged. + uint64 max_htlc_msat = 6; + + // The minimum HTLC size in milli-satoshis. Only applied if + // min_htlc_msat_specified is true. + uint64 min_htlc_msat = 7; + + // If true, min_htlc_msat is applied. + bool min_htlc_msat_specified = 8; +} +message PolicyUpdateResponse { +} + +message ForwardingHistoryRequest { + // Start time is the starting point of the forwarding history request. All + // records beyond this point will be included, respecting the end time, and + // the index offset. + uint64 start_time = 1; + + // End time is the end point of the forwarding history request. The + // response will carry at most 50k records between the start time and the + // end time. The index offset can be used to implement pagination. + uint64 end_time = 2; + + // Index offset is the offset in the time series to start at. As each + // response can only contain 50k records, callers can use this to skip + // around within a packed time series. + uint32 index_offset = 3; + + // The max number of events to return in the response to this query. + uint32 num_max_events = 4; +} +message ForwardingEvent { + // Timestamp is the time (unix epoch offset) that this circuit was + // completed. + uint64 timestamp = 1; + + // The incoming channel ID that carried the HTLC that created the circuit. + uint64 chan_id_in = 2 [jstype = JS_STRING]; + + // The outgoing channel ID that carried the preimage that completed the + // circuit. + uint64 chan_id_out = 4 [jstype = JS_STRING]; + + // The total amount (in satoshis) of the incoming HTLC that created half + // the circuit. + uint64 amt_in = 5; + + // The total amount (in satoshis) of the outgoing HTLC that created the + // second half of the circuit. + uint64 amt_out = 6; + + // The total fee (in satoshis) that this payment circuit carried. + uint64 fee = 7; + + // The total fee (in milli-satoshis) that this payment circuit carried. + uint64 fee_msat = 8; + + // The total amount (in milli-satoshis) of the incoming HTLC that created + // half the circuit. + uint64 amt_in_msat = 9; + + // The total amount (in milli-satoshis) of the outgoing HTLC that created + // the second half of the circuit. + uint64 amt_out_msat = 10; + + // TODO(roasbeef): add settlement latency? + // * use FPE on the chan id? + // * also list failures? +} +message ForwardingHistoryResponse { + // A list of forwarding events from the time slice of the time series + // specified in the request. + repeated ForwardingEvent forwarding_events = 1; + + // The index of the last time in the set of returned forwarding events. Can + // be used to seek further, pagination style. + uint32 last_offset_index = 2; +} + +message ExportChannelBackupRequest { + // The target channel point to obtain a back up for. + ChannelPoint chan_point = 1; +} + +message ChannelBackup { + /* + Identifies the channel that this backup belongs to. + */ + ChannelPoint chan_point = 1; + + /* + Is an encrypted single-chan backup. this can be passed to + RestoreChannelBackups, or the WalletUnlocker Init and Unlock methods in + order to trigger the recovery protocol. When using REST, this field must be + encoded as base64. + */ + bytes chan_backup = 2; +} + +message MultiChanBackup { + /* + Is the set of all channels that are included in this multi-channel backup. + */ + repeated ChannelPoint chan_points = 1; + + /* + A single encrypted blob containing all the static channel backups of the + channel listed above. This can be stored as a single file or blob, and + safely be replaced with any prior/future versions. When using REST, this + field must be encoded as base64. + */ + bytes multi_chan_backup = 2; +} + +message ChanBackupExportRequest { +} +message ChanBackupSnapshot { + /* + The set of new channels that have been added since the last channel backup + snapshot was requested. + */ + ChannelBackups single_chan_backups = 1; + + /* + A multi-channel backup that covers all open channels currently known to + lnd. + */ + MultiChanBackup multi_chan_backup = 2; +} + +message ChannelBackups { + /* + A set of single-chan static channel backups. + */ + repeated ChannelBackup chan_backups = 1; +} + +message RestoreChanBackupRequest { + oneof backup { + /* + The channels to restore as a list of channel/backup pairs. + */ + ChannelBackups chan_backups = 1; + + /* + The channels to restore in the packed multi backup format. When using + REST, this field must be encoded as base64. + */ + bytes multi_chan_backup = 2; + } +} +message RestoreBackupResponse { +} + +message ChannelBackupSubscription { +} + +message VerifyChanBackupResponse { +} + +message MacaroonPermission { + // The entity a permission grants access to. + string entity = 1; + + // The action that is granted. + string action = 2; +} +message BakeMacaroonRequest { + // The list of permissions the new macaroon should grant. + repeated MacaroonPermission permissions = 1; + + // The root key ID used to create the macaroon, must be a positive integer. + uint64 root_key_id = 2; +} +message BakeMacaroonResponse { + // The hex encoded macaroon, serialized in binary format. + string macaroon = 1; +} + +message ListMacaroonIDsRequest { +} +message ListMacaroonIDsResponse { + // The list of root key IDs that are in use. + repeated uint64 root_key_ids = 1; +} + +message DeleteMacaroonIDRequest { + // The root key ID to be removed. + uint64 root_key_id = 1; +} +message DeleteMacaroonIDResponse { + // A boolean indicates that the deletion is successful. + bool deleted = 1; +} + +message MacaroonPermissionList { + // A list of macaroon permissions. + repeated MacaroonPermission permissions = 1; +} + +message ListPermissionsRequest { +} +message ListPermissionsResponse { + /* + A map between all RPC method URIs and their required macaroon permissions to + access them. + */ + map method_permissions = 1; +} + +message Failure { + enum FailureCode { + /* + The numbers assigned in this enumeration match the failure codes as + defined in BOLT #4. Because protobuf 3 requires enums to start with 0, + a RESERVED value is added. + */ + RESERVED = 0; + + INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS = 1; + INCORRECT_PAYMENT_AMOUNT = 2; + FINAL_INCORRECT_CLTV_EXPIRY = 3; + FINAL_INCORRECT_HTLC_AMOUNT = 4; + FINAL_EXPIRY_TOO_SOON = 5; + INVALID_REALM = 6; + EXPIRY_TOO_SOON = 7; + INVALID_ONION_VERSION = 8; + INVALID_ONION_HMAC = 9; + INVALID_ONION_KEY = 10; + AMOUNT_BELOW_MINIMUM = 11; + FEE_INSUFFICIENT = 12; + INCORRECT_CLTV_EXPIRY = 13; + CHANNEL_DISABLED = 14; + TEMPORARY_CHANNEL_FAILURE = 15; + REQUIRED_NODE_FEATURE_MISSING = 16; + REQUIRED_CHANNEL_FEATURE_MISSING = 17; + UNKNOWN_NEXT_PEER = 18; + TEMPORARY_NODE_FAILURE = 19; + PERMANENT_NODE_FAILURE = 20; + PERMANENT_CHANNEL_FAILURE = 21; + EXPIRY_TOO_FAR = 22; + MPP_TIMEOUT = 23; + + /* + An internal error occurred. + */ + INTERNAL_FAILURE = 997; + + /* + The error source is known, but the failure itself couldn't be decoded. + */ + UNKNOWN_FAILURE = 998; + + /* + An unreadable failure result is returned if the received failure message + cannot be decrypted. In that case the error source is unknown. + */ + UNREADABLE_FAILURE = 999; + } + + // Failure code as defined in the Lightning spec + FailureCode code = 1; + + reserved 2; + + // An optional channel update message. + ChannelUpdate channel_update = 3; + + // A failure type-dependent htlc value. + uint64 htlc_msat = 4; + + // The sha256 sum of the onion payload. + bytes onion_sha_256 = 5; + + // A failure type-dependent cltv expiry value. + uint32 cltv_expiry = 6; + + // A failure type-dependent flags value. + uint32 flags = 7; + + /* + The position in the path of the intermediate or final node that generated + the failure message. Position zero is the sender node. + **/ + uint32 failure_source_index = 8; + + // A failure type-dependent block height. + uint32 height = 9; +} + +message ChannelUpdate { + /* + The signature that validates the announced data and proves the ownership + of node id. + */ + bytes signature = 1; + + /* + The target chain that this channel was opened within. This value + should be the genesis hash of the target chain. Along with the short + channel ID, this uniquely identifies the channel globally in a + blockchain. + */ + bytes chain_hash = 2; + + /* + The unique description of the funding transaction. + */ + uint64 chan_id = 3 [jstype = JS_STRING]; + + /* + A timestamp that allows ordering in the case of multiple announcements. + We should ignore the message if timestamp is not greater than the + last-received. + */ + uint32 timestamp = 4; + + /* + The bitfield that describes whether optional fields are present in this + update. Currently, the least-significant bit must be set to 1 if the + optional field MaxHtlc is present. + */ + uint32 message_flags = 10; + + /* + The bitfield that describes additional meta-data concerning how the + update is to be interpreted. Currently, the least-significant bit must be + set to 0 if the creating node corresponds to the first node in the + previously sent channel announcement and 1 otherwise. If the second bit + is set, then the channel is set to be disabled. + */ + uint32 channel_flags = 5; + + /* + The minimum number of blocks this node requires to be added to the expiry + of HTLCs. This is a security parameter determined by the node operator. + This value represents the required gap between the time locks of the + incoming and outgoing HTLC's set to this node. + */ + uint32 time_lock_delta = 6; + + /* + The minimum HTLC value which will be accepted. + */ + uint64 htlc_minimum_msat = 7; + + /* + The base fee that must be used for incoming HTLC's to this particular + channel. This value will be tacked onto the required for a payment + independent of the size of the payment. + */ + uint32 base_fee = 8; + + /* + The fee rate that will be charged per millionth of a satoshi. + */ + uint32 fee_rate = 9; + + /* + The maximum HTLC value which will be accepted. + */ + uint64 htlc_maximum_msat = 11; + + /* + The set of data that was appended to this message, some of which we may + not actually know how to iterate or parse. By holding onto this data, we + ensure that we're able to properly validate the set of signatures that + cover these new fields, and ensure we're able to make upgrades to the + network in a forwards compatible manner. + */ + bytes extra_opaque_data = 12; +} + +message MacaroonId { + bytes nonce = 1; + bytes storageId = 2; + repeated Op ops = 3; +} + +message Op { + string entity = 1; + repeated string actions = 2; +} \ No newline at end of file diff --git a/proto/signer.proto b/proto/signer.proto new file mode 100644 index 0000000..8440904 --- /dev/null +++ b/proto/signer.proto @@ -0,0 +1,228 @@ +syntax = "proto3"; + +package signrpc; + +option go_package = "github.com/lightningnetwork/lnd/lnrpc/signrpc"; + +// Signer is a service that gives access to the signing functionality of the +// daemon's wallet. +service Signer { + /* + SignOutputRaw is a method that can be used to generated a signature for a + set of inputs/outputs to a transaction. Each request specifies details + concerning how the outputs should be signed, which keys they should be + signed with, and also any optional tweaks. The return value is a fixed + 64-byte signature (the same format as we use on the wire in Lightning). + + If we are unable to sign using the specified keys, then an error will be + returned. + */ + rpc SignOutputRaw (SignReq) returns (SignResp); + + /* + ComputeInputScript generates a complete InputIndex for the passed + transaction with the signature as defined within the passed SignDescriptor. + This method should be capable of generating the proper input script for + both regular p2wkh output and p2wkh outputs nested within a regular p2sh + output. + + Note that when using this method to sign inputs belonging to the wallet, + the only items of the SignDescriptor that need to be populated are pkScript + in the TxOut field, the value in that same field, and finally the input + index. + */ + rpc ComputeInputScript (SignReq) returns (InputScriptResp); + + /* + SignMessage signs a message with the key specified in the key locator. The + returned signature is fixed-size LN wire format encoded. + + The main difference to SignMessage in the main RPC is that a specific key is + used to sign the message instead of the node identity private key. + */ + rpc SignMessage (SignMessageReq) returns (SignMessageResp); + + /* + VerifyMessage verifies a signature over a message using the public key + provided. The signature must be fixed-size LN wire format encoded. + + The main difference to VerifyMessage in the main RPC is that the public key + used to sign the message does not have to be a node known to the network. + */ + rpc VerifyMessage (VerifyMessageReq) returns (VerifyMessageResp); + + /* + DeriveSharedKey returns a shared secret key by performing Diffie-Hellman key + derivation between the ephemeral public key in the request and the node's + key specified in the key_loc parameter (or the node's identity private key + if no key locator is specified): + P_shared = privKeyNode * ephemeralPubkey + The resulting shared public key is serialized in the compressed format and + hashed with sha256, resulting in the final key length of 256bit. + */ + rpc DeriveSharedKey (SharedKeyRequest) returns (SharedKeyResponse); +} + +message KeyLocator { + // The family of key being identified. + int32 key_family = 1; + + // The precise index of the key being identified. + int32 key_index = 2; +} + +message KeyDescriptor { + /* + The raw bytes of the key being identified. Either this or the KeyLocator + must be specified. + */ + bytes raw_key_bytes = 1; + + /* + The key locator that identifies which key to use for signing. Either this + or the raw bytes of the target key must be specified. + */ + KeyLocator key_loc = 2; +} + +message TxOut { + // The value of the output being spent. + int64 value = 1; + + // The script of the output being spent. + bytes pk_script = 2; +} + +message SignDescriptor { + /* + A descriptor that precisely describes *which* key to use for signing. This + may provide the raw public key directly, or require the Signer to re-derive + the key according to the populated derivation path. + */ + KeyDescriptor key_desc = 1; + + /* + A scalar value that will be added to the private key corresponding to the + above public key to obtain the private key to be used to sign this input. + This value is typically derived via the following computation: + + * derivedKey = privkey + sha256(perCommitmentPoint || pubKey) mod N + */ + bytes single_tweak = 2; + + /* + A private key that will be used in combination with its corresponding + private key to derive the private key that is to be used to sign the target + input. Within the Lightning protocol, this value is typically the + commitment secret from a previously revoked commitment transaction. This + value is in combination with two hash values, and the original private key + to derive the private key to be used when signing. + + * k = (privKey*sha256(pubKey || tweakPub) + + tweakPriv*sha256(tweakPub || pubKey)) mod N + */ + bytes double_tweak = 3; + + /* + The full script required to properly redeem the output. This field will + only be populated if a p2wsh or a p2sh output is being signed. + */ + bytes witness_script = 4; + + /* + A description of the output being spent. The value and script MUST be + provided. + */ + TxOut output = 5; + + /* + The target sighash type that should be used when generating the final + sighash, and signature. + */ + uint32 sighash = 7; + + /* + The target input within the transaction that should be signed. + */ + int32 input_index = 8; +} + +message SignReq { + // The raw bytes of the transaction to be signed. + bytes raw_tx_bytes = 1; + + // A set of sign descriptors, for each input to be signed. + repeated SignDescriptor sign_descs = 2; +} + +message SignResp { + /* + A set of signatures realized in a fixed 64-byte format ordered in ascending + input order. + */ + repeated bytes raw_sigs = 1; +} + +message InputScript { + // The serializes witness stack for the specified input. + repeated bytes witness = 1; + + /* + The optional sig script for the specified witness that will only be set if + the input specified is a nested p2sh witness program. + */ + bytes sig_script = 2; +} + +message InputScriptResp { + // The set of fully valid input scripts requested. + repeated InputScript input_scripts = 1; +} + +message SignMessageReq { + // The message to be signed. + bytes msg = 1; + + // The key locator that identifies which key to use for signing. + KeyLocator key_loc = 2; +} +message SignMessageResp { + /* + The signature for the given message in the fixed-size LN wire format. + */ + bytes signature = 1; +} + +message VerifyMessageReq { + // The message over which the signature is to be verified. + bytes msg = 1; + + /* + The fixed-size LN wire encoded signature to be verified over the given + message. + */ + bytes signature = 2; + + // The public key the signature has to be valid for. + bytes pubkey = 3; +} +message VerifyMessageResp { + // Whether the signature was valid over the given message. + bool valid = 1; +} + +message SharedKeyRequest { + // The ephemeral public key to use for the DH key derivation. + bytes ephemeral_pubkey = 1; + + /* + The optional key locator of the local key that should be used. If this + parameter is not set then the node's identity private key will be used. + */ + KeyLocator key_loc = 2; +} + +message SharedKeyResponse { + // The shared public key, hashed with sha256. + bytes shared_key = 1; +} diff --git a/proto/walletunlocker.proto b/proto/walletunlocker.proto new file mode 100644 index 0000000..3f063a4 --- /dev/null +++ b/proto/walletunlocker.proto @@ -0,0 +1,238 @@ +syntax = "proto3"; + +import "rpc.proto"; + +package lnrpc; + +option go_package = "github.com/lightningnetwork/lnd/lnrpc"; + +/* + * Comments in this file will be directly parsed into the API + * Documentation as descriptions of the associated method, message, or field. + * These descriptions should go right above the definition of the object, and + * can be in either block or // comment format. + * + * An RPC method can be matched to an lncli command by placing a line in the + * beginning of the description in exactly the following format: + * lncli: `methodname` + * + * Failure to specify the exact name of the command will cause documentation + * generation to fail. + * + * More information on how exactly the gRPC documentation is generated from + * this proto file can be found here: + * https://github.com/lightninglabs/lightning-api + */ + +// WalletUnlocker is a service that is used to set up a wallet password for +// lnd at first startup, and unlock a previously set up wallet. +service WalletUnlocker { + /* + GenSeed is the first method that should be used to instantiate a new lnd + instance. This method allows a caller to generate a new aezeed cipher seed + given an optional passphrase. If provided, the passphrase will be necessary + to decrypt the cipherseed to expose the internal wallet seed. + + Once the cipherseed is obtained and verified by the user, the InitWallet + method should be used to commit the newly generated seed, and create the + wallet. + */ + rpc GenSeed (GenSeedRequest) returns (GenSeedResponse); + + /* + InitWallet is used when lnd is starting up for the first time to fully + initialize the daemon and its internal wallet. At the very least a wallet + password must be provided. This will be used to encrypt sensitive material + on disk. + + In the case of a recovery scenario, the user can also specify their aezeed + mnemonic and passphrase. If set, then the daemon will use this prior state + to initialize its internal wallet. + + Alternatively, this can be used along with the GenSeed RPC to obtain a + seed, then present it to the user. Once it has been verified by the user, + the seed can be fed into this RPC in order to commit the new wallet. + */ + rpc InitWallet (InitWalletRequest) returns (InitWalletResponse); + + /* lncli: `unlock` + UnlockWallet is used at startup of lnd to provide a password to unlock + the wallet database. + */ + rpc UnlockWallet (UnlockWalletRequest) returns (UnlockWalletResponse); + + /* lncli: `changepassword` + ChangePassword changes the password of the encrypted wallet. This will + automatically unlock the wallet database if successful. + */ + rpc ChangePassword (ChangePasswordRequest) returns (ChangePasswordResponse); +} + +message GenSeedRequest { + /* + aezeed_passphrase is an optional user provided passphrase that will be used + to encrypt the generated aezeed cipher seed. When using REST, this field + must be encoded as base64. + */ + bytes aezeed_passphrase = 1; + + /* + seed_entropy is an optional 16-bytes generated via CSPRNG. If not + specified, then a fresh set of randomness will be used to create the seed. + When using REST, this field must be encoded as base64. + */ + bytes seed_entropy = 2; +} +message GenSeedResponse { + /* + cipher_seed_mnemonic is a 24-word mnemonic that encodes a prior aezeed + cipher seed obtained by the user. This field is optional, as if not + provided, then the daemon will generate a new cipher seed for the user. + Otherwise, then the daemon will attempt to recover the wallet state linked + to this cipher seed. + */ + repeated string cipher_seed_mnemonic = 1; + + /* + enciphered_seed are the raw aezeed cipher seed bytes. This is the raw + cipher text before run through our mnemonic encoding scheme. + */ + bytes enciphered_seed = 2; +} + +message InitWalletRequest { + /* + wallet_password is the passphrase that should be used to encrypt the + wallet. This MUST be at least 8 chars in length. After creation, this + password is required to unlock the daemon. When using REST, this field + must be encoded as base64. + */ + bytes wallet_password = 1; + + /* + cipher_seed_mnemonic is a 24-word mnemonic that encodes a prior aezeed + cipher seed obtained by the user. This may have been generated by the + GenSeed method, or be an existing seed. + */ + repeated string cipher_seed_mnemonic = 2; + + /* + aezeed_passphrase is an optional user provided passphrase that will be used + to encrypt the generated aezeed cipher seed. When using REST, this field + must be encoded as base64. + */ + bytes aezeed_passphrase = 3; + + /* + recovery_window is an optional argument specifying the address lookahead + when restoring a wallet seed. The recovery window applies to each + individual branch of the BIP44 derivation paths. Supplying a recovery + window of zero indicates that no addresses should be recovered, such after + the first initialization of the wallet. + */ + int32 recovery_window = 4; + + /* + channel_backups is an optional argument that allows clients to recover the + settled funds within a set of channels. This should be populated if the + user was unable to close out all channels and sweep funds before partial or + total data loss occurred. If specified, then after on-chain recovery of + funds, lnd begin to carry out the data loss recovery protocol in order to + recover the funds in each channel from a remote force closed transaction. + */ + ChanBackupSnapshot channel_backups = 5; + + /* + stateless_init is an optional argument instructing the daemon NOT to create + any *.macaroon files in its filesystem. If this parameter is set, then the + admin macaroon returned in the response MUST be stored by the caller of the + RPC as otherwise all access to the daemon will be lost! + */ + bool stateless_init = 6; +} +message InitWalletResponse { + /* + The binary serialized admin macaroon that can be used to access the daemon + after creating the wallet. If the stateless_init parameter was set to true, + this is the ONLY copy of the macaroon and MUST be stored safely by the + caller. Otherwise a copy of this macaroon is also persisted on disk by the + daemon, together with other macaroon files. + */ + bytes admin_macaroon = 1; +} + +message UnlockWalletRequest { + /* + wallet_password should be the current valid passphrase for the daemon. This + will be required to decrypt on-disk material that the daemon requires to + function properly. When using REST, this field must be encoded as base64. + */ + bytes wallet_password = 1; + + /* + recovery_window is an optional argument specifying the address lookahead + when restoring a wallet seed. The recovery window applies to each + individual branch of the BIP44 derivation paths. Supplying a recovery + window of zero indicates that no addresses should be recovered, such after + the first initialization of the wallet. + */ + int32 recovery_window = 2; + + /* + channel_backups is an optional argument that allows clients to recover the + settled funds within a set of channels. This should be populated if the + user was unable to close out all channels and sweep funds before partial or + total data loss occurred. If specified, then after on-chain recovery of + funds, lnd begin to carry out the data loss recovery protocol in order to + recover the funds in each channel from a remote force closed transaction. + */ + ChanBackupSnapshot channel_backups = 3; + + /* + stateless_init is an optional argument instructing the daemon NOT to create + any *.macaroon files in its file system. + */ + bool stateless_init = 4; +} +message UnlockWalletResponse { +} + +message ChangePasswordRequest { + /* + current_password should be the current valid passphrase used to unlock the + daemon. When using REST, this field must be encoded as base64. + */ + bytes current_password = 1; + + /* + new_password should be the new passphrase that will be needed to unlock the + daemon. When using REST, this field must be encoded as base64. + */ + bytes new_password = 2; + + /* + stateless_init is an optional argument instructing the daemon NOT to create + any *.macaroon files in its filesystem. If this parameter is set, then the + admin macaroon returned in the response MUST be stored by the caller of the + RPC as otherwise all access to the daemon will be lost! + */ + bool stateless_init = 3; + + /* + new_macaroon_root_key is an optional argument instructing the daemon to + rotate the macaroon root key when set to true. This will invalidate all + previously generated macaroons. + */ + bool new_macaroon_root_key = 4; +} +message ChangePasswordResponse { + /* + The binary serialized admin macaroon that can be used to access the daemon + after rotating the macaroon root key. If both the stateless_init and + new_macaroon_root_key parameter were set to true, this is the ONLY copy of + the macaroon that was created from the new root key and MUST be stored + safely by the caller. Otherwise a copy of this macaroon is also persisted on + disk by the daemon, together with other macaroon files. + */ + bytes admin_macaroon = 1; +} \ No newline at end of file diff --git a/src/utils/lightning.ts b/src/utils/lightning.ts index 8999c3d..a159fea 100644 --- a/src/utils/lightning.ts +++ b/src/utils/lightning.ts @@ -50,7 +50,7 @@ const loadLightning = () => { } else { try{ var credentials = loadCredentials() - var lnrpcDescriptor = grpc.load("rpc.proto"); + var lnrpcDescriptor = grpc.load("proto/rpc.proto"); var lnrpc: any = lnrpcDescriptor.lnrpc lightningClient = new lnrpc.Lightning(config.node_ip + ':' + config.lnd_port, credentials); return lightningClient @@ -66,7 +66,7 @@ const loadWalletUnlocker = () => { } else { var credentials = loadCredentials() try{ - var lnrpcDescriptor = grpc.load("rpc.proto"); + var lnrpcDescriptor = grpc.load("proto/walletunlocker.proto"); var lnrpc: any = lnrpcDescriptor.lnrpc walletUnlocker = new lnrpc.WalletUnlocker(config.node_ip + ':' + config.lnd_port, credentials); return walletUnlocker diff --git a/src/utils/signer.ts b/src/utils/signer.ts index 26a7f2d..8fe214d 100644 --- a/src/utils/signer.ts +++ b/src/utils/signer.ts @@ -16,7 +16,7 @@ export const loadSigner = () => { } else { try{ var credentials = loadCredentials() - var lnrpcDescriptor = grpc.load("signer.proto"); + var lnrpcDescriptor = grpc.load("proto/signer.proto"); var signer: any = lnrpcDescriptor.signrpc signerClient = new signer.Signer(config.node_ip + ':' + config.lnd_port, credentials); return signerClient diff --git a/src/utils/unlock.ts b/src/utils/unlock.ts index 88270e7..5625d33 100644 --- a/src/utils/unlock.ts +++ b/src/utils/unlock.ts @@ -6,6 +6,8 @@ const readline = require('readline'); const env = process.env.NODE_ENV || 'development'; const config = require(path.join(__dirname, '../../config/app.json'))[env] +console.log(JSON.stringify(config,null,2)) + // /relay/.lnd/.lndpwd export async function tryToUnlockLND() { @@ -14,7 +16,7 @@ export async function tryToUnlockLND() { console.log('==>',p) - var pwd = getFirstLine(config.lnd_pwd_path); + var pwd = await getFirstLine(config.lnd_pwd_path); if(!pwd) return console.log('==>',pwd) From 2dc859369580aaf9ba8eb9f8fd5e22e7f264b317 Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Mon, 23 Nov 2020 15:40:50 -0800 Subject: [PATCH 22/38] testing --- dist/src/grpc/index.js | 4 ++-- dist/src/grpc/index.js.map | 2 +- dist/src/utils/lightning.js | 3 +++ dist/src/utils/lightning.js.map | 2 +- dist/src/utils/unlock.js | 4 +++- dist/src/utils/unlock.js.map | 2 +- src/grpc/index.ts | 4 ++-- src/utils/lightning.ts | 3 +++ src/utils/unlock.ts | 4 +++- 9 files changed, 19 insertions(+), 9 deletions(-) diff --git a/dist/src/grpc/index.js b/dist/src/grpc/index.js index 539bb72..eb18664 100644 --- a/dist/src/grpc/index.js +++ b/dist/src/grpc/index.js @@ -18,7 +18,7 @@ const lightning_1 = require("../utils/lightning"); const network = require("../network"); const moment = require("moment"); const constants_1 = require("../constants"); -const unlock_1 = require("../utils/unlock"); +// import {tryToUnlockLND} from '../utils/unlock' const ERR_CODE_UNAVAILABLE = 14; const ERR_CODE_STREAM_REMOVED = 2; const ERR_CODE_UNIMPLEMENTED = 12; // locked @@ -151,7 +151,7 @@ function reconnectToLND(innerCtx) { } catch (e) { if (e.code === ERR_CODE_UNIMPLEMENTED) { - yield unlock_1.tryToUnlockLND(); + // await tryToUnlockLND() } setTimeout(() => __awaiter(this, void 0, void 0, function* () { if (ctx === innerCtx) { // if another retry fires, then this will not run diff --git a/dist/src/grpc/index.js.map b/dist/src/grpc/index.js.map index 82691d8..16ae5a9 100644 --- a/dist/src/grpc/index.js.map +++ b/dist/src/grpc/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/grpc/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,0CAAyC;AACzC,gCAAsD;AACtD,2CAA0C;AAC1C,+CAA8C;AAC9C,kDAAgD;AAChD,sCAAqC;AACrC,iCAAgC;AAChC,4CAAoC;AACpC,4CAA8C;AAE9C,MAAM,oBAAoB,GAAG,EAAE,CAAA;AAC/B,MAAM,uBAAuB,GAAG,CAAC,CAAA;AACjC,MAAM,sBAAsB,GAAG,EAAE,CAAA,CAAC,SAAS;AAE3C,SAAgB,iBAAiB,CAAC,mBAAmB;IACpD,OAAO,IAAI,OAAO,CAAC,CAAM,OAAO,EAAC,MAAM,EAAC,EAAE;QACzC,MAAM,SAAS,GAAG,MAAM,yBAAa,EAAE,CAAA;QAEvC,IAAI,IAAI,GAAG,SAAS,CAAC,iBAAiB,EAAE,CAAA;QACxC,IAAI,CAAC,EAAE,CAAC,MAAM,EAA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C,CAAA;QACF,UAAU,CAAC,GAAE,EAAE;YACd,OAAO,CAAC,IAAI,CAAC,CAAA;QACd,CAAC,EAAC,GAAG,CAAC,CAAA;IACP,CAAC,CAAA,CAAC,CAAA;AACH,CAAC;AAlHD,8CAkHC;AAED,IAAI,CAAC,GAAG,CAAC,CAAA;AACT,IAAI,GAAG,GAAG,CAAC,CAAA;AACX,SAAsB,cAAc,CAAC,QAAe;;QACnD,OAAO,IAAI,OAAO,CAAE,CAAO,OAAO,EAAC,MAAM,EAAC,EAAE;YAC3C,GAAG,GAAG,QAAQ,CAAA;YACd,CAAC,EAAE,CAAA;YACH,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,IAAI,EAAE,CAAC;YAC1D,OAAO,CAAC,GAAG,CAAC,MAAM,GAAG,mCAAmC,CAAC,EAAE,CAAC,CAAA;YAC5D,IAAI;gBACH,MAAM,OAAO,CAAC,qBAAqB,EAAE,CAAA;gBACrC,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,IAAI,EAAE,CAAC;gBAC1D,OAAO,CAAC,GAAG,CAAC,uBAAuB,GAAG,EAAE,CAAC,CAAA;gBACzC,OAAO,EAAE,CAAA;aACT;YAAC,OAAM,CAAC,EAAE;gBACV,IAAG,CAAC,CAAC,IAAI,KAAG,sBAAsB,EAAE;oBACnC,yBAAyB;iBACzB;gBACD,UAAU,CAAC,GAAO,EAAE;oBACnB,IAAG,GAAG,KAAG,QAAQ,EAAE,EAAE,iDAAiD;wBACrE,MAAM,cAAc,CAAC,QAAQ,CAAC,CAAA;qBAC9B;gBACF,CAAC,CAAA,EAAC,IAAI,CAAC,CAAA;aACP;QACF,CAAC,CAAA,CAAC,CAAA;IACH,CAAC;CAAA;AAtBD,wCAsBC"} \ No newline at end of file diff --git a/dist/src/utils/lightning.js b/dist/src/utils/lightning.js index 1713cb1..1814365 100644 --- a/dist/src/utils/lightning.js +++ b/dist/src/utils/lightning.js @@ -59,8 +59,11 @@ const loadLightning = () => { try { var credentials = loadCredentials(); var lnrpcDescriptor = grpc.load("proto/rpc.proto"); + console.log('lnrpcDescriptor', lnrpcDescriptor); var lnrpc = lnrpcDescriptor.lnrpc; + console.log('lnrpc', lnrpc); lightningClient = new lnrpc.Lightning(config.node_ip + ':' + config.lnd_port, credentials); + console.log("lightningClient", lightningClient); return lightningClient; } catch (e) { diff --git a/dist/src/utils/lightning.js.map b/dist/src/utils/lightning.js.map index a6a7ecf..8312613 100644 --- a/dist/src/utils/lightning.js.map +++ b/dist/src/utils/lightning.js.map @@ -1 +1 @@ -{"version":3,"file":"lightning.js","sourceRoot":"","sources":["../../../src/utils/lightning.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,yCAAwC;AACxC,yBAAwB;AACxB,6BAA4B;AAC5B,wCAAmC;AACnC,iCAAgC;AAChC,iCAAgC;AAChC,6BAA4B;AAC5B,4CAAoC;AACpC,yCAAsC;AAEtC,kDAAkD;AAClD,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,uBAAuB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AAEzE,MAAM,eAAe,GAAG,UAAU,CAAA;AAichC,0CAAe;AAhcjB,MAAM,wBAAwB,GAAG,SAAS,CAAA;AAicxC,4DAAwB;AA/b1B,IAAI,eAAe,GAAS,IAAI,CAAC;AACjC,IAAI,cAAc,GAAU,IAAI,CAAC;AAEjC,MAAM,eAAe,GAAG,GAAG,EAAE;IAC3B,IAAI,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IACnD,IAAI,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACnD,IAAI,QAAQ,GAAG,sBAAW,EA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EAAE,CAAC,EAAG,EAAE;QAC5C,IAAI,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACjD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KACd;IACF,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACtB,CAAC"} \ No newline at end of file diff --git a/dist/src/utils/unlock.js b/dist/src/utils/unlock.js index 4833c59..242874c 100644 --- a/dist/src/utils/unlock.js +++ b/dist/src/utils/unlock.js @@ -16,7 +16,9 @@ const readline = require('readline'); const env = process.env.NODE_ENV || 'development'; const config = require(path.join(__dirname, '../../config/app.json'))[env]; console.log(JSON.stringify(config, null, 2)); -// /relay/.lnd/.lndpwd +/* +"lnd_pwd_path": "/relay/.lnd/.lndpwd" +*/ function tryToUnlockLND() { return __awaiter(this, void 0, void 0, function* () { const p = config.lnd_pwd_path; diff --git a/dist/src/utils/unlock.js.map b/dist/src/utils/unlock.js.map index dca74b8..43acf76 100644 --- a/dist/src/utils/unlock.js.map +++ b/dist/src/utils/unlock.js.map @@ -1 +1 @@ -{"version":3,"file":"unlock.js","sourceRoot":"","sources":["../../../src/utils/unlock.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,6BAA4B;AAC5B,2CAA0C;AAC1C,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;AACxB,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAErC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,uBAAuB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AAE1E,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAC,IAAI,EAAC,CAAC,CAAC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line at end of file diff --git a/src/grpc/index.ts b/src/grpc/index.ts index 2d5d482..2b97817 100644 --- a/src/grpc/index.ts +++ b/src/grpc/index.ts @@ -7,7 +7,7 @@ import {loadLightning} from '../utils/lightning' import * as network from '../network' import * as moment from 'moment' import constants from '../constants' -import {tryToUnlockLND} from '../utils/unlock' +// import {tryToUnlockLND} from '../utils/unlock' const ERR_CODE_UNAVAILABLE = 14 const ERR_CODE_STREAM_REMOVED = 2 @@ -144,7 +144,7 @@ export async function reconnectToLND(innerCtx:number) { resolve() } catch(e) { if(e.code===ERR_CODE_UNIMPLEMENTED) { - await tryToUnlockLND() + // await tryToUnlockLND() } setTimeout(async()=>{ // retry each 2 secs if(ctx===innerCtx) { // if another retry fires, then this will not run diff --git a/src/utils/lightning.ts b/src/utils/lightning.ts index a159fea..d6f4d87 100644 --- a/src/utils/lightning.ts +++ b/src/utils/lightning.ts @@ -51,8 +51,11 @@ const loadLightning = () => { try{ var credentials = loadCredentials() var lnrpcDescriptor = grpc.load("proto/rpc.proto"); + console.log('lnrpcDescriptor',lnrpcDescriptor) var lnrpc: any = lnrpcDescriptor.lnrpc + console.log('lnrpc',lnrpc) lightningClient = new lnrpc.Lightning(config.node_ip + ':' + config.lnd_port, credentials); + console.log("lightningClient",lightningClient) return lightningClient } catch(e) { throw e diff --git a/src/utils/unlock.ts b/src/utils/unlock.ts index 5625d33..efecd1a 100644 --- a/src/utils/unlock.ts +++ b/src/utils/unlock.ts @@ -8,7 +8,9 @@ const config = require(path.join(__dirname, '../../config/app.json'))[env] console.log(JSON.stringify(config,null,2)) -// /relay/.lnd/.lndpwd +/* +"lnd_pwd_path": "/relay/.lnd/.lndpwd" +*/ export async function tryToUnlockLND() { const p = config.lnd_pwd_path From 5d94ccbbf714628aee95913fb58be55035e12eb2 Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Mon, 23 Nov 2020 15:44:45 -0800 Subject: [PATCH 23/38] onconnect callback --- app.ts | 7 ++++--- dist/src/grpc/index.js | 39 +++++++++++++++++++------------------- dist/src/grpc/index.js.map | 2 +- src/grpc/index.ts | 38 ++++++++++++++++++------------------- 4 files changed, 42 insertions(+), 44 deletions(-) diff --git a/app.ts b/app.ts index 3cccfcf..5013999 100644 --- a/app.ts +++ b/app.ts @@ -32,9 +32,10 @@ async function start(){ start() async function connectToLND(){ - await grpc.reconnectToLND(Math.random()) // recursive - console.log(">> SETUP MAIN") - await mainSetup() + grpc.reconnectToLND(Math.random(), async function(){ + console.log(">> SETUP MAIN") + await mainSetup() + }) // recursive } async function mainSetup(){ diff --git a/dist/src/grpc/index.js b/dist/src/grpc/index.js index eb18664..c321433 100644 --- a/dist/src/grpc/index.js +++ b/dist/src/grpc/index.js @@ -136,30 +136,29 @@ function subscribeInvoices(parseKeysendInvoice) { exports.subscribeInvoices = subscribeInvoices; var i = 0; var ctx = 0; -function reconnectToLND(innerCtx) { +function reconnectToLND(innerCtx, callback) { return __awaiter(this, void 0, void 0, function* () { - return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () { - ctx = innerCtx; - i++; + ctx = innerCtx; + i++; + const now = moment().format('YYYY-MM-DD HH:mm:ss').trim(); + console.log(`=> ${now} [lnd] reconnecting... attempt #${i}`); + try { + yield network.initGrpcSubscriptions(); const now = moment().format('YYYY-MM-DD HH:mm:ss').trim(); - console.log(`=> ${now} [lnd] reconnecting... attempt #${i}`); - try { - yield network.initGrpcSubscriptions(); - const now = moment().format('YYYY-MM-DD HH:mm:ss').trim(); - console.log(`=> [lnd] connected! ${now}`); - resolve(); + console.log(`=> [lnd] connected! ${now}`); + if (callback) + callback(); + } + catch (e) { + if (e.code === ERR_CODE_UNIMPLEMENTED) { + // await tryToUnlockLND() } - catch (e) { - if (e.code === ERR_CODE_UNIMPLEMENTED) { - // await tryToUnlockLND() + setTimeout(() => __awaiter(this, void 0, void 0, function* () { + if (ctx === innerCtx) { // if another retry fires, then this will not run + yield reconnectToLND(innerCtx); } - setTimeout(() => __awaiter(this, void 0, void 0, function* () { - if (ctx === innerCtx) { // if another retry fires, then this will not run - yield reconnectToLND(innerCtx); - } - }), 2000); - } - })); + }), 2000); + } }); } exports.reconnectToLND = reconnectToLND; diff --git a/dist/src/grpc/index.js.map b/dist/src/grpc/index.js.map index 16ae5a9..2242bec 100644 --- a/dist/src/grpc/index.js.map +++ b/dist/src/grpc/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/grpc/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,0CAAyC;AACzC,gCAAsD;AACtD,2CAA0C;AAC1C,+CAA8C;AAC9C,kDAAgD;AAChD,sCAAqC;AACrC,iCAAgC;AAChC,4CAAoC;AACpC,iDAAiD;AAEjD,MAAM,oBAAoB,GAAG,EAAE,CAAA;AAC/B,MAAM,uBAAuB,GAAG,CAAC,CAAA;AACjC,MAAM,sBAAsB,GAAG,EAAE,CAAA,CAAC,SAAS;AAE3C,SAAgB,iBAAiB,CAAC,mBAAmB;IACpD,OAAO,IAAI,OAAO,CAAC,CAAM,OAAO,EAAC,MAAM,EAAC,EAAE;QACzC,MAAM,SAAS,GAAG,MAAM,yBAAa,EAAE,CAAA;QAEvC,IAAI,IAAI,GAAG,SAAS,CAAC,iBAAiB,EAAE,CAAA;QACxC,IAAI,CAAC,EAAE,CAAC,MAAM,EAAE,UAAe,QAAQ;;gBACtC,IAAI,QAAQ,CAAC,OAAO,CAAC,KAAK,SAAS,EAAE;oBACpC,OAAM;iBACN;gBACD,iDAAiD;gBACjD,IAAG,QAAQ,CAAC,UAAU,EAAE;oBACvB,mBAAmB,CAAC,QAAQ,CAAC,CAAA;iBAC7B;qBAAM;oBAEN,IAAI,qBAAqB,GAAG,WAAW,CAAC,MAAM,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAC,CAAC;oBAC5E,IAAI,WAAW,GAAG,EAAE,CAAC;oBACrB,KAAK,IAAI,CAAC,GAAC,CAAC,EAAE,CAAC,GAAC,qBAAqB,CAAC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AAC;QAC1D,OAAO,CAAC,GAAG,CAAC,MAAM,GAAG,mCAAmC,CAAC,EAAE,CAAC,CAAA;QAC5D,IAAI;YACH,MAAM,OAAO,CAAC,qBAAqB,EAAE,CAAA;YACrC,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,IAAI,EAAE,CAAC;YAC1D,OAAO,CAAC,GAAG,CAAC,uBAAuB,GAAG,EAAE,CAAC,CAAA;YACzC,IAAG,QAAQ;gBAAE,QAAQ,EAAE,CAAA;SACvB;QAAC,OAAM,CAAC,EAAE;YACV,IAAG,CAAC,CAAC,IAAI,KAAG,sBAAsB,EAAE;gBACnC,yBAAyB;aACzB;YACD,UAAU,CAAC,GAAO,EAAE;gBACnB,IAAG,GAAG,KAAG,QAAQ,EAAE,EAAE,iDAAiD;oBACrE,MAAM,cAAc,CAAC,QAAQ,CAAC,CAAA;iBAC9B;YACF,CAAC,CAAA,EAAC,IAAI,CAAC,CAAA;SACP;IACF,CAAC;CAAA;AApBD,wCAoBC"} \ No newline at end of file diff --git a/src/grpc/index.ts b/src/grpc/index.ts index 2b97817..72d565c 100644 --- a/src/grpc/index.ts +++ b/src/grpc/index.ts @@ -131,27 +131,25 @@ export function subscribeInvoices(parseKeysendInvoice) { var i = 0 var ctx = 0 -export async function reconnectToLND(innerCtx:number) { - return new Promise( async (resolve,reject)=>{ - ctx = innerCtx - i++ +export async function reconnectToLND(innerCtx:number, callback?:Function) { + ctx = innerCtx + i++ + const now = moment().format('YYYY-MM-DD HH:mm:ss').trim(); + console.log(`=> ${now} [lnd] reconnecting... attempt #${i}`) + try { + await network.initGrpcSubscriptions() const now = moment().format('YYYY-MM-DD HH:mm:ss').trim(); - console.log(`=> ${now} [lnd] reconnecting... attempt #${i}`) - try { - await network.initGrpcSubscriptions() - const now = moment().format('YYYY-MM-DD HH:mm:ss').trim(); - console.log(`=> [lnd] connected! ${now}`) - resolve() - } catch(e) { - if(e.code===ERR_CODE_UNIMPLEMENTED) { - // await tryToUnlockLND() - } - setTimeout(async()=>{ // retry each 2 secs - if(ctx===innerCtx) { // if another retry fires, then this will not run - await reconnectToLND(innerCtx) - } - },2000) + console.log(`=> [lnd] connected! ${now}`) + if(callback) callback() + } catch(e) { + if(e.code===ERR_CODE_UNIMPLEMENTED) { + // await tryToUnlockLND() } - }) + setTimeout(async()=>{ // retry each 2 secs + if(ctx===innerCtx) { // if another retry fires, then this will not run + await reconnectToLND(innerCtx) + } + },2000) + } } From 4c9828ac45ebe355a3141212111e2202d136f3d4 Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Mon, 23 Nov 2020 15:51:59 -0800 Subject: [PATCH 24/38] cleanup --- dist/app.js | 9 ++++++--- dist/app.js.map | 2 +- dist/src/utils/lightning.js | 3 --- dist/src/utils/lightning.js.map | 2 +- src/utils/lightning.ts | 3 --- 5 files changed, 8 insertions(+), 11 deletions(-) diff --git a/dist/app.js b/dist/app.js index 9ea93f9..305f785 100644 --- a/dist/app.js +++ b/dist/app.js @@ -41,9 +41,12 @@ function start() { start(); function connectToLND() { return __awaiter(this, void 0, void 0, function* () { - yield grpc.reconnectToLND(Math.random()); // recursive - console.log(">> SETUP MAIN"); - yield mainSetup(); + grpc.reconnectToLND(Math.random(), function () { + return __awaiter(this, void 0, void 0, function* () { + console.log(">> SETUP MAIN"); + yield mainSetup(); + }); + }); // recursive }); } function mainSetup() { diff --git a/dist/app.js.map b/dist/app.js.map index 93c2c69..0f4a1a3 100644 --- a/dist/app.js.map +++ b/dist/app.js.map @@ -1 +1 @@ -{"version":3,"file":"app.js","sourceRoot":"","sources":["../app.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,mCAAkC;AAClC,0CAAyC;AACzC,iCAAgC;AAChC,8CAA6C;AAC7C,6BAA4B;AAC5B,6BAA4B;AAC5B,+CAAuC;AACvC,mCAAkE;AAClE,6CAA0D;AAC1D,iDAAgD;AAChD,6CAA4C;AAC5C,yCAAwC;AACxC,qCAA+C;AAC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aAAa,EAAE;YACzB,GAAG,CAAC,GAAG,CAAC,iBAAU,CAAC,CAAC;SACpB;QACD,GAAG,CAAC,GAAG,CAAC,SAAS,EAAE,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC7C,GAAG,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAA;QAEhD,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,EAAE;YAC3B,IAAI,GAAG;gBAAE,MAAM,GAAG,CAAC;YACnB,+BAA+B;YAC/B,OAAO,CAAC,GAAG,CAAC,qBAAqB,IAAI,GAAG,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;QAEH,oBAAoB;QACpB,IAAG,CAAC,MAAM,CAAC,MAAM,EAAE;YAClB,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACrB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;SACtB;aAAM;YACN,GAAG,CAAC,IAAI,CAAC,SAAS,EAAE,UAAe,GAAG,EAAC,GAAG;;oBACzC,MAAM,EAAE,GAAG,MAAM,eAAQ,CAAC,GAAG,EAAC,GAAG,CAAC,CAAA;oBAClC,IAAG,EAAE,EAAE;wBACN,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;wBACrB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;qBACtB;gBACF,CAAC;aAAA,CAAC,CAAA;SACF;IACF,CAAC;CAAA"} \ No newline at end of file diff --git a/dist/src/utils/lightning.js b/dist/src/utils/lightning.js index 1814365..1713cb1 100644 --- a/dist/src/utils/lightning.js +++ b/dist/src/utils/lightning.js @@ -59,11 +59,8 @@ const loadLightning = () => { try { var credentials = loadCredentials(); var lnrpcDescriptor = grpc.load("proto/rpc.proto"); - console.log('lnrpcDescriptor', lnrpcDescriptor); var lnrpc = lnrpcDescriptor.lnrpc; - console.log('lnrpc', lnrpc); lightningClient = new lnrpc.Lightning(config.node_ip + ':' + config.lnd_port, credentials); - console.log("lightningClient", lightningClient); return lightningClient; } catch (e) { diff --git a/dist/src/utils/lightning.js.map b/dist/src/utils/lightning.js.map index 8312613..a6a7ecf 100644 --- a/dist/src/utils/lightning.js.map +++ b/dist/src/utils/lightning.js.map @@ -1 +1 @@ -{"version":3,"file":"lightning.js","sourceRoot":"","sources":["../../../src/utils/lightning.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,yCAAwC;AACxC,yBAAwB;AACxB,6BAA4B;AAC5B,wCAAmC;AACnC,iCAAgC;AAChC,iCAAgC;AAChC,6BAA4B;AAC5B,4CAAoC;AACpC,yCAAsC;AAEtC,kDAAkD;AAClD,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,uBAAuB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AAEzE,MAAM,eAAe,GAAG,UAAU,CAAA;AAochC,0CAAe;AAncjB,MAAM,wBAAwB,GAAG,SAAS,CAAA;AAocxC,4DAAwB;AAlc1B,IAAI,eAAe,GAAS,IAAI,CAAC;AACjC,IAAI,cAAc,GAAU,IAAI,CAAC;AAEjC,MAAM,eAAe,GAAG,GAAG,EAAE;IAC3B,IAAI,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IACnD,IAAI,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACnD,IAAI,QAAQ,GAAG,sBAAW,EAAE,CAAA;IAC7B,IAAI,QAAQ,GAAG,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAA;IAClC,QAAQ,CAAC,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAA;IAClC,IAAI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,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KACd;IACF,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACtB,CAAC"} \ No newline at end of file diff --git a/src/utils/lightning.ts b/src/utils/lightning.ts index d6f4d87..a159fea 100644 --- a/src/utils/lightning.ts +++ b/src/utils/lightning.ts @@ -51,11 +51,8 @@ const loadLightning = () => { try{ var credentials = loadCredentials() var lnrpcDescriptor = grpc.load("proto/rpc.proto"); - console.log('lnrpcDescriptor',lnrpcDescriptor) var lnrpc: any = lnrpcDescriptor.lnrpc - console.log('lnrpc',lnrpc) lightningClient = new lnrpc.Lightning(config.node_ip + ':' + config.lnd_port, credentials); - console.log("lightningClient",lightningClient) return lightningClient } catch(e) { throw e From b9ca9f0799c9258d574c9b45a54603c4d7ad940a Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Mon, 23 Nov 2020 15:56:39 -0800 Subject: [PATCH 25/38] cleanup --- rpc.proto | 3527 -------------------------------------------------- signer.proto | 228 ---- 2 files changed, 3755 deletions(-) delete mode 100644 rpc.proto delete mode 100644 signer.proto diff --git a/rpc.proto b/rpc.proto deleted file mode 100644 index 72e8cb4..0000000 --- a/rpc.proto +++ /dev/null @@ -1,3527 +0,0 @@ -syntax = "proto3"; - -// import "google/api/annotations.proto"; - -package lnrpc; - -option go_package = "github.com/lightningnetwork/lnd/lnrpc"; - -/* - * Comments in this file will be directly parsed into the API - * Documentation as descriptions of the associated method, message, or field. - * These descriptions should go right above the definition of the object, and - * can be in either block or // comment format. - * - * An RPC method can be matched to an lncli command by placing a line in the - * beginning of the description in exactly the following format: - * lncli: `methodname` - * - * Failure to specify the exact name of the command will cause documentation - * generation to fail. - * - * More information on how exactly the gRPC documentation is generated from - * this proto file can be found here: - * https://github.com/lightninglabs/lightning-api - */ - -// Lightning is the main RPC server of the daemon. -service Lightning { - /* lncli: `walletbalance` - WalletBalance returns total unspent outputs(confirmed and unconfirmed), all - confirmed unspent outputs and all unconfirmed unspent outputs under control - of the wallet. - */ - rpc WalletBalance (WalletBalanceRequest) returns (WalletBalanceResponse) { - option (google.api.http) = { - get: "/v1/balance/blockchain" - }; - } - - /* lncli: `channelbalance` - ChannelBalance returns the total funds available across all open channels - in satoshis. - */ - rpc ChannelBalance (ChannelBalanceRequest) - returns (ChannelBalanceResponse) { - option (google.api.http) = { - get: "/v1/balance/channels" - }; - } - - /* lncli: `listchaintxns` - GetTransactions returns a list describing all the known transactions - relevant to the wallet. - */ - rpc GetTransactions (GetTransactionsRequest) returns (TransactionDetails) { - option (google.api.http) = { - get: "/v1/transactions" - }; - } - - /* lncli: `estimatefee` - EstimateFee asks the chain backend to estimate the fee rate and total fees - for a transaction that pays to multiple specified outputs. - */ - rpc EstimateFee (EstimateFeeRequest) returns (EstimateFeeResponse) { - option (google.api.http) = { - get: "/v1/transactions/fee" - }; - } - - /* lncli: `sendcoins` - SendCoins executes a request to send coins to a particular address. Unlike - SendMany, this RPC call only allows creating a single output at a time. If - neither target_conf, or sat_per_byte are set, then the internal wallet will - consult its fee model to determine a fee for the default confirmation - target. - */ - rpc SendCoins (SendCoinsRequest) returns (SendCoinsResponse) { - option (google.api.http) = { - post: "/v1/transactions" - body: "*" - }; - } - - /* lncli: `listunspent` - ListUnspent returns a list of all utxos spendable by the wallet with a - number of confirmations between the specified minimum and maximum. - */ - rpc ListUnspent (ListUnspentRequest) returns (ListUnspentResponse) { - option (google.api.http) = { - get: "/v1/utxos" - }; - } - - /* - SubscribeTransactions creates a uni-directional stream from the server to - the client in which any newly discovered transactions relevant to the - wallet are sent over. - */ - rpc SubscribeTransactions (GetTransactionsRequest) - returns (stream Transaction); - - /* lncli: `sendmany` - SendMany handles a request for a transaction that creates multiple specified - outputs in parallel. If neither target_conf, or sat_per_byte are set, then - the internal wallet will consult its fee model to determine a fee for the - default confirmation target. - */ - rpc SendMany (SendManyRequest) returns (SendManyResponse); - - /* lncli: `newaddress` - NewAddress creates a new address under control of the local wallet. - */ - rpc NewAddress (NewAddressRequest) returns (NewAddressResponse) { - option (google.api.http) = { - get: "/v1/newaddress" - }; - } - - /* lncli: `signmessage` - SignMessage signs a message with this node's private key. The returned - signature string is `zbase32` encoded and pubkey recoverable, meaning that - only the message digest and signature are needed for verification. - */ - rpc SignMessage (SignMessageRequest) returns (SignMessageResponse) { - option (google.api.http) = { - post: "/v1/signmessage" - body: "*" - }; - } - - /* lncli: `verifymessage` - VerifyMessage verifies a signature over a msg. The signature must be - zbase32 encoded and signed by an active node in the resident node's - channel database. In addition to returning the validity of the signature, - VerifyMessage also returns the recovered pubkey from the signature. - */ - rpc VerifyMessage (VerifyMessageRequest) returns (VerifyMessageResponse) { - option (google.api.http) = { - post: "/v1/verifymessage" - body: "*" - }; - } - - /* lncli: `connect` - ConnectPeer attempts to establish a connection to a remote peer. This is at - the networking level, and is used for communication between nodes. This is - distinct from establishing a channel with a peer. - */ - rpc ConnectPeer (ConnectPeerRequest) returns (ConnectPeerResponse) { - option (google.api.http) = { - post: "/v1/peers" - body: "*" - }; - } - - /* lncli: `disconnect` - DisconnectPeer attempts to disconnect one peer from another identified by a - given pubKey. In the case that we currently have a pending or active channel - with the target peer, then this action will be not be allowed. - */ - rpc DisconnectPeer (DisconnectPeerRequest) - returns (DisconnectPeerResponse) { - option (google.api.http) = { - delete: "/v1/peers/{pub_key}" - }; - } - - /* lncli: `listpeers` - ListPeers returns a verbose listing of all currently active peers. - */ - rpc ListPeers (ListPeersRequest) returns (ListPeersResponse) { - option (google.api.http) = { - get: "/v1/peers" - }; - } - - /* - SubscribePeerEvents creates a uni-directional stream from the server to - the client in which any events relevant to the state of peers are sent - over. Events include peers going online and offline. - */ - rpc SubscribePeerEvents (PeerEventSubscription) returns (stream PeerEvent); - - /* lncli: `getinfo` - GetInfo returns general information concerning the lightning node including - it's identity pubkey, alias, the chains it is connected to, and information - concerning the number of open+pending channels. - */ - rpc GetInfo (GetInfoRequest) returns (GetInfoResponse) { - option (google.api.http) = { - get: "/v1/getinfo" - }; - } - - // TODO(roasbeef): merge with below with bool? - /* lncli: `pendingchannels` - PendingChannels returns a list of all the channels that are currently - considered "pending". A channel is pending if it has finished the funding - workflow and is waiting for confirmations for the funding txn, or is in the - process of closure, either initiated cooperatively or non-cooperatively. - */ - rpc PendingChannels (PendingChannelsRequest) - returns (PendingChannelsResponse) { - option (google.api.http) = { - get: "/v1/channels/pending" - }; - } - - /* lncli: `listchannels` - ListChannels returns a description of all the open channels that this node - is a participant in. - */ - rpc ListChannels (ListChannelsRequest) returns (ListChannelsResponse) { - option (google.api.http) = { - get: "/v1/channels" - }; - } - - /* - SubscribeChannelEvents creates a uni-directional stream from the server to - the client in which any updates relevant to the state of the channels are - sent over. Events include new active channels, inactive channels, and closed - channels. - */ - rpc SubscribeChannelEvents (ChannelEventSubscription) - returns (stream ChannelEventUpdate); - - /* lncli: `closedchannels` - ClosedChannels returns a description of all the closed channels that - this node was a participant in. - */ - rpc ClosedChannels (ClosedChannelsRequest) - returns (ClosedChannelsResponse) { - option (google.api.http) = { - get: "/v1/channels/closed" - }; - } - - /* - OpenChannelSync is a synchronous version of the OpenChannel RPC call. This - call is meant to be consumed by clients to the REST proxy. As with all - other sync calls, all byte slices are intended to be populated as hex - encoded strings. - */ - rpc OpenChannelSync (OpenChannelRequest) returns (ChannelPoint) { - option (google.api.http) = { - post: "/v1/channels" - body: "*" - }; - } - - /* lncli: `openchannel` - OpenChannel attempts to open a singly funded channel specified in the - request to a remote peer. Users are able to specify a target number of - blocks that the funding transaction should be confirmed in, or a manual fee - rate to us for the funding transaction. If neither are specified, then a - lax block confirmation target is used. Each OpenStatusUpdate will return - the pending channel ID of the in-progress channel. Depending on the - arguments specified in the OpenChannelRequest, this pending channel ID can - then be used to manually progress the channel funding flow. - */ - rpc OpenChannel (OpenChannelRequest) returns (stream OpenStatusUpdate); - - /* - FundingStateStep is an advanced funding related call that allows the caller - to either execute some preparatory steps for a funding workflow, or - manually progress a funding workflow. The primary way a funding flow is - identified is via its pending channel ID. As an example, this method can be - used to specify that we're expecting a funding flow for a particular - pending channel ID, for which we need to use specific parameters. - Alternatively, this can be used to interactively drive PSBT signing for - funding for partially complete funding transactions. - */ - rpc FundingStateStep (FundingTransitionMsg) returns (FundingStateStepResp); - - /* - ChannelAcceptor dispatches a bi-directional streaming RPC in which - OpenChannel requests are sent to the client and the client responds with - a boolean that tells LND whether or not to accept the channel. This allows - node operators to specify their own criteria for accepting inbound channels - through a single persistent connection. - */ - rpc ChannelAcceptor (stream ChannelAcceptResponse) - returns (stream ChannelAcceptRequest); - - /* lncli: `closechannel` - CloseChannel attempts to close an active channel identified by its channel - outpoint (ChannelPoint). The actions of this method can additionally be - augmented to attempt a force close after a timeout period in the case of an - inactive peer. If a non-force close (cooperative closure) is requested, - then the user can specify either a target number of blocks until the - closure transaction is confirmed, or a manual fee rate. If neither are - specified, then a default lax, block confirmation target is used. - */ - rpc CloseChannel (CloseChannelRequest) returns (stream CloseStatusUpdate) { - option (google.api.http) = { - delete: "/v1/channels/{channel_point.funding_txid_str}/{channel_point.output_index}" - }; - } - - /* lncli: `abandonchannel` - AbandonChannel removes all channel state from the database except for a - close summary. This method can be used to get rid of permanently unusable - channels due to bugs fixed in newer versions of lnd. Only available - when in debug builds of lnd. - */ - rpc AbandonChannel (AbandonChannelRequest) - returns (AbandonChannelResponse) { - option (google.api.http) = { - delete: "/v1/channels/abandon/{channel_point.funding_txid_str}/{channel_point.output_index}" - }; - } - - /* lncli: `sendpayment` - Deprecated, use routerrpc.SendPaymentV2. SendPayment dispatches a - bi-directional streaming RPC for sending payments through the Lightning - Network. A single RPC invocation creates a persistent bi-directional - stream allowing clients to rapidly send payments through the Lightning - Network with a single persistent connection. - */ - rpc SendPayment (stream SendRequest) returns (stream SendResponse) { - option deprecated = true; - } - - /* - SendPaymentSync is the synchronous non-streaming version of SendPayment. - This RPC is intended to be consumed by clients of the REST proxy. - Additionally, this RPC expects the destination's public key and the payment - hash (if any) to be encoded as hex strings. - */ - rpc SendPaymentSync (SendRequest) returns (SendResponse) { - option (google.api.http) = { - post: "/v1/channels/transactions" - body: "*" - }; - } - - /* lncli: `sendtoroute` - Deprecated, use routerrpc.SendToRouteV2. SendToRoute is a bi-directional - streaming RPC for sending payment through the Lightning Network. This - method differs from SendPayment in that it allows users to specify a full - route manually. This can be used for things like rebalancing, and atomic - swaps. - */ - rpc SendToRoute (stream SendToRouteRequest) returns (stream SendResponse) { - option deprecated = true; - } - - /* - SendToRouteSync is a synchronous version of SendToRoute. It Will block - until the payment either fails or succeeds. - */ - rpc SendToRouteSync (SendToRouteRequest) returns (SendResponse) { - option (google.api.http) = { - post: "/v1/channels/transactions/route" - body: "*" - }; - } - - /* lncli: `addinvoice` - AddInvoice attempts to add a new invoice to the invoice database. Any - duplicated invoices are rejected, therefore all invoices *must* have a - unique payment preimage. - */ - rpc AddInvoice (Invoice) returns (AddInvoiceResponse) { - option (google.api.http) = { - post: "/v1/invoices" - body: "*" - }; - } - - /* lncli: `listinvoices` - ListInvoices returns a list of all the invoices currently stored within the - database. Any active debug invoices are ignored. It has full support for - paginated responses, allowing users to query for specific invoices through - their add_index. This can be done by using either the first_index_offset or - last_index_offset fields included in the response as the index_offset of the - next request. By default, the first 100 invoices created will be returned. - Backwards pagination is also supported through the Reversed flag. - */ - rpc ListInvoices (ListInvoiceRequest) returns (ListInvoiceResponse) { - option (google.api.http) = { - get: "/v1/invoices" - }; - } - - /* lncli: `lookupinvoice` - LookupInvoice attempts to look up an invoice according to its payment hash. - The passed payment hash *must* be exactly 32 bytes, if not, an error is - returned. - */ - rpc LookupInvoice (PaymentHash) returns (Invoice) { - option (google.api.http) = { - get: "/v1/invoice/{r_hash_str}" - }; - } - - /* - SubscribeInvoices returns a uni-directional stream (server -> client) for - notifying the client of newly added/settled invoices. The caller can - optionally specify the add_index and/or the settle_index. If the add_index - is specified, then we'll first start by sending add invoice events for all - invoices with an add_index greater than the specified value. If the - settle_index is specified, the next, we'll send out all settle events for - invoices with a settle_index greater than the specified value. One or both - of these fields can be set. If no fields are set, then we'll only send out - the latest add/settle events. - */ - rpc SubscribeInvoices (InvoiceSubscription) returns (stream Invoice) { - option (google.api.http) = { - get: "/v1/invoices/subscribe" - }; - } - - /* lncli: `decodepayreq` - DecodePayReq takes an encoded payment request string and attempts to decode - it, returning a full description of the conditions encoded within the - payment request. - */ - rpc DecodePayReq (PayReqString) returns (PayReq) { - option (google.api.http) = { - get: "/v1/payreq/{pay_req}" - }; - } - - /* lncli: `listpayments` - ListPayments returns a list of all outgoing payments. - */ - rpc ListPayments (ListPaymentsRequest) returns (ListPaymentsResponse) { - option (google.api.http) = { - get: "/v1/payments" - }; - }; - - /* - DeleteAllPayments deletes all outgoing payments from DB. - */ - rpc DeleteAllPayments (DeleteAllPaymentsRequest) - returns (DeleteAllPaymentsResponse) { - option (google.api.http) = { - delete: "/v1/payments" - }; - }; - - /* lncli: `describegraph` - DescribeGraph returns a description of the latest graph state from the - point of view of the node. The graph information is partitioned into two - components: all the nodes/vertexes, and all the edges that connect the - vertexes themselves. As this is a directed graph, the edges also contain - the node directional specific routing policy which includes: the time lock - delta, fee information, etc. - */ - rpc DescribeGraph (ChannelGraphRequest) returns (ChannelGraph) { - option (google.api.http) = { - get: "/v1/graph" - }; - } - - /* lncli: `getnodemetrics` - GetNodeMetrics returns node metrics calculated from the graph. Currently - the only supported metric is betweenness centrality of individual nodes. - */ - rpc GetNodeMetrics (NodeMetricsRequest) returns (NodeMetricsResponse) { - option (google.api.http) = { - get: "/v1/graph/nodemetrics" - }; - } - - /* lncli: `getchaninfo` - GetChanInfo returns the latest authenticated network announcement for the - given channel identified by its channel ID: an 8-byte integer which - uniquely identifies the location of transaction's funding output within the - blockchain. - */ - rpc GetChanInfo (ChanInfoRequest) returns (ChannelEdge) { - option (google.api.http) = { - get: "/v1/graph/edge/{chan_id}" - }; - } - - /* lncli: `getnodeinfo` - GetNodeInfo returns the latest advertised, aggregated, and authenticated - channel information for the specified node identified by its public key. - */ - rpc GetNodeInfo (NodeInfoRequest) returns (NodeInfo) { - option (google.api.http) = { - get: "/v1/graph/node/{pub_key}" - }; - } - - /* lncli: `queryroutes` - QueryRoutes attempts to query the daemon's Channel Router for a possible - route to a target destination capable of carrying a specific amount of - satoshis. The returned route contains the full details required to craft and - send an HTLC, also including the necessary information that should be - present within the Sphinx packet encapsulated within the HTLC. - */ - rpc QueryRoutes (QueryRoutesRequest) returns (QueryRoutesResponse) { - option (google.api.http) = { - get: "/v1/graph/routes/{pub_key}/{amt}" - }; - } - - /* lncli: `getnetworkinfo` - GetNetworkInfo returns some basic stats about the known channel graph from - the point of view of the node. - */ - rpc GetNetworkInfo (NetworkInfoRequest) returns (NetworkInfo) { - option (google.api.http) = { - get: "/v1/graph/info" - }; - } - - /* lncli: `stop` - StopDaemon will send a shutdown request to the interrupt handler, triggering - a graceful shutdown of the daemon. - */ - rpc StopDaemon (StopRequest) returns (StopResponse); - - /* - SubscribeChannelGraph launches a streaming RPC that allows the caller to - receive notifications upon any changes to the channel graph topology from - the point of view of the responding node. Events notified include: new - nodes coming online, nodes updating their authenticated attributes, new - channels being advertised, updates in the routing policy for a directional - channel edge, and when channels are closed on-chain. - */ - rpc SubscribeChannelGraph (GraphTopologySubscription) - returns (stream GraphTopologyUpdate); - - /* lncli: `debuglevel` - DebugLevel allows a caller to programmatically set the logging verbosity of - lnd. The logging can be targeted according to a coarse daemon-wide logging - level, or in a granular fashion to specify the logging for a target - sub-system. - */ - rpc DebugLevel (DebugLevelRequest) returns (DebugLevelResponse); - - /* lncli: `feereport` - FeeReport allows the caller to obtain a report detailing the current fee - schedule enforced by the node globally for each channel. - */ - rpc FeeReport (FeeReportRequest) returns (FeeReportResponse) { - option (google.api.http) = { - get: "/v1/fees" - }; - } - - /* lncli: `updatechanpolicy` - UpdateChannelPolicy allows the caller to update the fee schedule and - channel policies for all channels globally, or a particular channel. - */ - rpc UpdateChannelPolicy (PolicyUpdateRequest) - returns (PolicyUpdateResponse) { - option (google.api.http) = { - post: "/v1/chanpolicy" - body: "*" - }; - } - - /* lncli: `fwdinghistory` - ForwardingHistory allows the caller to query the htlcswitch for a record of - all HTLCs forwarded within the target time range, and integer offset - within that time range. If no time-range is specified, then the first chunk - of the past 24 hrs of forwarding history are returned. - - A list of forwarding events are returned. The size of each forwarding event - is 40 bytes, and the max message size able to be returned in gRPC is 4 MiB. - As a result each message can only contain 50k entries. Each response has - the index offset of the last entry. The index offset can be provided to the - request to allow the caller to skip a series of records. - */ - rpc ForwardingHistory (ForwardingHistoryRequest) - returns (ForwardingHistoryResponse) { - option (google.api.http) = { - post: "/v1/switch" - body: "*" - }; - }; - - /* lncli: `exportchanbackup` - ExportChannelBackup attempts to return an encrypted static channel backup - for the target channel identified by it channel point. The backup is - encrypted with a key generated from the aezeed seed of the user. The - returned backup can either be restored using the RestoreChannelBackup - method once lnd is running, or via the InitWallet and UnlockWallet methods - from the WalletUnlocker service. - */ - rpc ExportChannelBackup (ExportChannelBackupRequest) - returns (ChannelBackup) { - option (google.api.http) = { - get: "/v1/channels/backup/{chan_point.funding_txid_str}/{chan_point.output_index}" - }; - }; - - /* - ExportAllChannelBackups returns static channel backups for all existing - channels known to lnd. A set of regular singular static channel backups for - each channel are returned. Additionally, a multi-channel backup is returned - as well, which contains a single encrypted blob containing the backups of - each channel. - */ - rpc ExportAllChannelBackups (ChanBackupExportRequest) - returns (ChanBackupSnapshot) { - option (google.api.http) = { - get: "/v1/channels/backup" - }; - }; - - /* - VerifyChanBackup allows a caller to verify the integrity of a channel backup - snapshot. This method will accept either a packed Single or a packed Multi. - Specifying both will result in an error. - */ - rpc VerifyChanBackup (ChanBackupSnapshot) - returns (VerifyChanBackupResponse) { - option (google.api.http) = { - post: "/v1/channels/backup/verify" - body: "*" - }; - }; - - /* lncli: `restorechanbackup` - RestoreChannelBackups accepts a set of singular channel backups, or a - single encrypted multi-chan backup and attempts to recover any funds - remaining within the channel. If we are able to unpack the backup, then the - new channel will be shown under listchannels, as well as pending channels. - */ - rpc RestoreChannelBackups (RestoreChanBackupRequest) - returns (RestoreBackupResponse) { - option (google.api.http) = { - post: "/v1/channels/backup/restore" - body: "*" - }; - }; - - /* - SubscribeChannelBackups allows a client to sub-subscribe to the most up to - date information concerning the state of all channel backups. Each time a - new channel is added, we return the new set of channels, along with a - multi-chan backup containing the backup info for all channels. Each time a - channel is closed, we send a new update, which contains new new chan back - ups, but the updated set of encrypted multi-chan backups with the closed - channel(s) removed. - */ - rpc SubscribeChannelBackups (ChannelBackupSubscription) - returns (stream ChanBackupSnapshot) { - }; - - /* lncli: `bakemacaroon` - BakeMacaroon allows the creation of a new macaroon with custom read and - write permissions. No first-party caveats are added since this can be done - offline. - */ - rpc BakeMacaroon (BakeMacaroonRequest) returns (BakeMacaroonResponse) { - option (google.api.http) = { - post: "/v1/macaroon" - body: "*" - }; - }; -} - -message Utxo { - // The type of address - AddressType address_type = 1; - - // The address - string address = 2; - - // The value of the unspent coin in satoshis - int64 amount_sat = 3; - - // The pkscript in hex - string pk_script = 4; - - // The outpoint in format txid:n - OutPoint outpoint = 5; - - // The number of confirmations for the Utxo - int64 confirmations = 6; -} - -message Transaction { - // The transaction hash - string tx_hash = 1; - - // The transaction amount, denominated in satoshis - int64 amount = 2; - - // The number of confirmations - int32 num_confirmations = 3; - - // The hash of the block this transaction was included in - string block_hash = 4; - - // The height of the block this transaction was included in - int32 block_height = 5; - - // Timestamp of this transaction - int64 time_stamp = 6; - - // Fees paid for this transaction - int64 total_fees = 7; - - // Addresses that received funds for this transaction - repeated string dest_addresses = 8; - - // The raw transaction hex. - string raw_tx_hex = 9; - - // A label that was optionally set on transaction broadcast. - string label = 10; -} -message GetTransactionsRequest { - /* - The height from which to list transactions, inclusive. If this value is - greater than end_height, transactions will be read in reverse. - */ - int32 start_height = 1; - - /* - The height until which to list transactions, inclusive. To include - unconfirmed transactions, this value should be set to -1, which will - return transactions from start_height until the current chain tip and - unconfirmed transactions. If no end_height is provided, the call will - default to this option. - */ - int32 end_height = 2; -} - -message TransactionDetails { - // The list of transactions relevant to the wallet. - repeated Transaction transactions = 1; -} - -message FeeLimit { - oneof limit { - /* - The fee limit expressed as a fixed amount of satoshis. - - The fields fixed and fixed_msat are mutually exclusive. - */ - int64 fixed = 1; - - /* - The fee limit expressed as a fixed amount of millisatoshis. - - The fields fixed and fixed_msat are mutually exclusive. - */ - int64 fixed_msat = 3; - - // The fee limit expressed as a percentage of the payment amount. - int64 percent = 2; - } -} - -message SendRequest { - /* - The identity pubkey of the payment recipient. When using REST, this field - must be encoded as base64. - */ - bytes dest = 1; - - /* - The hex-encoded identity pubkey of the payment recipient. Deprecated now - that the REST gateway supports base64 encoding of bytes fields. - */ - string dest_string = 2 [deprecated = true]; - - /* - The amount to send expressed in satoshis. - - The fields amt and amt_msat are mutually exclusive. - */ - int64 amt = 3; - - /* - The amount to send expressed in millisatoshis. - - The fields amt and amt_msat are mutually exclusive. - */ - int64 amt_msat = 12; - - /* - The hash to use within the payment's HTLC. When using REST, this field - must be encoded as base64. - */ - bytes payment_hash = 4; - - /* - The hex-encoded hash to use within the payment's HTLC. Deprecated now - that the REST gateway supports base64 encoding of bytes fields. - */ - string payment_hash_string = 5 [deprecated = true]; - - /* - A bare-bones invoice for a payment within the Lightning Network. With the - details of the invoice, the sender has all the data necessary to send a - payment to the recipient. - */ - string payment_request = 6; - - /* - The CLTV delta from the current height that should be used to set the - timelock for the final hop. - */ - int32 final_cltv_delta = 7; - - /* - The maximum number of satoshis that will be paid as a fee of the payment. - This value can be represented either as a percentage of the amount being - sent, or as a fixed amount of the maximum fee the user is willing the pay to - send the payment. - */ - FeeLimit fee_limit = 8; - - /* - The channel id of the channel that must be taken to the first hop. If zero, - any channel may be used. - */ - uint64 outgoing_chan_id = 9 [jstype = JS_STRING]; - - /* - The pubkey of the last hop of the route. If empty, any hop may be used. - */ - bytes last_hop_pubkey = 13; - - /* - An optional maximum total time lock for the route. This should not exceed - lnd's `--max-cltv-expiry` setting. If zero, then the value of - `--max-cltv-expiry` is enforced. - */ - uint32 cltv_limit = 10; - - /* - An optional field that can be used to pass an arbitrary set of TLV records - to a peer which understands the new records. This can be used to pass - application specific data during the payment attempt. Record types are - required to be in the custom range >= 65536. When using REST, the values - must be encoded as base64. - */ - map dest_custom_records = 11; - - // If set, circular payments to self are permitted. - bool allow_self_payment = 14; - - /* - Features assumed to be supported by the final node. All transitive feature - dependencies must also be set properly. For a given feature bit pair, either - optional or remote may be set, but not both. If this field is nil or empty, - the router will try to load destination features from the graph as a - fallback. - */ - repeated FeatureBit dest_features = 15; -} - -message SendResponse { - string payment_error = 1; - bytes payment_preimage = 2; - Route payment_route = 3; - bytes payment_hash = 4; -} - -message SendToRouteRequest { - /* - The payment hash to use for the HTLC. When using REST, this field must be - encoded as base64. - */ - bytes payment_hash = 1; - - /* - An optional hex-encoded payment hash to be used for the HTLC. Deprecated now - that the REST gateway supports base64 encoding of bytes fields. - */ - string payment_hash_string = 2 [deprecated = true]; - - reserved 3; - - // Route that should be used to attempt to complete the payment. - Route route = 4; -} - -message ChannelAcceptRequest { - // The pubkey of the node that wishes to open an inbound channel. - bytes node_pubkey = 1; - - // The hash of the genesis block that the proposed channel resides in. - bytes chain_hash = 2; - - // The pending channel id. - bytes pending_chan_id = 3; - - // The funding amount in satoshis that initiator wishes to use in the - // channel. - uint64 funding_amt = 4; - - // The push amount of the proposed channel in millisatoshis. - uint64 push_amt = 5; - - // The dust limit of the initiator's commitment tx. - uint64 dust_limit = 6; - - // The maximum amount of coins in millisatoshis that can be pending in this - // channel. - uint64 max_value_in_flight = 7; - - // The minimum amount of satoshis the initiator requires us to have at all - // times. - uint64 channel_reserve = 8; - - // The smallest HTLC in millisatoshis that the initiator will accept. - uint64 min_htlc = 9; - - // The initial fee rate that the initiator suggests for both commitment - // transactions. - uint64 fee_per_kw = 10; - - /* - The number of blocks to use for the relative time lock in the pay-to-self - output of both commitment transactions. - */ - uint32 csv_delay = 11; - - // The total number of incoming HTLC's that the initiator will accept. - uint32 max_accepted_htlcs = 12; - - // A bit-field which the initiator uses to specify proposed channel - // behavior. - uint32 channel_flags = 13; -} - -message ChannelAcceptResponse { - // Whether or not the client accepts the channel. - bool accept = 1; - - // The pending channel id to which this response applies. - bytes pending_chan_id = 2; -} - -message ChannelPoint { - oneof funding_txid { - /* - Txid of the funding transaction. When using REST, this field must be - encoded as base64. - */ - bytes funding_txid_bytes = 1; - - /* - Hex-encoded string representing the byte-reversed hash of the funding - transaction. - */ - string funding_txid_str = 2; - } - - // The index of the output of the funding transaction - uint32 output_index = 3; -} - -message OutPoint { - // Raw bytes representing the transaction id. - bytes txid_bytes = 1; - - // Reversed, hex-encoded string representing the transaction id. - string txid_str = 2; - - // The index of the output on the transaction. - uint32 output_index = 3; -} - -message LightningAddress { - // The identity pubkey of the Lightning node - string pubkey = 1; - - // The network location of the lightning node, e.g. `69.69.69.69:1337` or - // `localhost:10011` - string host = 2; -} - -message EstimateFeeRequest { - // The map from addresses to amounts for the transaction. - map AddrToAmount = 1; - - // The target number of blocks that this transaction should be confirmed - // by. - int32 target_conf = 2; -} - -message EstimateFeeResponse { - // The total fee in satoshis. - int64 fee_sat = 1; - - // The fee rate in satoshi/byte. - int64 feerate_sat_per_byte = 2; -} - -message SendManyRequest { - // The map from addresses to amounts - map AddrToAmount = 1; - - // The target number of blocks that this transaction should be confirmed - // by. - int32 target_conf = 3; - - // A manual fee rate set in sat/byte that should be used when crafting the - // transaction. - int64 sat_per_byte = 5; - - // An optional label for the transaction, limited to 500 characters. - string label = 6; -} -message SendManyResponse { - // The id of the transaction - string txid = 1; -} - -message SendCoinsRequest { - // The address to send coins to - string addr = 1; - - // The amount in satoshis to send - int64 amount = 2; - - // The target number of blocks that this transaction should be confirmed - // by. - int32 target_conf = 3; - - // A manual fee rate set in sat/byte that should be used when crafting the - // transaction. - int64 sat_per_byte = 5; - - /* - If set, then the amount field will be ignored, and lnd will attempt to - send all the coins under control of the internal wallet to the specified - address. - */ - bool send_all = 6; - - // An optional label for the transaction, limited to 500 characters. - string label = 7; -} -message SendCoinsResponse { - // The transaction ID of the transaction - string txid = 1; -} - -message ListUnspentRequest { - // The minimum number of confirmations to be included. - int32 min_confs = 1; - - // The maximum number of confirmations to be included. - int32 max_confs = 2; -} -message ListUnspentResponse { - // A list of utxos - repeated Utxo utxos = 1; -} - -/* -`AddressType` has to be one of: - -- `p2wkh`: Pay to witness key hash (`WITNESS_PUBKEY_HASH` = 0) -- `np2wkh`: Pay to nested witness key hash (`NESTED_PUBKEY_HASH` = 1) -*/ -enum AddressType { - WITNESS_PUBKEY_HASH = 0; - NESTED_PUBKEY_HASH = 1; - UNUSED_WITNESS_PUBKEY_HASH = 2; - UNUSED_NESTED_PUBKEY_HASH = 3; -} - -message NewAddressRequest { - // The address type - AddressType type = 1; -} -message NewAddressResponse { - // The newly generated wallet address - string address = 1; -} - -message SignMessageRequest { - /* - The message to be signed. When using REST, this field must be encoded as - base64. - */ - bytes msg = 1; -} -message SignMessageResponse { - // The signature for the given message - string signature = 1; -} - -message VerifyMessageRequest { - /* - The message over which the signature is to be verified. When using REST, - this field must be encoded as base64. - */ - bytes msg = 1; - - // The signature to be verified over the given message - string signature = 2; -} -message VerifyMessageResponse { - // Whether the signature was valid over the given message - bool valid = 1; - - // The pubkey recovered from the signature - string pubkey = 2; -} - -message ConnectPeerRequest { - // Lightning address of the peer, in the format `@host` - LightningAddress addr = 1; - - /* If set, the daemon will attempt to persistently connect to the target - * peer. Otherwise, the call will be synchronous. */ - bool perm = 2; -} -message ConnectPeerResponse { -} - -message DisconnectPeerRequest { - // The pubkey of the node to disconnect from - string pub_key = 1; -} -message DisconnectPeerResponse { -} - -message HTLC { - bool incoming = 1; - int64 amount = 2; - bytes hash_lock = 3; - uint32 expiration_height = 4; -} - -enum CommitmentType { - /* - A channel using the legacy commitment format having tweaked to_remote - keys. - */ - LEGACY = 0; - - /* - A channel that uses the modern commitment format where the key in the - output of the remote party does not change each state. This makes back - up and recovery easier as when the channel is closed, the funds go - directly to that key. - */ - STATIC_REMOTE_KEY = 1; - - /* - A channel that uses a commitment format that has anchor outputs on the - commitments, allowing fee bumping after a force close transaction has - been broadcast. - */ - ANCHORS = 2; - - /* - Returned when the commitment type isn't known or unavailable. - */ - UNKNOWN_COMMITMENT_TYPE = 999; -} - -message Channel { - // Whether this channel is active or not - bool active = 1; - - // The identity pubkey of the remote node - string remote_pubkey = 2; - - /* - The outpoint (txid:index) of the funding transaction. With this value, Bob - will be able to generate a signature for Alice's version of the commitment - transaction. - */ - string channel_point = 3; - - /* - The unique channel ID for the channel. The first 3 bytes are the block - height, the next 3 the index within the block, and the last 2 bytes are the - output index for the channel. - */ - uint64 chan_id = 4 [jstype = JS_STRING]; - - // The total amount of funds held in this channel - int64 capacity = 5; - - // This node's current balance in this channel - int64 local_balance = 6; - - // The counterparty's current balance in this channel - int64 remote_balance = 7; - - /* - The amount calculated to be paid in fees for the current set of commitment - transactions. The fee amount is persisted with the channel in order to - allow the fee amount to be removed and recalculated with each channel state - update, including updates that happen after a system restart. - */ - int64 commit_fee = 8; - - // The weight of the commitment transaction - int64 commit_weight = 9; - - /* - The required number of satoshis per kilo-weight that the requester will pay - at all times, for both the funding transaction and commitment transaction. - This value can later be updated once the channel is open. - */ - int64 fee_per_kw = 10; - - // The unsettled balance in this channel - int64 unsettled_balance = 11; - - /* - The total number of satoshis we've sent within this channel. - */ - int64 total_satoshis_sent = 12; - - /* - The total number of satoshis we've received within this channel. - */ - int64 total_satoshis_received = 13; - - /* - The total number of updates conducted within this channel. - */ - uint64 num_updates = 14; - - /* - The list of active, uncleared HTLCs currently pending within the channel. - */ - repeated HTLC pending_htlcs = 15; - - /* - The CSV delay expressed in relative blocks. If the channel is force closed, - we will need to wait for this many blocks before we can regain our funds. - */ - uint32 csv_delay = 16; - - // Whether this channel is advertised to the network or not. - bool private = 17; - - // True if we were the ones that created the channel. - bool initiator = 18; - - // A set of flags showing the current state of the channel. - string chan_status_flags = 19; - - // The minimum satoshis this node is required to reserve in its balance. - int64 local_chan_reserve_sat = 20; - - /* - The minimum satoshis the other node is required to reserve in its balance. - */ - int64 remote_chan_reserve_sat = 21; - - // Deprecated. Use commitment_type. - bool static_remote_key = 22 [deprecated = true]; - - // The commitment type used by this channel. - CommitmentType commitment_type = 26; - - /* - The number of seconds that the channel has been monitored by the channel - scoring system. Scores are currently not persisted, so this value may be - less than the lifetime of the channel [EXPERIMENTAL]. - */ - int64 lifetime = 23; - - /* - The number of seconds that the remote peer has been observed as being online - by the channel scoring system over the lifetime of the channel - [EXPERIMENTAL]. - */ - int64 uptime = 24; - - /* - Close address is the address that we will enforce payout to on cooperative - close if the channel was opened utilizing option upfront shutdown. This - value can be set on channel open by setting close_address in an open channel - request. If this value is not set, you can still choose a payout address by - cooperatively closing with the delivery_address field set. - */ - string close_address = 25; - - /* - The amount that the initiator of the channel optionally pushed to the remote - party on channel open. This amount will be zero if the channel initiator did - not push any funds to the remote peer. If the initiator field is true, we - pushed this amount to our peer, if it is false, the remote peer pushed this - amount to us. - */ - uint64 push_amount_sat = 27; - - /* - This uint32 indicates if this channel is to be considered 'frozen'. A - frozen channel doest not allow a cooperative channel close by the - initiator. The thaw_height is the height that this restriction stops - applying to the channel. This field is optional, not setting it or using a - value of zero will mean the channel has no additional restrictions. - */ - uint32 thaw_height = 28; -} - -message ListChannelsRequest { - bool active_only = 1; - bool inactive_only = 2; - bool public_only = 3; - bool private_only = 4; - - /* - Filters the response for channels with a target peer's pubkey. If peer is - empty, all channels will be returned. - */ - bytes peer = 5; -} -message ListChannelsResponse { - // The list of active channels - repeated Channel channels = 11; -} - -enum Initiator { - INITIATOR_UNKNOWN = 0; - INITIATOR_LOCAL = 1; - INITIATOR_REMOTE = 2; - INITIATOR_BOTH = 3; -} - -message ChannelCloseSummary { - // The outpoint (txid:index) of the funding transaction. - string channel_point = 1; - - // The unique channel ID for the channel. - uint64 chan_id = 2 [jstype = JS_STRING]; - - // The hash of the genesis block that this channel resides within. - string chain_hash = 3; - - // The txid of the transaction which ultimately closed this channel. - string closing_tx_hash = 4; - - // Public key of the remote peer that we formerly had a channel with. - string remote_pubkey = 5; - - // Total capacity of the channel. - int64 capacity = 6; - - // Height at which the funding transaction was spent. - uint32 close_height = 7; - - // Settled balance at the time of channel closure - int64 settled_balance = 8; - - // The sum of all the time-locked outputs at the time of channel closure - int64 time_locked_balance = 9; - - enum ClosureType { - COOPERATIVE_CLOSE = 0; - LOCAL_FORCE_CLOSE = 1; - REMOTE_FORCE_CLOSE = 2; - BREACH_CLOSE = 3; - FUNDING_CANCELED = 4; - ABANDONED = 5; - } - - // Details on how the channel was closed. - ClosureType close_type = 10; - - /* - Open initiator is the party that initiated opening the channel. Note that - this value may be unknown if the channel was closed before we migrated to - store open channel information after close. - */ - Initiator open_initiator = 11; - - /* - Close initiator indicates which party initiated the close. This value will - be unknown for channels that were cooperatively closed before we started - tracking cooperative close initiators. Note that this indicates which party - initiated a close, and it is possible for both to initiate cooperative or - force closes, although only one party's close will be confirmed on chain. - */ - Initiator close_initiator = 12; -} - -message ClosedChannelsRequest { - bool cooperative = 1; - bool local_force = 2; - bool remote_force = 3; - bool breach = 4; - bool funding_canceled = 5; - bool abandoned = 6; -} - -message ClosedChannelsResponse { - repeated ChannelCloseSummary channels = 1; -} - -message Peer { - // The identity pubkey of the peer - string pub_key = 1; - - // Network address of the peer; eg `127.0.0.1:10011` - string address = 3; - - // Bytes of data transmitted to this peer - uint64 bytes_sent = 4; - - // Bytes of data transmitted from this peer - uint64 bytes_recv = 5; - - // Satoshis sent to this peer - int64 sat_sent = 6; - - // Satoshis received from this peer - int64 sat_recv = 7; - - // A channel is inbound if the counterparty initiated the channel - bool inbound = 8; - - // Ping time to this peer - int64 ping_time = 9; - - enum SyncType { - /* - Denotes that we cannot determine the peer's current sync type. - */ - UNKNOWN_SYNC = 0; - - /* - Denotes that we are actively receiving new graph updates from the peer. - */ - ACTIVE_SYNC = 1; - - /* - Denotes that we are not receiving new graph updates from the peer. - */ - PASSIVE_SYNC = 2; - } - - // The type of sync we are currently performing with this peer. - SyncType sync_type = 10; - - // Features advertised by the remote peer in their init message. - map features = 11; - - /* - The latest errors received from our peer with timestamps, limited to the 10 - most recent errors. These errors are tracked across peer connections, but - are not persisted across lnd restarts. Note that these errors are only - stored for peers that we have channels open with, to prevent peers from - spamming us with errors at no cost. - */ - repeated TimestampedError errors = 12; -} - -message TimestampedError { - // The unix timestamp in seconds when the error occurred. - uint64 timestamp = 1; - - // The string representation of the error sent by our peer. - string error = 2; -} - -message ListPeersRequest { - /* - If true, only the last error that our peer sent us will be returned with - the peer's information, rather than the full set of historic errors we have - stored. - */ - bool latest_error = 1; -} -message ListPeersResponse { - // The list of currently connected peers - repeated Peer peers = 1; -} - -message PeerEventSubscription { -} - -message PeerEvent { - // The identity pubkey of the peer. - string pub_key = 1; - - enum EventType { - PEER_ONLINE = 0; - PEER_OFFLINE = 1; - } - - EventType type = 2; -} - -message GetInfoRequest { -} -message GetInfoResponse { - // The version of the LND software that the node is running. - string version = 14; - - // The SHA1 commit hash that the daemon is compiled with. - string commit_hash = 20; - - // The identity pubkey of the current node. - string identity_pubkey = 1; - - // If applicable, the alias of the current node, e.g. "bob" - string alias = 2; - - // The color of the current node in hex code format - string color = 17; - - // Number of pending channels - uint32 num_pending_channels = 3; - - // Number of active channels - uint32 num_active_channels = 4; - - // Number of inactive channels - uint32 num_inactive_channels = 15; - - // Number of peers - uint32 num_peers = 5; - - // The node's current view of the height of the best block - uint32 block_height = 6; - - // The node's current view of the hash of the best block - string block_hash = 8; - - // Timestamp of the block best known to the wallet - int64 best_header_timestamp = 13; - - // Whether the wallet's view is synced to the main chain - bool synced_to_chain = 9; - - // Whether we consider ourselves synced with the public channel graph. - bool synced_to_graph = 18; - - /* - Whether the current node is connected to testnet. This field is - deprecated and the network field should be used instead - **/ - bool testnet = 10 [deprecated = true]; - - reserved 11; - - // A list of active chains the node is connected to - repeated Chain chains = 16; - - // The URIs of the current node. - repeated string uris = 12; - - /* - Features that our node has advertised in our init message, node - announcements and invoices. - */ - map features = 19; -} - -message Chain { - // The blockchain the node is on (eg bitcoin, litecoin) - string chain = 1; - - // The network the node is on (eg regtest, testnet, mainnet) - string network = 2; -} - -message ConfirmationUpdate { - bytes block_sha = 1; - int32 block_height = 2; - - uint32 num_confs_left = 3; -} - -message ChannelOpenUpdate { - ChannelPoint channel_point = 1; -} - -message ChannelCloseUpdate { - bytes closing_txid = 1; - - bool success = 2; -} - -message CloseChannelRequest { - /* - The outpoint (txid:index) of the funding transaction. With this value, Bob - will be able to generate a signature for Alice's version of the commitment - transaction. - */ - ChannelPoint channel_point = 1; - - // If true, then the channel will be closed forcibly. This means the - // current commitment transaction will be signed and broadcast. - bool force = 2; - - // The target number of blocks that the closure transaction should be - // confirmed by. - int32 target_conf = 3; - - // A manual fee rate set in sat/byte that should be used when crafting the - // closure transaction. - int64 sat_per_byte = 4; - - /* - An optional address to send funds to in the case of a cooperative close. - If the channel was opened with an upfront shutdown script and this field - is set, the request to close will fail because the channel must pay out - to the upfront shutdown addresss. - */ - string delivery_address = 5; -} - -message CloseStatusUpdate { - oneof update { - PendingUpdate close_pending = 1; - ChannelCloseUpdate chan_close = 3; - } -} - -message PendingUpdate { - bytes txid = 1; - uint32 output_index = 2; -} - -message ReadyForPsbtFunding { - /* - The P2WSH address of the channel funding multisig address that the below - specified amount in satoshis needs to be sent to. - */ - string funding_address = 1; - - /* - The exact amount in satoshis that needs to be sent to the above address to - fund the pending channel. - */ - int64 funding_amount = 2; - - /* - A raw PSBT that contains the pending channel output. If a base PSBT was - provided in the PsbtShim, this is the base PSBT with one additional output. - If no base PSBT was specified, this is an otherwise empty PSBT with exactly - one output. - */ - bytes psbt = 3; -} - -message OpenChannelRequest { - /* - The pubkey of the node to open a channel with. When using REST, this field - must be encoded as base64. - */ - bytes node_pubkey = 2; - - /* - The hex encoded pubkey of the node to open a channel with. Deprecated now - that the REST gateway supports base64 encoding of bytes fields. - */ - string node_pubkey_string = 3 [deprecated = true]; - - // The number of satoshis the wallet should commit to the channel - int64 local_funding_amount = 4; - - // The number of satoshis to push to the remote side as part of the initial - // commitment state - int64 push_sat = 5; - - // The target number of blocks that the funding transaction should be - // confirmed by. - int32 target_conf = 6; - - // A manual fee rate set in sat/byte that should be used when crafting the - // funding transaction. - int64 sat_per_byte = 7; - - // Whether this channel should be private, not announced to the greater - // network. - bool private = 8; - - // The minimum value in millisatoshi we will require for incoming HTLCs on - // the channel. - int64 min_htlc_msat = 9; - - // The delay we require on the remote's commitment transaction. If this is - // not set, it will be scaled automatically with the channel size. - uint32 remote_csv_delay = 10; - - // The minimum number of confirmations each one of your outputs used for - // the funding transaction must satisfy. - int32 min_confs = 11; - - // Whether unconfirmed outputs should be used as inputs for the funding - // transaction. - bool spend_unconfirmed = 12; - - /* - Close address is an optional address which specifies the address to which - funds should be paid out to upon cooperative close. This field may only be - set if the peer supports the option upfront feature bit (call listpeers - to check). The remote peer will only accept cooperative closes to this - address if it is set. - - Note: If this value is set on channel creation, you will *not* be able to - cooperatively close out to a different address. - */ - string close_address = 13; - - /* - Funding shims are an optional argument that allow the caller to intercept - certain funding functionality. For example, a shim can be provided to use a - particular key for the commitment key (ideally cold) rather than use one - that is generated by the wallet as normal, or signal that signing will be - carried out in an interactive manner (PSBT based). - */ - FundingShim funding_shim = 14; -} -message OpenStatusUpdate { - oneof update { - /* - Signals that the channel is now fully negotiated and the funding - transaction published. - */ - PendingUpdate chan_pending = 1; - - /* - Signals that the channel's funding transaction has now reached the - required number of confirmations on chain and can be used. - */ - ChannelOpenUpdate chan_open = 3; - - /* - Signals that the funding process has been suspended and the construction - of a PSBT that funds the channel PK script is now required. - */ - ReadyForPsbtFunding psbt_fund = 5; - } - - /* - The pending channel ID of the created channel. This value may be used to - further the funding flow manually via the FundingStateStep method. - */ - bytes pending_chan_id = 4; -} - -message KeyLocator { - // The family of key being identified. - int32 key_family = 1; - - // The precise index of the key being identified. - int32 key_index = 2; -} - -message KeyDescriptor { - /* - The raw bytes of the key being identified. - */ - bytes raw_key_bytes = 1; - - /* - The key locator that identifies which key to use for signing. - */ - KeyLocator key_loc = 2; -} - -message ChanPointShim { - /* - The size of the pre-crafted output to be used as the channel point for this - channel funding. - */ - int64 amt = 1; - - // The target channel point to refrence in created commitment transactions. - ChannelPoint chan_point = 2; - - // Our local key to use when creating the multi-sig output. - KeyDescriptor local_key = 3; - - // The key of the remote party to use when creating the multi-sig output. - bytes remote_key = 4; - - /* - If non-zero, then this will be used as the pending channel ID on the wire - protocol to initate the funding request. This is an optional field, and - should only be set if the responder is already expecting a specific pending - channel ID. - */ - bytes pending_chan_id = 5; - - /* - This uint32 indicates if this channel is to be considered 'frozen'. A - frozen channel does not allow a cooperative channel close by the - initiator. The thaw_height is the height that this restriction stops - applying to the channel. - */ - uint32 thaw_height = 6; -} - -message PsbtShim { - /* - A unique identifier of 32 random bytes that will be used as the pending - channel ID to identify the PSBT state machine when interacting with it and - on the wire protocol to initiate the funding request. - */ - bytes pending_chan_id = 1; - - /* - An optional base PSBT the new channel output will be added to. If this is - non-empty, it must be a binary serialized PSBT. - */ - bytes base_psbt = 2; -} - -message FundingShim { - oneof shim { - /* - A channel shim where the channel point was fully constructed outside - of lnd's wallet and the transaction might already be published. - */ - ChanPointShim chan_point_shim = 1; - - /* - A channel shim that uses a PSBT to fund and sign the channel funding - transaction. - */ - PsbtShim psbt_shim = 2; - } -} - -message FundingShimCancel { - // The pending channel ID of the channel to cancel the funding shim for. - bytes pending_chan_id = 1; -} - -message FundingPsbtVerify { - /* - The funded but not yet signed PSBT that sends the exact channel capacity - amount to the PK script returned in the open channel message in a previous - step. - */ - bytes funded_psbt = 1; - - // The pending channel ID of the channel to get the PSBT for. - bytes pending_chan_id = 2; -} - -message FundingPsbtFinalize { - /* - The funded PSBT that contains all witness data to send the exact channel - capacity amount to the PK script returned in the open channel message in a - previous step. - */ - bytes signed_psbt = 1; - - // The pending channel ID of the channel to get the PSBT for. - bytes pending_chan_id = 2; -} - -message FundingTransitionMsg { - oneof trigger { - /* - The funding shim to register. This should be used before any - channel funding has began by the remote party, as it is intended as a - preparatory step for the full channel funding. - */ - FundingShim shim_register = 1; - - // Used to cancel an existing registered funding shim. - FundingShimCancel shim_cancel = 2; - - /* - Used to continue a funding flow that was initiated to be executed - through a PSBT. This step verifies that the PSBT contains the correct - outputs to fund the channel. - */ - FundingPsbtVerify psbt_verify = 3; - - /* - Used to continue a funding flow that was initiated to be executed - through a PSBT. This step finalizes the funded and signed PSBT, finishes - negotiation with the peer and finally publishes the resulting funding - transaction. - */ - FundingPsbtFinalize psbt_finalize = 4; - } -} - -message FundingStateStepResp { -} - -message PendingHTLC { - // The direction within the channel that the htlc was sent - bool incoming = 1; - - // The total value of the htlc - int64 amount = 2; - - // The final output to be swept back to the user's wallet - string outpoint = 3; - - // The next block height at which we can spend the current stage - uint32 maturity_height = 4; - - /* - The number of blocks remaining until the current stage can be swept. - Negative values indicate how many blocks have passed since becoming - mature. - */ - int32 blocks_til_maturity = 5; - - // Indicates whether the htlc is in its first or second stage of recovery - uint32 stage = 6; -} - -message PendingChannelsRequest { -} -message PendingChannelsResponse { - message PendingChannel { - string remote_node_pub = 1; - string channel_point = 2; - - int64 capacity = 3; - - int64 local_balance = 4; - int64 remote_balance = 5; - - // The minimum satoshis this node is required to reserve in its - // balance. - int64 local_chan_reserve_sat = 6; - - /* - The minimum satoshis the other node is required to reserve in its - balance. - */ - int64 remote_chan_reserve_sat = 7; - - // The party that initiated opening the channel. - Initiator initiator = 8; - - // The commitment type used by this channel. - CommitmentType commitment_type = 9; - } - - message PendingOpenChannel { - // The pending channel - PendingChannel channel = 1; - - // The height at which this channel will be confirmed - uint32 confirmation_height = 2; - - /* - The amount calculated to be paid in fees for the current set of - commitment transactions. The fee amount is persisted with the channel - in order to allow the fee amount to be removed and recalculated with - each channel state update, including updates that happen after a system - restart. - */ - int64 commit_fee = 4; - - // The weight of the commitment transaction - int64 commit_weight = 5; - - /* - The required number of satoshis per kilo-weight that the requester will - pay at all times, for both the funding transaction and commitment - transaction. This value can later be updated once the channel is open. - */ - int64 fee_per_kw = 6; - } - - message WaitingCloseChannel { - // The pending channel waiting for closing tx to confirm - PendingChannel channel = 1; - - // The balance in satoshis encumbered in this channel - int64 limbo_balance = 2; - - /* - A list of valid commitment transactions. Any of these can confirm at - this point. - */ - Commitments commitments = 3; - } - - message Commitments { - // Hash of the local version of the commitment tx. - string local_txid = 1; - - // Hash of the remote version of the commitment tx. - string remote_txid = 2; - - // Hash of the remote pending version of the commitment tx. - string remote_pending_txid = 3; - - /* - The amount in satoshis calculated to be paid in fees for the local - commitment. - */ - uint64 local_commit_fee_sat = 4; - - /* - The amount in satoshis calculated to be paid in fees for the remote - commitment. - */ - uint64 remote_commit_fee_sat = 5; - - /* - The amount in satoshis calculated to be paid in fees for the remote - pending commitment. - */ - uint64 remote_pending_commit_fee_sat = 6; - } - - message ClosedChannel { - // The pending channel to be closed - PendingChannel channel = 1; - - // The transaction id of the closing transaction - string closing_txid = 2; - } - - message ForceClosedChannel { - // The pending channel to be force closed - PendingChannel channel = 1; - - // The transaction id of the closing transaction - string closing_txid = 2; - - // The balance in satoshis encumbered in this pending channel - int64 limbo_balance = 3; - - // The height at which funds can be swept into the wallet - uint32 maturity_height = 4; - - /* - Remaining # of blocks until the commitment output can be swept. - Negative values indicate how many blocks have passed since becoming - mature. - */ - int32 blocks_til_maturity = 5; - - // The total value of funds successfully recovered from this channel - int64 recovered_balance = 6; - - repeated PendingHTLC pending_htlcs = 8; - - enum AnchorState { - LIMBO = 0; - RECOVERED = 1; - LOST = 2; - } - - AnchorState anchor = 9; - } - - // The balance in satoshis encumbered in pending channels - int64 total_limbo_balance = 1; - - // Channels pending opening - repeated PendingOpenChannel pending_open_channels = 2; - - /* - Deprecated: Channels pending closing previously contained cooperatively - closed channels with a single confirmation. These channels are now - considered closed from the time we see them on chain. - */ - repeated ClosedChannel pending_closing_channels = 3 [deprecated = true]; - - // Channels pending force closing - repeated ForceClosedChannel pending_force_closing_channels = 4; - - // Channels waiting for closing tx to confirm - repeated WaitingCloseChannel waiting_close_channels = 5; -} - -message ChannelEventSubscription { -} - -message ChannelEventUpdate { - oneof channel { - Channel open_channel = 1; - ChannelCloseSummary closed_channel = 2; - ChannelPoint active_channel = 3; - ChannelPoint inactive_channel = 4; - PendingUpdate pending_open_channel = 6; - } - - enum UpdateType { - OPEN_CHANNEL = 0; - CLOSED_CHANNEL = 1; - ACTIVE_CHANNEL = 2; - INACTIVE_CHANNEL = 3; - PENDING_OPEN_CHANNEL = 4; - } - - UpdateType type = 5; -} - -message WalletBalanceRequest { -} -message WalletBalanceResponse { - // The balance of the wallet - int64 total_balance = 1; - - // The confirmed balance of a wallet(with >= 1 confirmations) - int64 confirmed_balance = 2; - - // The unconfirmed balance of a wallet(with 0 confirmations) - int64 unconfirmed_balance = 3; -} - -message ChannelBalanceRequest { -} -message ChannelBalanceResponse { - // Sum of channels balances denominated in satoshis - int64 balance = 1; - - // Sum of channels pending balances denominated in satoshis - int64 pending_open_balance = 2; -} - -message QueryRoutesRequest { - // The 33-byte hex-encoded public key for the payment destination - string pub_key = 1; - - /* - The amount to send expressed in satoshis. - - The fields amt and amt_msat are mutually exclusive. - */ - int64 amt = 2; - - /* - The amount to send expressed in millisatoshis. - - The fields amt and amt_msat are mutually exclusive. - */ - int64 amt_msat = 12; - - reserved 3; - - /* - An optional CLTV delta from the current height that should be used for the - timelock of the final hop. Note that unlike SendPayment, QueryRoutes does - not add any additional block padding on top of final_ctlv_delta. This - padding of a few blocks needs to be added manually or otherwise failures may - happen when a block comes in while the payment is in flight. - */ - int32 final_cltv_delta = 4; - - /* - The maximum number of satoshis that will be paid as a fee of the payment. - This value can be represented either as a percentage of the amount being - sent, or as a fixed amount of the maximum fee the user is willing the pay to - send the payment. - */ - FeeLimit fee_limit = 5; - - /* - A list of nodes to ignore during path finding. When using REST, these fields - must be encoded as base64. - */ - repeated bytes ignored_nodes = 6; - - /* - Deprecated. A list of edges to ignore during path finding. - */ - repeated EdgeLocator ignored_edges = 7 [deprecated = true]; - - /* - The source node where the request route should originated from. If empty, - self is assumed. - */ - string source_pub_key = 8; - - /* - If set to true, edge probabilities from mission control will be used to get - the optimal route. - */ - bool use_mission_control = 9; - - /* - A list of directed node pairs that will be ignored during path finding. - */ - repeated NodePair ignored_pairs = 10; - - /* - An optional maximum total time lock for the route. If the source is empty or - ourselves, this should not exceed lnd's `--max-cltv-expiry` setting. If - zero, then the value of `--max-cltv-expiry` is used as the limit. - */ - uint32 cltv_limit = 11; - - /* - An optional field that can be used to pass an arbitrary set of TLV records - to a peer which understands the new records. This can be used to pass - application specific data during the payment attempt. If the destination - does not support the specified recrods, and error will be returned. - Record types are required to be in the custom range >= 65536. When using - REST, the values must be encoded as base64. - */ - map dest_custom_records = 13; - - /* - The channel id of the channel that must be taken to the first hop. If zero, - any channel may be used. - */ - uint64 outgoing_chan_id = 14 [jstype = JS_STRING]; - - /* - The pubkey of the last hop of the route. If empty, any hop may be used. - */ - bytes last_hop_pubkey = 15; - - /* - Optional route hints to reach the destination through private channels. - */ - repeated lnrpc.RouteHint route_hints = 16; - - /* - Features assumed to be supported by the final node. All transitive feature - dependencies must also be set properly. For a given feature bit pair, either - optional or remote may be set, but not both. If this field is nil or empty, - the router will try to load destination features from the graph as a - fallback. - */ - repeated lnrpc.FeatureBit dest_features = 17; -} - -message NodePair { - /* - The sending node of the pair. When using REST, this field must be encoded as - base64. - */ - bytes from = 1; - - /* - The receiving node of the pair. When using REST, this field must be encoded - as base64. - */ - bytes to = 2; -} - -message EdgeLocator { - // The short channel id of this edge. - uint64 channel_id = 1 [jstype = JS_STRING]; - - /* - The direction of this edge. If direction_reverse is false, the direction - of this edge is from the channel endpoint with the lexicographically smaller - pub key to the endpoint with the larger pub key. If direction_reverse is - is true, the edge goes the other way. - */ - bool direction_reverse = 2; -} - -message QueryRoutesResponse { - /* - The route that results from the path finding operation. This is still a - repeated field to retain backwards compatibility. - */ - repeated Route routes = 1; - - /* - The success probability of the returned route based on the current mission - control state. [EXPERIMENTAL] - */ - double success_prob = 2; -} - -message Hop { - /* - The unique channel ID for the channel. The first 3 bytes are the block - height, the next 3 the index within the block, and the last 2 bytes are the - output index for the channel. - */ - uint64 chan_id = 1 [jstype = JS_STRING]; - int64 chan_capacity = 2; - int64 amt_to_forward = 3 [deprecated = true]; - int64 fee = 4 [deprecated = true]; - uint32 expiry = 5; - int64 amt_to_forward_msat = 6; - int64 fee_msat = 7; - - /* - An optional public key of the hop. If the public key is given, the payment - can be executed without relying on a copy of the channel graph. - */ - string pub_key = 8; - - /* - If set to true, then this hop will be encoded using the new variable length - TLV format. Note that if any custom tlv_records below are specified, then - this field MUST be set to true for them to be encoded properly. - */ - bool tlv_payload = 9; - - /* - An optional TLV record that signals the use of an MPP payment. If present, - the receiver will enforce that that the same mpp_record is included in the - final hop payload of all non-zero payments in the HTLC set. If empty, a - regular single-shot payment is or was attempted. - */ - MPPRecord mpp_record = 10; - - /* - An optional set of key-value TLV records. This is useful within the context - of the SendToRoute call as it allows callers to specify arbitrary K-V pairs - to drop off at each hop within the onion. - */ - map custom_records = 11; -} - -message MPPRecord { - /* - A unique, random identifier used to authenticate the sender as the intended - payer of a multi-path payment. The payment_addr must be the same for all - subpayments, and match the payment_addr provided in the receiver's invoice. - The same payment_addr must be used on all subpayments. - */ - bytes payment_addr = 11; - - /* - The total amount in milli-satoshis being sent as part of a larger multi-path - payment. The caller is responsible for ensuring subpayments to the same node - and payment_hash sum exactly to total_amt_msat. The same - total_amt_msat must be used on all subpayments. - */ - int64 total_amt_msat = 10; -} - -/* -A path through the channel graph which runs over one or more channels in -succession. This struct carries all the information required to craft the -Sphinx onion packet, and send the payment along the first hop in the path. A -route is only selected as valid if all the channels have sufficient capacity to -carry the initial payment amount after fees are accounted for. -*/ -message Route { - /* - The cumulative (final) time lock across the entire route. This is the CLTV - value that should be extended to the first hop in the route. All other hops - will decrement the time-lock as advertised, leaving enough time for all - hops to wait for or present the payment preimage to complete the payment. - */ - uint32 total_time_lock = 1; - - /* - The sum of the fees paid at each hop within the final route. In the case - of a one-hop payment, this value will be zero as we don't need to pay a fee - to ourselves. - */ - int64 total_fees = 2 [deprecated = true]; - - /* - The total amount of funds required to complete a payment over this route. - This value includes the cumulative fees at each hop. As a result, the HTLC - extended to the first-hop in the route will need to have at least this many - satoshis, otherwise the route will fail at an intermediate node due to an - insufficient amount of fees. - */ - int64 total_amt = 3 [deprecated = true]; - - /* - Contains details concerning the specific forwarding details at each hop. - */ - repeated Hop hops = 4; - - /* - The total fees in millisatoshis. - */ - int64 total_fees_msat = 5; - - /* - The total amount in millisatoshis. - */ - int64 total_amt_msat = 6; -} - -message NodeInfoRequest { - // The 33-byte hex-encoded compressed public of the target node - string pub_key = 1; - - // If true, will include all known channels associated with the node. - bool include_channels = 2; -} - -message NodeInfo { - /* - An individual vertex/node within the channel graph. A node is - connected to other nodes by one or more channel edges emanating from it. As - the graph is directed, a node will also have an incoming edge attached to - it for each outgoing edge. - */ - LightningNode node = 1; - - // The total number of channels for the node. - uint32 num_channels = 2; - - // The sum of all channels capacity for the node, denominated in satoshis. - int64 total_capacity = 3; - - // A list of all public channels for the node. - repeated ChannelEdge channels = 4; -} - -/* -An individual vertex/node within the channel graph. A node is -connected to other nodes by one or more channel edges emanating from it. As the -graph is directed, a node will also have an incoming edge attached to it for -each outgoing edge. -*/ -message LightningNode { - uint32 last_update = 1; - string pub_key = 2; - string alias = 3; - repeated NodeAddress addresses = 4; - string color = 5; - map features = 6; -} - -message NodeAddress { - string network = 1; - string addr = 2; -} - -message RoutingPolicy { - uint32 time_lock_delta = 1; - int64 min_htlc = 2; - int64 fee_base_msat = 3; - int64 fee_rate_milli_msat = 4; - bool disabled = 5; - uint64 max_htlc_msat = 6; - uint32 last_update = 7; -} - -/* -A fully authenticated channel along with all its unique attributes. -Once an authenticated channel announcement has been processed on the network, -then an instance of ChannelEdgeInfo encapsulating the channels attributes is -stored. The other portions relevant to routing policy of a channel are stored -within a ChannelEdgePolicy for each direction of the channel. -*/ -message ChannelEdge { - /* - The unique channel ID for the channel. The first 3 bytes are the block - height, the next 3 the index within the block, and the last 2 bytes are the - output index for the channel. - */ - uint64 channel_id = 1 [jstype = JS_STRING]; - string chan_point = 2; - - uint32 last_update = 3 [deprecated = true]; - - string node1_pub = 4; - string node2_pub = 5; - - int64 capacity = 6; - - RoutingPolicy node1_policy = 7; - RoutingPolicy node2_policy = 8; -} - -message ChannelGraphRequest { - /* - Whether unannounced channels are included in the response or not. If set, - unannounced channels are included. Unannounced channels are both private - channels, and public channels that are not yet announced to the network. - */ - bool include_unannounced = 1; -} - -// Returns a new instance of the directed channel graph. -message ChannelGraph { - // The list of `LightningNode`s in this channel graph - repeated LightningNode nodes = 1; - - // The list of `ChannelEdge`s in this channel graph - repeated ChannelEdge edges = 2; -} - -enum NodeMetricType { - UNKNOWN = 0; - BETWEENNESS_CENTRALITY = 1; -} - -message NodeMetricsRequest { - // The requested node metrics. - repeated NodeMetricType types = 1; -} - -message NodeMetricsResponse { - /* - Betweenness centrality is the sum of the ratio of shortest paths that pass - through the node for each pair of nodes in the graph (not counting paths - starting or ending at this node). - Map of node pubkey to betweenness centrality of the node. Normalized - values are in the [0,1] closed interval. - */ - map betweenness_centrality = 1; -} - -message FloatMetric { - // Arbitrary float value. - double value = 1; - - // The value normalized to [0,1] or [-1,1]. - double normalized_value = 2; -} - -message ChanInfoRequest { - /* - The unique channel ID for the channel. The first 3 bytes are the block - height, the next 3 the index within the block, and the last 2 bytes are the - output index for the channel. - */ - uint64 chan_id = 1 [jstype = JS_STRING]; -} - -message NetworkInfoRequest { -} -message NetworkInfo { - uint32 graph_diameter = 1; - double avg_out_degree = 2; - uint32 max_out_degree = 3; - - uint32 num_nodes = 4; - uint32 num_channels = 5; - - int64 total_network_capacity = 6; - - double avg_channel_size = 7; - int64 min_channel_size = 8; - int64 max_channel_size = 9; - int64 median_channel_size_sat = 10; - - // The number of edges marked as zombies. - uint64 num_zombie_chans = 11; - - // TODO(roasbeef): fee rate info, expiry - // * also additional RPC for tracking fee info once in -} - -message StopRequest { -} -message StopResponse { -} - -message GraphTopologySubscription { -} -message GraphTopologyUpdate { - repeated NodeUpdate node_updates = 1; - repeated ChannelEdgeUpdate channel_updates = 2; - repeated ClosedChannelUpdate closed_chans = 3; -} -message NodeUpdate { - repeated string addresses = 1; - string identity_key = 2; - bytes global_features = 3; - string alias = 4; - string color = 5; -} -message ChannelEdgeUpdate { - /* - The unique channel ID for the channel. The first 3 bytes are the block - height, the next 3 the index within the block, and the last 2 bytes are the - output index for the channel. - */ - uint64 chan_id = 1 [jstype = JS_STRING]; - - ChannelPoint chan_point = 2; - - int64 capacity = 3; - - RoutingPolicy routing_policy = 4; - - string advertising_node = 5; - string connecting_node = 6; -} -message ClosedChannelUpdate { - /* - The unique channel ID for the channel. The first 3 bytes are the block - height, the next 3 the index within the block, and the last 2 bytes are the - output index for the channel. - */ - uint64 chan_id = 1 [jstype = JS_STRING]; - int64 capacity = 2; - uint32 closed_height = 3; - ChannelPoint chan_point = 4; -} - -message HopHint { - // The public key of the node at the start of the channel. - string node_id = 1; - - // The unique identifier of the channel. - uint64 chan_id = 2 [jstype = JS_STRING]; - - // The base fee of the channel denominated in millisatoshis. - uint32 fee_base_msat = 3; - - /* - The fee rate of the channel for sending one satoshi across it denominated in - millionths of a satoshi. - */ - uint32 fee_proportional_millionths = 4; - - // The time-lock delta of the channel. - uint32 cltv_expiry_delta = 5; -} - -message RouteHint { - /* - A list of hop hints that when chained together can assist in reaching a - specific destination. - */ - repeated HopHint hop_hints = 1; -} - -message Invoice { - /* - An optional memo to attach along with the invoice. Used for record keeping - purposes for the invoice's creator, and will also be set in the description - field of the encoded payment request if the description_hash field is not - being used. - */ - string memo = 1; - - reserved 2; - - /* - The hex-encoded preimage (32 byte) which will allow settling an incoming - HTLC payable to this preimage. When using REST, this field must be encoded - as base64. - */ - bytes r_preimage = 3; - - /* - The hash of the preimage. When using REST, this field must be encoded as - base64. - */ - bytes r_hash = 4; - - /* - The value of this invoice in satoshis - - The fields value and value_msat are mutually exclusive. - */ - int64 value = 5; - - /* - The value of this invoice in millisatoshis - - The fields value and value_msat are mutually exclusive. - */ - int64 value_msat = 23; - - // Whether this invoice has been fulfilled - bool settled = 6 [deprecated = true]; - - // When this invoice was created - int64 creation_date = 7; - - // When this invoice was settled - int64 settle_date = 8; - - /* - A bare-bones invoice for a payment within the Lightning Network. With the - details of the invoice, the sender has all the data necessary to send a - payment to the recipient. - */ - string payment_request = 9; - - /* - Hash (SHA-256) of a description of the payment. Used if the description of - payment (memo) is too long to naturally fit within the description field - of an encoded payment request. When using REST, this field must be encoded - as base64. - */ - bytes description_hash = 10; - - // Payment request expiry time in seconds. Default is 3600 (1 hour). - int64 expiry = 11; - - // Fallback on-chain address. - string fallback_addr = 12; - - // Delta to use for the time-lock of the CLTV extended to the final hop. - uint64 cltv_expiry = 13; - - /* - Route hints that can each be individually used to assist in reaching the - invoice's destination. - */ - repeated RouteHint route_hints = 14; - - // Whether this invoice should include routing hints for private channels. - bool private = 15; - - /* - The "add" index of this invoice. Each newly created invoice will increment - this index making it monotonically increasing. Callers to the - SubscribeInvoices call can use this to instantly get notified of all added - invoices with an add_index greater than this one. - */ - uint64 add_index = 16; - - /* - The "settle" index of this invoice. Each newly settled invoice will - increment this index making it monotonically increasing. Callers to the - SubscribeInvoices call can use this to instantly get notified of all - settled invoices with an settle_index greater than this one. - */ - uint64 settle_index = 17; - - // Deprecated, use amt_paid_sat or amt_paid_msat. - int64 amt_paid = 18 [deprecated = true]; - - /* - The amount that was accepted for this invoice, in satoshis. This will ONLY - be set if this invoice has been settled. We provide this field as if the - invoice was created with a zero value, then we need to record what amount - was ultimately accepted. Additionally, it's possible that the sender paid - MORE that was specified in the original invoice. So we'll record that here - as well. - */ - int64 amt_paid_sat = 19; - - /* - The amount that was accepted for this invoice, in millisatoshis. This will - ONLY be set if this invoice has been settled. We provide this field as if - the invoice was created with a zero value, then we need to record what - amount was ultimately accepted. Additionally, it's possible that the sender - paid MORE that was specified in the original invoice. So we'll record that - here as well. - */ - int64 amt_paid_msat = 20; - - enum InvoiceState { - OPEN = 0; - SETTLED = 1; - CANCELED = 2; - ACCEPTED = 3; - } - - /* - The state the invoice is in. - */ - InvoiceState state = 21; - - // List of HTLCs paying to this invoice [EXPERIMENTAL]. - repeated InvoiceHTLC htlcs = 22; - - // List of features advertised on the invoice. - map features = 24; - - /* - Indicates if this invoice was a spontaneous payment that arrived via keysend - [EXPERIMENTAL]. - */ - bool is_keysend = 25; -} - -enum InvoiceHTLCState { - ACCEPTED = 0; - SETTLED = 1; - CANCELED = 2; -} - -// Details of an HTLC that paid to an invoice -message InvoiceHTLC { - // Short channel id over which the htlc was received. - uint64 chan_id = 1 [jstype = JS_STRING]; - - // Index identifying the htlc on the channel. - uint64 htlc_index = 2; - - // The amount of the htlc in msat. - uint64 amt_msat = 3; - - // Block height at which this htlc was accepted. - int32 accept_height = 4; - - // Time at which this htlc was accepted. - int64 accept_time = 5; - - // Time at which this htlc was settled or canceled. - int64 resolve_time = 6; - - // Block height at which this htlc expires. - int32 expiry_height = 7; - - // Current state the htlc is in. - InvoiceHTLCState state = 8; - - // Custom tlv records. - map custom_records = 9; - - // The total amount of the mpp payment in msat. - uint64 mpp_total_amt_msat = 10; -} - -message AddInvoiceResponse { - bytes r_hash = 1; - - /* - A bare-bones invoice for a payment within the Lightning Network. With the - details of the invoice, the sender has all the data necessary to send a - payment to the recipient. - */ - string payment_request = 2; - - /* - The "add" index of this invoice. Each newly created invoice will increment - this index making it monotonically increasing. Callers to the - SubscribeInvoices call can use this to instantly get notified of all added - invoices with an add_index greater than this one. - */ - uint64 add_index = 16; -} -message PaymentHash { - /* - The hex-encoded payment hash of the invoice to be looked up. The passed - payment hash must be exactly 32 bytes, otherwise an error is returned. - Deprecated now that the REST gateway supports base64 encoding of bytes - fields. - */ - string r_hash_str = 1 [deprecated = true]; - - /* - The payment hash of the invoice to be looked up. When using REST, this field - must be encoded as base64. - */ - bytes r_hash = 2; -} - -message ListInvoiceRequest { - /* - If set, only invoices that are not settled and not canceled will be returned - in the response. - */ - bool pending_only = 1; - - /* - The index of an invoice that will be used as either the start or end of a - query to determine which invoices should be returned in the response. - */ - uint64 index_offset = 4; - - // The max number of invoices to return in the response to this query. - uint64 num_max_invoices = 5; - - /* - If set, the invoices returned will result from seeking backwards from the - specified index offset. This can be used to paginate backwards. - */ - bool reversed = 6; -} -message ListInvoiceResponse { - /* - A list of invoices from the time slice of the time series specified in the - request. - */ - repeated Invoice invoices = 1; - - /* - The index of the last item in the set of returned invoices. This can be used - to seek further, pagination style. - */ - uint64 last_index_offset = 2; - - /* - The index of the last item in the set of returned invoices. This can be used - to seek backwards, pagination style. - */ - uint64 first_index_offset = 3; -} - -message InvoiceSubscription { - /* - If specified (non-zero), then we'll first start by sending out - notifications for all added indexes with an add_index greater than this - value. This allows callers to catch up on any events they missed while they - weren't connected to the streaming RPC. - */ - uint64 add_index = 1; - - /* - If specified (non-zero), then we'll first start by sending out - notifications for all settled indexes with an settle_index greater than - this value. This allows callers to catch up on any events they missed while - they weren't connected to the streaming RPC. - */ - uint64 settle_index = 2; -} - -enum PaymentFailureReason { - /* - Payment isn't failed (yet). - */ - FAILURE_REASON_NONE = 0; - - /* - There are more routes to try, but the payment timeout was exceeded. - */ - FAILURE_REASON_TIMEOUT = 1; - - /* - All possible routes were tried and failed permanently. Or were no - routes to the destination at all. - */ - FAILURE_REASON_NO_ROUTE = 2; - - /* - A non-recoverable error has occured. - */ - FAILURE_REASON_ERROR = 3; - - /* - Payment details incorrect (unknown hash, invalid amt or - invalid final cltv delta) - */ - FAILURE_REASON_INCORRECT_PAYMENT_DETAILS = 4; - - /* - Insufficient local balance. - */ - FAILURE_REASON_INSUFFICIENT_BALANCE = 5; -} - -message Payment { - // The payment hash - string payment_hash = 1; - - // Deprecated, use value_sat or value_msat. - int64 value = 2 [deprecated = true]; - - // Deprecated, use creation_time_ns - int64 creation_date = 3 [deprecated = true]; - - reserved 4; - - // Deprecated, use fee_sat or fee_msat. - int64 fee = 5 [deprecated = true]; - - // The payment preimage - string payment_preimage = 6; - - // The value of the payment in satoshis - int64 value_sat = 7; - - // The value of the payment in milli-satoshis - int64 value_msat = 8; - - // The optional payment request being fulfilled. - string payment_request = 9; - - enum PaymentStatus { - UNKNOWN = 0; - IN_FLIGHT = 1; - SUCCEEDED = 2; - FAILED = 3; - } - - // The status of the payment. - PaymentStatus status = 10; - - // The fee paid for this payment in satoshis - int64 fee_sat = 11; - - // The fee paid for this payment in milli-satoshis - int64 fee_msat = 12; - - // The time in UNIX nanoseconds at which the payment was created. - int64 creation_time_ns = 13; - - // The HTLCs made in attempt to settle the payment. - repeated HTLCAttempt htlcs = 14; - - /* - The creation index of this payment. Each payment can be uniquely identified - by this index, which may not strictly increment by 1 for payments made in - older versions of lnd. - */ - uint64 payment_index = 15; - - PaymentFailureReason failure_reason = 16; -} - -message HTLCAttempt { - enum HTLCStatus { - IN_FLIGHT = 0; - SUCCEEDED = 1; - FAILED = 2; - } - - // The status of the HTLC. - HTLCStatus status = 1; - - // The route taken by this HTLC. - Route route = 2; - - // The time in UNIX nanoseconds at which this HTLC was sent. - int64 attempt_time_ns = 3; - - /* - The time in UNIX nanoseconds at which this HTLC was settled or failed. - This value will not be set if the HTLC is still IN_FLIGHT. - */ - int64 resolve_time_ns = 4; - - // Detailed htlc failure info. - Failure failure = 5; - - // The preimage that was used to settle the HTLC. - bytes preimage = 6; -} - -message ListPaymentsRequest { - /* - If true, then return payments that have not yet fully completed. This means - that pending payments, as well as failed payments will show up if this - field is set to true. This flag doesn't change the meaning of the indices, - which are tied to individual payments. - */ - bool include_incomplete = 1; - - /* - The index of a payment that will be used as either the start or end of a - query to determine which payments should be returned in the response. The - index_offset is exclusive. In the case of a zero index_offset, the query - will start with the oldest payment when paginating forwards, or will end - with the most recent payment when paginating backwards. - */ - uint64 index_offset = 2; - - // The maximal number of payments returned in the response to this query. - uint64 max_payments = 3; - - /* - If set, the payments returned will result from seeking backwards from the - specified index offset. This can be used to paginate backwards. The order - of the returned payments is always oldest first (ascending index order). - */ - bool reversed = 4; -} - -message ListPaymentsResponse { - // The list of payments - repeated Payment payments = 1; - - /* - The index of the first item in the set of returned payments. This can be - used as the index_offset to continue seeking backwards in the next request. - */ - uint64 first_index_offset = 2; - - /* - The index of the last item in the set of returned payments. This can be used - as the index_offset to continue seeking forwards in the next request. - */ - uint64 last_index_offset = 3; -} - -message DeleteAllPaymentsRequest { -} - -message DeleteAllPaymentsResponse { -} - -message AbandonChannelRequest { - ChannelPoint channel_point = 1; -} - -message AbandonChannelResponse { -} - -message DebugLevelRequest { - bool show = 1; - string level_spec = 2; -} -message DebugLevelResponse { - string sub_systems = 1; -} - -message PayReqString { - // The payment request string to be decoded - string pay_req = 1; -} -message PayReq { - string destination = 1; - string payment_hash = 2; - int64 num_satoshis = 3; - int64 timestamp = 4; - int64 expiry = 5; - string description = 6; - string description_hash = 7; - string fallback_addr = 8; - int64 cltv_expiry = 9; - repeated RouteHint route_hints = 10; - bytes payment_addr = 11; - int64 num_msat = 12; - map features = 13; -} - -enum FeatureBit { - DATALOSS_PROTECT_REQ = 0; - DATALOSS_PROTECT_OPT = 1; - INITIAL_ROUING_SYNC = 3; - UPFRONT_SHUTDOWN_SCRIPT_REQ = 4; - UPFRONT_SHUTDOWN_SCRIPT_OPT = 5; - GOSSIP_QUERIES_REQ = 6; - GOSSIP_QUERIES_OPT = 7; - TLV_ONION_REQ = 8; - TLV_ONION_OPT = 9; - EXT_GOSSIP_QUERIES_REQ = 10; - EXT_GOSSIP_QUERIES_OPT = 11; - STATIC_REMOTE_KEY_REQ = 12; - STATIC_REMOTE_KEY_OPT = 13; - PAYMENT_ADDR_REQ = 14; - PAYMENT_ADDR_OPT = 15; - MPP_REQ = 16; - MPP_OPT = 17; -} - -message Feature { - string name = 2; - bool is_required = 3; - bool is_known = 4; -} - -message FeeReportRequest { -} -message ChannelFeeReport { - // The short channel id that this fee report belongs to. - uint64 chan_id = 5 [jstype = JS_STRING]; - - // The channel that this fee report belongs to. - string channel_point = 1; - - // The base fee charged regardless of the number of milli-satoshis sent. - int64 base_fee_msat = 2; - - // The amount charged per milli-satoshis transferred expressed in - // millionths of a satoshi. - int64 fee_per_mil = 3; - - // The effective fee rate in milli-satoshis. Computed by dividing the - // fee_per_mil value by 1 million. - double fee_rate = 4; -} -message FeeReportResponse { - // An array of channel fee reports which describes the current fee schedule - // for each channel. - repeated ChannelFeeReport channel_fees = 1; - - // The total amount of fee revenue (in satoshis) the switch has collected - // over the past 24 hrs. - uint64 day_fee_sum = 2; - - // The total amount of fee revenue (in satoshis) the switch has collected - // over the past 1 week. - uint64 week_fee_sum = 3; - - // The total amount of fee revenue (in satoshis) the switch has collected - // over the past 1 month. - uint64 month_fee_sum = 4; -} - -message PolicyUpdateRequest { - oneof scope { - // If set, then this update applies to all currently active channels. - bool global = 1; - - // If set, this update will target a specific channel. - ChannelPoint chan_point = 2; - } - - // The base fee charged regardless of the number of milli-satoshis sent. - int64 base_fee_msat = 3; - - // The effective fee rate in milli-satoshis. The precision of this value - // goes up to 6 decimal places, so 1e-6. - double fee_rate = 4; - - // The required timelock delta for HTLCs forwarded over the channel. - uint32 time_lock_delta = 5; - - // If set, the maximum HTLC size in milli-satoshis. If unset, the maximum - // HTLC will be unchanged. - uint64 max_htlc_msat = 6; - - // The minimum HTLC size in milli-satoshis. Only applied if - // min_htlc_msat_specified is true. - uint64 min_htlc_msat = 7; - - // If true, min_htlc_msat is applied. - bool min_htlc_msat_specified = 8; -} -message PolicyUpdateResponse { -} - -message ForwardingHistoryRequest { - // Start time is the starting point of the forwarding history request. All - // records beyond this point will be included, respecting the end time, and - // the index offset. - uint64 start_time = 1; - - // End time is the end point of the forwarding history request. The - // response will carry at most 50k records between the start time and the - // end time. The index offset can be used to implement pagination. - uint64 end_time = 2; - - // Index offset is the offset in the time series to start at. As each - // response can only contain 50k records, callers can use this to skip - // around within a packed time series. - uint32 index_offset = 3; - - // The max number of events to return in the response to this query. - uint32 num_max_events = 4; -} -message ForwardingEvent { - // Timestamp is the time (unix epoch offset) that this circuit was - // completed. - uint64 timestamp = 1; - - // The incoming channel ID that carried the HTLC that created the circuit. - uint64 chan_id_in = 2 [jstype = JS_STRING]; - - // The outgoing channel ID that carried the preimage that completed the - // circuit. - uint64 chan_id_out = 4 [jstype = JS_STRING]; - - // The total amount (in satoshis) of the incoming HTLC that created half - // the circuit. - uint64 amt_in = 5; - - // The total amount (in satoshis) of the outgoing HTLC that created the - // second half of the circuit. - uint64 amt_out = 6; - - // The total fee (in satoshis) that this payment circuit carried. - uint64 fee = 7; - - // The total fee (in milli-satoshis) that this payment circuit carried. - uint64 fee_msat = 8; - - // The total amount (in milli-satoshis) of the incoming HTLC that created - // half the circuit. - uint64 amt_in_msat = 9; - - // The total amount (in milli-satoshis) of the outgoing HTLC that created - // the second half of the circuit. - uint64 amt_out_msat = 10; - - // TODO(roasbeef): add settlement latency? - // * use FPE on the chan id? - // * also list failures? -} -message ForwardingHistoryResponse { - // A list of forwarding events from the time slice of the time series - // specified in the request. - repeated ForwardingEvent forwarding_events = 1; - - // The index of the last time in the set of returned forwarding events. Can - // be used to seek further, pagination style. - uint32 last_offset_index = 2; -} - -message ExportChannelBackupRequest { - // The target channel point to obtain a back up for. - ChannelPoint chan_point = 1; -} - -message ChannelBackup { - /* - Identifies the channel that this backup belongs to. - */ - ChannelPoint chan_point = 1; - - /* - Is an encrypted single-chan backup. this can be passed to - RestoreChannelBackups, or the WalletUnlocker Init and Unlock methods in - order to trigger the recovery protocol. When using REST, this field must be - encoded as base64. - */ - bytes chan_backup = 2; -} - -message MultiChanBackup { - /* - Is the set of all channels that are included in this multi-channel backup. - */ - repeated ChannelPoint chan_points = 1; - - /* - A single encrypted blob containing all the static channel backups of the - channel listed above. This can be stored as a single file or blob, and - safely be replaced with any prior/future versions. When using REST, this - field must be encoded as base64. - */ - bytes multi_chan_backup = 2; -} - -message ChanBackupExportRequest { -} -message ChanBackupSnapshot { - /* - The set of new channels that have been added since the last channel backup - snapshot was requested. - */ - ChannelBackups single_chan_backups = 1; - - /* - A multi-channel backup that covers all open channels currently known to - lnd. - */ - MultiChanBackup multi_chan_backup = 2; -} - -message ChannelBackups { - /* - A set of single-chan static channel backups. - */ - repeated ChannelBackup chan_backups = 1; -} - -message RestoreChanBackupRequest { - oneof backup { - /* - The channels to restore as a list of channel/backup pairs. - */ - ChannelBackups chan_backups = 1; - - /* - The channels to restore in the packed multi backup format. When using - REST, this field must be encoded as base64. - */ - bytes multi_chan_backup = 2; - } -} -message RestoreBackupResponse { -} - -message ChannelBackupSubscription { -} - -message VerifyChanBackupResponse { -} - -message MacaroonPermission { - // The entity a permission grants access to. - string entity = 1; - - // The action that is granted. - string action = 2; -} -message BakeMacaroonRequest { - // The list of permissions the new macaroon should grant. - repeated MacaroonPermission permissions = 1; -} -message BakeMacaroonResponse { - // The hex encoded macaroon, serialized in binary format. - string macaroon = 1; -} - -message Failure { - enum FailureCode { - /* - The numbers assigned in this enumeration match the failure codes as - defined in BOLT #4. Because protobuf 3 requires enums to start with 0, - a RESERVED value is added. - */ - RESERVED = 0; - - INCORRECT_OR_UNKNOWN_PAYMENT_DETAILS = 1; - INCORRECT_PAYMENT_AMOUNT = 2; - FINAL_INCORRECT_CLTV_EXPIRY = 3; - FINAL_INCORRECT_HTLC_AMOUNT = 4; - FINAL_EXPIRY_TOO_SOON = 5; - INVALID_REALM = 6; - EXPIRY_TOO_SOON = 7; - INVALID_ONION_VERSION = 8; - INVALID_ONION_HMAC = 9; - INVALID_ONION_KEY = 10; - AMOUNT_BELOW_MINIMUM = 11; - FEE_INSUFFICIENT = 12; - INCORRECT_CLTV_EXPIRY = 13; - CHANNEL_DISABLED = 14; - TEMPORARY_CHANNEL_FAILURE = 15; - REQUIRED_NODE_FEATURE_MISSING = 16; - REQUIRED_CHANNEL_FEATURE_MISSING = 17; - UNKNOWN_NEXT_PEER = 18; - TEMPORARY_NODE_FAILURE = 19; - PERMANENT_NODE_FAILURE = 20; - PERMANENT_CHANNEL_FAILURE = 21; - EXPIRY_TOO_FAR = 22; - MPP_TIMEOUT = 23; - - /* - An internal error occurred. - */ - INTERNAL_FAILURE = 997; - - /* - The error source is known, but the failure itself couldn't be decoded. - */ - UNKNOWN_FAILURE = 998; - - /* - An unreadable failure result is returned if the received failure message - cannot be decrypted. In that case the error source is unknown. - */ - UNREADABLE_FAILURE = 999; - } - - // Failure code as defined in the Lightning spec - FailureCode code = 1; - - reserved 2; - - // An optional channel update message. - ChannelUpdate channel_update = 3; - - // A failure type-dependent htlc value. - uint64 htlc_msat = 4; - - // The sha256 sum of the onion payload. - bytes onion_sha_256 = 5; - - // A failure type-dependent cltv expiry value. - uint32 cltv_expiry = 6; - - // A failure type-dependent flags value. - uint32 flags = 7; - - /* - The position in the path of the intermediate or final node that generated - the failure message. Position zero is the sender node. - **/ - uint32 failure_source_index = 8; - - // A failure type-dependent block height. - uint32 height = 9; -} - -message ChannelUpdate { - /* - The signature that validates the announced data and proves the ownership - of node id. - */ - bytes signature = 1; - - /* - The target chain that this channel was opened within. This value - should be the genesis hash of the target chain. Along with the short - channel ID, this uniquely identifies the channel globally in a - blockchain. - */ - bytes chain_hash = 2; - - /* - The unique description of the funding transaction. - */ - uint64 chan_id = 3 [jstype = JS_STRING]; - - /* - A timestamp that allows ordering in the case of multiple announcements. - We should ignore the message if timestamp is not greater than the - last-received. - */ - uint32 timestamp = 4; - - /* - The bitfield that describes whether optional fields are present in this - update. Currently, the least-significant bit must be set to 1 if the - optional field MaxHtlc is present. - */ - uint32 message_flags = 10; - - /* - The bitfield that describes additional meta-data concerning how the - update is to be interpreted. Currently, the least-significant bit must be - set to 0 if the creating node corresponds to the first node in the - previously sent channel announcement and 1 otherwise. If the second bit - is set, then the channel is set to be disabled. - */ - uint32 channel_flags = 5; - - /* - The minimum number of blocks this node requires to be added to the expiry - of HTLCs. This is a security parameter determined by the node operator. - This value represents the required gap between the time locks of the - incoming and outgoing HTLC's set to this node. - */ - uint32 time_lock_delta = 6; - - /* - The minimum HTLC value which will be accepted. - */ - uint64 htlc_minimum_msat = 7; - - /* - The base fee that must be used for incoming HTLC's to this particular - channel. This value will be tacked onto the required for a payment - independent of the size of the payment. - */ - uint32 base_fee = 8; - - /* - The fee rate that will be charged per millionth of a satoshi. - */ - uint32 fee_rate = 9; - - /* - The maximum HTLC value which will be accepted. - */ - uint64 htlc_maximum_msat = 11; - - /* - The set of data that was appended to this message, some of which we may - not actually know how to iterate or parse. By holding onto this data, we - ensure that we're able to properly validate the set of signatures that - cover these new fields, and ensure we're able to make upgrades to the - network in a forwards compatible manner. - */ - bytes extra_opaque_data = 12; -} diff --git a/signer.proto b/signer.proto deleted file mode 100644 index 8440904..0000000 --- a/signer.proto +++ /dev/null @@ -1,228 +0,0 @@ -syntax = "proto3"; - -package signrpc; - -option go_package = "github.com/lightningnetwork/lnd/lnrpc/signrpc"; - -// Signer is a service that gives access to the signing functionality of the -// daemon's wallet. -service Signer { - /* - SignOutputRaw is a method that can be used to generated a signature for a - set of inputs/outputs to a transaction. Each request specifies details - concerning how the outputs should be signed, which keys they should be - signed with, and also any optional tweaks. The return value is a fixed - 64-byte signature (the same format as we use on the wire in Lightning). - - If we are unable to sign using the specified keys, then an error will be - returned. - */ - rpc SignOutputRaw (SignReq) returns (SignResp); - - /* - ComputeInputScript generates a complete InputIndex for the passed - transaction with the signature as defined within the passed SignDescriptor. - This method should be capable of generating the proper input script for - both regular p2wkh output and p2wkh outputs nested within a regular p2sh - output. - - Note that when using this method to sign inputs belonging to the wallet, - the only items of the SignDescriptor that need to be populated are pkScript - in the TxOut field, the value in that same field, and finally the input - index. - */ - rpc ComputeInputScript (SignReq) returns (InputScriptResp); - - /* - SignMessage signs a message with the key specified in the key locator. The - returned signature is fixed-size LN wire format encoded. - - The main difference to SignMessage in the main RPC is that a specific key is - used to sign the message instead of the node identity private key. - */ - rpc SignMessage (SignMessageReq) returns (SignMessageResp); - - /* - VerifyMessage verifies a signature over a message using the public key - provided. The signature must be fixed-size LN wire format encoded. - - The main difference to VerifyMessage in the main RPC is that the public key - used to sign the message does not have to be a node known to the network. - */ - rpc VerifyMessage (VerifyMessageReq) returns (VerifyMessageResp); - - /* - DeriveSharedKey returns a shared secret key by performing Diffie-Hellman key - derivation between the ephemeral public key in the request and the node's - key specified in the key_loc parameter (or the node's identity private key - if no key locator is specified): - P_shared = privKeyNode * ephemeralPubkey - The resulting shared public key is serialized in the compressed format and - hashed with sha256, resulting in the final key length of 256bit. - */ - rpc DeriveSharedKey (SharedKeyRequest) returns (SharedKeyResponse); -} - -message KeyLocator { - // The family of key being identified. - int32 key_family = 1; - - // The precise index of the key being identified. - int32 key_index = 2; -} - -message KeyDescriptor { - /* - The raw bytes of the key being identified. Either this or the KeyLocator - must be specified. - */ - bytes raw_key_bytes = 1; - - /* - The key locator that identifies which key to use for signing. Either this - or the raw bytes of the target key must be specified. - */ - KeyLocator key_loc = 2; -} - -message TxOut { - // The value of the output being spent. - int64 value = 1; - - // The script of the output being spent. - bytes pk_script = 2; -} - -message SignDescriptor { - /* - A descriptor that precisely describes *which* key to use for signing. This - may provide the raw public key directly, or require the Signer to re-derive - the key according to the populated derivation path. - */ - KeyDescriptor key_desc = 1; - - /* - A scalar value that will be added to the private key corresponding to the - above public key to obtain the private key to be used to sign this input. - This value is typically derived via the following computation: - - * derivedKey = privkey + sha256(perCommitmentPoint || pubKey) mod N - */ - bytes single_tweak = 2; - - /* - A private key that will be used in combination with its corresponding - private key to derive the private key that is to be used to sign the target - input. Within the Lightning protocol, this value is typically the - commitment secret from a previously revoked commitment transaction. This - value is in combination with two hash values, and the original private key - to derive the private key to be used when signing. - - * k = (privKey*sha256(pubKey || tweakPub) + - tweakPriv*sha256(tweakPub || pubKey)) mod N - */ - bytes double_tweak = 3; - - /* - The full script required to properly redeem the output. This field will - only be populated if a p2wsh or a p2sh output is being signed. - */ - bytes witness_script = 4; - - /* - A description of the output being spent. The value and script MUST be - provided. - */ - TxOut output = 5; - - /* - The target sighash type that should be used when generating the final - sighash, and signature. - */ - uint32 sighash = 7; - - /* - The target input within the transaction that should be signed. - */ - int32 input_index = 8; -} - -message SignReq { - // The raw bytes of the transaction to be signed. - bytes raw_tx_bytes = 1; - - // A set of sign descriptors, for each input to be signed. - repeated SignDescriptor sign_descs = 2; -} - -message SignResp { - /* - A set of signatures realized in a fixed 64-byte format ordered in ascending - input order. - */ - repeated bytes raw_sigs = 1; -} - -message InputScript { - // The serializes witness stack for the specified input. - repeated bytes witness = 1; - - /* - The optional sig script for the specified witness that will only be set if - the input specified is a nested p2sh witness program. - */ - bytes sig_script = 2; -} - -message InputScriptResp { - // The set of fully valid input scripts requested. - repeated InputScript input_scripts = 1; -} - -message SignMessageReq { - // The message to be signed. - bytes msg = 1; - - // The key locator that identifies which key to use for signing. - KeyLocator key_loc = 2; -} -message SignMessageResp { - /* - The signature for the given message in the fixed-size LN wire format. - */ - bytes signature = 1; -} - -message VerifyMessageReq { - // The message over which the signature is to be verified. - bytes msg = 1; - - /* - The fixed-size LN wire encoded signature to be verified over the given - message. - */ - bytes signature = 2; - - // The public key the signature has to be valid for. - bytes pubkey = 3; -} -message VerifyMessageResp { - // Whether the signature was valid over the given message. - bool valid = 1; -} - -message SharedKeyRequest { - // The ephemeral public key to use for the DH key derivation. - bytes ephemeral_pubkey = 1; - - /* - The optional key locator of the local key that should be used. If this - parameter is not set then the node's identity private key will be used. - */ - KeyLocator key_loc = 2; -} - -message SharedKeyResponse { - // The shared public key, hashed with sha256. - bytes shared_key = 1; -} From 5de2c8f569f924d3c4f8a81a0b711226e1238416 Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Tue, 24 Nov 2020 10:24:23 -0800 Subject: [PATCH 26/38] fix local boost msg --- dist/src/controllers/messages.js | 31 ++++++++++++++++----------- dist/src/controllers/messages.js.map | 2 +- src/controllers/messages.ts | 32 +++++++++++++++++----------- 3 files changed, 39 insertions(+), 26 deletions(-) diff --git a/dist/src/controllers/messages.js b/dist/src/controllers/messages.js index 692dbcf..2cf8a91 100644 --- a/dist/src/controllers/messages.js +++ b/dist/src/controllers/messages.js @@ -151,10 +151,23 @@ exports.sendMessage = (req, res) => __awaiter(void 0, void 0, void 0, function* owner_id: owner.id, recipient_id: contact_id, }); + let realSatsContactId; + // IF BOOST AND TRIBE OWNER NEED TO SEND ACTUAL SATS TO OG POSTER + const isTribe = chat.type === constants_1.default.chat_types.tribe; + const isTribeOwner = isTribe && owner.publicKey === chat.ownerPubkey; + if (isTribeOwner && reply_uuid && boost && amount) { + const ogMsg = yield models_1.models.Message.findOne({ where: { + uuid: reply_uuid, + } }); + if (ogMsg && ogMsg.sender) { + realSatsContactId = ogMsg.sender; + } + } const remoteMessageContent = remote_text_map ? JSON.stringify(remote_text_map) : remote_text; + const uuid = short.generate(); const msg = { chatId: chat.id, - uuid: short.generate(), + uuid: uuid, type: msgtype, sender: owner.id, amount: amount || 0, @@ -164,6 +177,9 @@ exports.sendMessage = (req, res) => __awaiter(void 0, void 0, void 0, function* status: constants_1.default.statuses.pending, createdAt: date, updatedAt: date, + network_type: realSatsContactId ? + constants_1.default.network_types.lightning : + constants_1.default.network_types.mqtt }; if (reply_uuid) msg.replyUuid = reply_uuid; @@ -184,17 +200,8 @@ exports.sendMessage = (req, res) => __awaiter(void 0, void 0, void 0, function* type: msgtype, message: msgToSend, }; - // IF BOOST AND TRIBE OWNER NEED TO SEND ACTUAL SATS TO OG POSTER - const isTribe = chat.type === constants_1.default.chat_types.tribe; - const isTribeOwner = isTribe && owner.publicKey === chat.ownerPubkey; - if (isTribeOwner && reply_uuid && boost && amount) { - const ogMsg = yield models_1.models.Message.findOne({ where: { - uuid: reply_uuid, - } }); - if (ogMsg && ogMsg.sender) { - sendMessageParams.realSatsContactId = ogMsg.sender; - } - } + if (realSatsContactId) + sendMessageParams.realSatsContactId = realSatsContactId; // final send network.sendMessage(sendMessageParams); }); diff --git a/dist/src/controllers/messages.js.map b/dist/src/controllers/messages.js.map index 7527aef..69ae57a 100644 --- a/dist/src/controllers/messages.js.map +++ b/dist/src/controllers/messages.js.map @@ -1 +1 @@ -{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/controllers/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AAK,GAAG,MAAM,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAC,CAAC,CAAA;IAEvE,MAAM,eAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;QAC3C,KAAK,EAAE;YACL,MAAM,EAAE;gBACT,CAAC,cAAE,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE;aACf;YACD,MAAM,EAAE,OAAO;SAChB;KACD,CAAC,CAAC;IACH,MAAM,IAAI,GAAG,MAAM,eAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,CAAA;IAClE,IAAG,IAAI,EAAE;QACR,MAAM,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAClC,aAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;QAChB,sBAAgB,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;QACnC,MAAM,CAAC,QAAQ,CAAC;YACf,IAAI,EAAE,WAAW;YACjB,QAAQ,EAAE,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC;SACpC,CAAC,CAAA;KACF;SAAM;QACN,aAAO,CAAC,GAAG,EAAE,SAAS,CAAC,CAAA;KACvB;AACF,CAAC,CAAA,CAAA;AAEY,QAAA,aAAa,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IACzC,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;IAErD,aAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;AACjB,CAAC,CAAA"} \ No newline at end of file +{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/controllers/messages.ts"],"names":[],"mappings":";;;;;;;;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KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;IAErD,aAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;AACjB,CAAC,CAAA"} \ No newline at end of file diff --git a/src/controllers/messages.ts b/src/controllers/messages.ts index 0dbb7e6..694f1a6 100644 --- a/src/controllers/messages.ts +++ b/src/controllers/messages.ts @@ -173,10 +173,24 @@ export const sendMessage = async (req, res) => { recipient_id: contact_id, }) + let realSatsContactId + // IF BOOST AND TRIBE OWNER NEED TO SEND ACTUAL SATS TO OG POSTER + const isTribe = chat.type===constants.chat_types.tribe + const isTribeOwner = isTribe && owner.publicKey===chat.ownerPubkey + if(isTribeOwner && reply_uuid && boost && amount) { + const ogMsg = await models.Message.findOne({where:{ + uuid: reply_uuid, + }}) + if(ogMsg && ogMsg.sender) { + realSatsContactId = ogMsg.sender + } + } + const remoteMessageContent = remote_text_map?JSON.stringify(remote_text_map) : remote_text + const uuid = short.generate() const msg:{[k:string]:any}={ chatId: chat.id, - uuid: short.generate(), + uuid: uuid, type: msgtype, sender: owner.id, amount: amount||0, @@ -186,6 +200,9 @@ export const sendMessage = async (req, res) => { status: constants.statuses.pending, createdAt: date, updatedAt: date, + network_type: realSatsContactId ? + constants.network_types.lightning : + constants.network_types.mqtt } if(reply_uuid) msg.replyUuid=reply_uuid // console.log(msg) @@ -207,18 +224,7 @@ export const sendMessage = async (req, res) => { type: msgtype, message: msgToSend, } - - // IF BOOST AND TRIBE OWNER NEED TO SEND ACTUAL SATS TO OG POSTER - const isTribe = chat.type===constants.chat_types.tribe - const isTribeOwner = isTribe && owner.publicKey===chat.ownerPubkey - if(isTribeOwner && reply_uuid && boost && amount) { - const ogMsg = await models.Message.findOne({where:{ - uuid: reply_uuid, - }}) - if(ogMsg && ogMsg.sender) { - sendMessageParams.realSatsContactId = ogMsg.sender - } - } + if(realSatsContactId) sendMessageParams.realSatsContactId = realSatsContactId // final send network.sendMessage(sendMessageParams) From f94ed685524dd888a09a042d2db5075f04135204 Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Tue, 24 Nov 2020 10:31:45 -0800 Subject: [PATCH 27/38] autounlock --- dist/src/grpc/index.js | 4 ++-- dist/src/grpc/index.js.map | 2 +- src/grpc/index.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/dist/src/grpc/index.js b/dist/src/grpc/index.js index c321433..2781d89 100644 --- a/dist/src/grpc/index.js +++ b/dist/src/grpc/index.js @@ -18,7 +18,7 @@ const lightning_1 = require("../utils/lightning"); const network = require("../network"); const moment = require("moment"); const constants_1 = require("../constants"); -// import {tryToUnlockLND} from '../utils/unlock' +const unlock_1 = require("../utils/unlock"); const ERR_CODE_UNAVAILABLE = 14; const ERR_CODE_STREAM_REMOVED = 2; const ERR_CODE_UNIMPLEMENTED = 12; // locked @@ -151,7 +151,7 @@ function reconnectToLND(innerCtx, callback) { } catch (e) { if (e.code === ERR_CODE_UNIMPLEMENTED) { - // await tryToUnlockLND() + yield unlock_1.tryToUnlockLND(); } setTimeout(() => __awaiter(this, void 0, void 0, function* () { if (ctx === innerCtx) { // if another retry fires, then this will not run diff --git a/dist/src/grpc/index.js.map b/dist/src/grpc/index.js.map index 2242bec..87f8b41 100644 --- a/dist/src/grpc/index.js.map +++ b/dist/src/grpc/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/grpc/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,0CAAyC;AACzC,gCAAsD;AACtD,2CAA0C;AAC1C,+CAA8C;AAC9C,kDAAgD;AAChD,sCAAqC;AACrC,iCAAgC;AAChC,4CAAoC;AACpC,iDAAiD;AAEjD,MAAM,oBAAoB,GAAG,EAAE,CAAA;AAC/B,MAAM,uBAAuB,GAAG,CAAC,CAAA;AACjC,MAAM,sBAAsB,GAAG,EAAE,CAAA,CAAC,SAAS;AAE3C,SAAgB,iBAAiB,CAAC,mBAAmB;IACpD,OAAO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AA;QACd,CAAC,EAAC,GAAG,CAAC,CAAA;IACP,CAAC,CAAA,CAAC,CAAA;AACH,CAAC;AAlHD,8CAkHC;AAED,IAAI,CAAC,GAAG,CAAC,CAAA;AACT,IAAI,GAAG,GAAG,CAAC,CAAA;AACX,SAAsB,cAAc,CAAC,QAAe,EAAE,QAAkB;;QACvE,GAAG,GAAG,QAAQ,CAAA;QACd,CAAC,EAAE,CAAA;QACH,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,IAAI,EAAE,CAAC;QAC1D,OAAO,CAAC,GAAG,CAAC,MAAM,GAAG,mCAAmC,CAAC,EAAE,CAAC,CAAA;QAC5D,IAAI;YACH,MAAM,OAAO,CAAC,qBAAqB,EAAE,CAAA;YACrC,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,IAAI,EAAE,CAAC;YAC1D,OAAO,CAAC,GAAG,CAAC,uBAAuB,GAAG,EAAE,CAAC,CAAA;YACzC,IAAG,QAAQ;gBAAE,QAAQ,EAAE,CAAA;SACvB;QAAC,OAAM,CAAC,EAAE;YACV,IAAG,CAAC,CAAC,IAAI,KAAG,sBAAsB,EAAE;gBACnC,yBAAyB;aACzB;YACD,UAAU,CAAC,GAAO,EAAE;gBACnB,IAAG,GAAG,KAAG,QAAQ,EAAE,EAAE,iDAAiD;oBACrE,MAAM,cAAc,CAAC,QAAQ,CAAC,CAAA;iBAC9B;YACF,CAAC,CAAA,EAAC,IAAI,CAAC,CAAA;SACP;IACF,CAAC;CAAA;AApBD,wCAoBC"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/grpc/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,0CAAyC;AACzC,gCAAsD;AACtD,2CAA0C;AAC1C,+CAA8C;AAC9C,kDAAgD;AAChD,sCAAqC;AACrC,iCAAgC;AAChC,4CAAoC;AACpC,4CA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b/src/grpc/index.ts index 72d565c..64abdd8 100644 --- a/src/grpc/index.ts +++ b/src/grpc/index.ts @@ -7,7 +7,7 @@ import {loadLightning} from '../utils/lightning' import * as network from '../network' import * as moment from 'moment' import constants from '../constants' -// import {tryToUnlockLND} from '../utils/unlock' +import {tryToUnlockLND} from '../utils/unlock' const ERR_CODE_UNAVAILABLE = 14 const ERR_CODE_STREAM_REMOVED = 2 @@ -143,7 +143,7 @@ export async function reconnectToLND(innerCtx:number, callback?:Function) { if(callback) callback() } catch(e) { if(e.code===ERR_CODE_UNIMPLEMENTED) { - // await tryToUnlockLND() + await tryToUnlockLND() } setTimeout(async()=>{ // retry each 2 secs if(ctx===innerCtx) { // if another retry fires, then this will not run From 289753bb35d01ea3e90abd1b9c1d3af40a31e2a6 Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Tue, 24 Nov 2020 10:41:14 -0800 Subject: [PATCH 28/38] ByteBuffer.fromUTF8 for wallet password --- dist/src/utils/lightning.js | 4 ++-- dist/src/utils/lightning.js.map | 2 +- dist/src/utils/unlock.js | 9 +++++++-- dist/src/utils/unlock.js.map | 2 +- src/utils/lightning.ts | 4 ++-- src/utils/unlock.ts | 8 ++++++-- 6 files changed, 19 insertions(+), 10 deletions(-) diff --git a/dist/src/utils/lightning.js b/dist/src/utils/lightning.js index 1713cb1..52ad623 100644 --- a/dist/src/utils/lightning.js +++ b/dist/src/utils/lightning.js @@ -87,11 +87,11 @@ const loadWalletUnlocker = () => { } }; exports.loadWalletUnlocker = loadWalletUnlocker; -const unlockWallet = (wallet_password) => __awaiter(void 0, void 0, void 0, function* () { +const unlockWallet = (pwd) => __awaiter(void 0, void 0, void 0, function* () { return new Promise(function (resolve, reject) { return __awaiter(this, void 0, void 0, function* () { let wu = yield loadWalletUnlocker(); - wu.unlockWallet({ wallet_password }, (err, response) => { + wu.unlockWallet({ wallet_password: ByteBuffer.fromUTF8(pwd) }, (err, response) => { if (err) { reject(err); return; diff --git a/dist/src/utils/lightning.js.map b/dist/src/utils/lightning.js.map index a6a7ecf..f6a764e 100644 --- a/dist/src/utils/lightning.js.map +++ b/dist/src/utils/lightning.js.map @@ -1 +1 @@ -{"version":3,"file":"lightning.js","sourceRoot":"","sources":["../../../src/utils/lightning.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,yCAAwC;AACxC,yBAAwB;AACxB,6BAA4B;AAC5B,wCAAmC;AACnC,iCAAgC;AAChC,iCAAgC;AAChC,6BAA4B;AAC5B,4CAAoC;AACpC,yCAAsC;AAEtC,kDAAkD;AAClD,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,uBAAuB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AAEzE,MAAM,eAAe,GAAG,UAAU,CAAA;AAichC,0CAAe;AAhcjB,MAAM,wBAAwB,GAAG,SAAS,CAAA;AAicxC,4DAAwB;AA/b1B,IAAI,eAAe,GAAS,IAAI,CAAC;AACjC,IAAI,cAAc,GAAU,IAAI,CAAC;AAEjC,MAAM,eAAe,GAAG,GAAG,EAAE;IAC3B,IAAI,OAAO,GAAG,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IACnD,IAAI,QAAQ,GAAG,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;IACnD,IAAI,QAAQ,GAAG,sBAAW,EAAE,CAAA;IAC7B,IAAI,QAAQ,GAAG,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAA;IAClC,QAAQ,CAAC,GAAG,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAA;IAClC,IAAI,aAAa,GAAG,IAAI,CAAC,WAAW,CAAC,2BAA2B,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;QACpF,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IAC1B,CAA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E,QAAQ;gBAChD,IAAI,GAAG,IAAI,IAAI,EAAE;oBAChB,OAAO,CAAC,QAAQ,CAAC,CAAA;iBACjB;qBAAM;oBACN,MAAM,CAAC,GAAG,CAAC,CAAA;iBACX;YACF,CAAC,CAAC,CAAC;QACJ,CAAC,CAAC,CAAA;IACH,CAAC;CAAA;AAgDC,oCAAY;AA9Cd,SAAe,cAAc;;QAC5B,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAC,MAAM,EAAC,EAAE;YACpC,MAAM,SAAS,GAAG,aAAa,EAAE,CAAA;YACjC,SAAS,CAAC,cAAc,CAAC,EAAE,EAAE,UAAS,GAAG,EAAE,QAAQ;gBAClD,IAAI,GAAG,IAAI,IAAI,EAAE;oBAChB,OAAO,CAAC,QAAQ,CAAC,CAAA;iBACjB;qBAAM;oBACN,MAAM,CAAC,GAAG,CAAC,CAAA;iBACX;YACF,CAAC,CAAC,CAAC;QACJ,CAAC,CAAC,CAAA;IACH,CAAC;CAAA;AAoCC,wCAAc;AAlChB,SAAS,aAAa,CAAC,GAAG;IACzB,IAAI,IAAI,GAAc,EAAE,CAAC;IACzB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,EAAG,EAAE;QAC5C,IAAI,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;QACjD,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KACd;IACF,OAAO,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACtB,CAAC"} \ No newline at end of file diff --git a/dist/src/utils/unlock.js b/dist/src/utils/unlock.js index 242874c..a3262be 100644 --- a/dist/src/utils/unlock.js +++ b/dist/src/utils/unlock.js @@ -28,8 +28,13 @@ function tryToUnlockLND() { var pwd = yield getFirstLine(config.lnd_pwd_path); if (!pwd) return; - console.log('==>', pwd); - yield lightning_1.unlockWallet(pwd); + console.log('==>', pwd, typeof pwd); + try { + yield lightning_1.unlockWallet(String(pwd)); + } + catch (e) { + console.log('[unlock] Error:', e); + } }); } exports.tryToUnlockLND = tryToUnlockLND; diff --git a/dist/src/utils/unlock.js.map b/dist/src/utils/unlock.js.map index 43acf76..faae838 100644 --- a/dist/src/utils/unlock.js.map +++ b/dist/src/utils/unlock.js.map @@ -1 +1 @@ -{"version":3,"file":"unlock.js","sourceRoot":"","sources":["../../../src/utils/unlock.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,6BAA4B;AAC5B,2CAA0C;AAC1C,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;AACxB,MAAM,QAAQ,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;AAErC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,uBAAuB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AAE1E,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAC,IAAI,EAAC,CAAC,CAAC,CAAC,CAAA;AAE1C;;EAEE;AAEF,SAAsB,cAAc;;QAChC,MAAM,CAAC,GAAG,MAAM,CAAC,YAAY,CAAA;QAC7B,IAAI,CAAC,CAAC;YAAE,OAAM;QAEd,OAAO,CAAC,GAAG,CAAC,KAAK,EAAC,CAAC,CAAC,CAAA;QAEpB,IAAI,GAAG,GAAG,MAAM,YAAY,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;QAClD,IAAG,CAAC,GAAG;YAAE,OAAM;QAEf,OAAO,CAAC,GAAG,CAAC,KAAK,EAAC,GAAG,CAAC,CAAA;QAEtB,MAAM,wBAAY,CAAC,GAAG,CAAC,CAAA;IAC3B,CAAC;CAAA;AAZD,wCAYC;AA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AA;QAEpB,IAAI,GAAG,GAAG,MAAM,YAAY,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;QAClD,IAAG,CAAC,GAAG;YAAE,OAAM;QAEf,OAAO,CAAC,GAAG,CAAC,KAAK,EAAC,GAAG,EAAC,OAAO,GAAG,CAAC,CAAA;QAEjC,IAAI;YACA,MAAM,wBAAY,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAA;SAClC;QAAC,OAAM,CAAC,EAAE;YACP,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAC,CAAC,CAAC,CAAA;SACnC;IACL,CAAC;CAAA;AAhBD,wCAgBC;AAED,SAAe,YAAY,CAAC,UAAU;;QAClC,MAAM,QAAQ,GAAG,EAAE,CAAC,gBAAgB,CAAC,UAAU,CAAC,CAAC;QACjD,MAAM,MAAM,GAAG,QAAQ,CAAC,eAAe,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;QAC7D,MAAM,IAAI,GAAG,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YACvC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;gBACvB,MAAM,CAAC,KAAK,EAAE,CAAC;gBACf,OAAO,CAAC,IAAI,CAAC,CAAC;YAClB,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;QACH,QAAQ,CAAC,KAAK,EAAE,CAAC;QACjB,OAAO,IAAI,CAAC;IAChB,CAAC;CAAA"} \ No newline at end of file diff --git a/src/utils/lightning.ts b/src/utils/lightning.ts index a159fea..cbfbce2 100644 --- a/src/utils/lightning.ts +++ b/src/utils/lightning.ts @@ -76,11 +76,11 @@ const loadWalletUnlocker = () => { } } -const unlockWallet = async (wallet_password) => { +const unlockWallet = async (pwd:string) => { return new Promise(async function(resolve, reject) { let wu = await loadWalletUnlocker() wu.unlockWallet( - { wallet_password }, + { wallet_password: ByteBuffer.fromUTF8(pwd) }, (err, response) => { if(err) { reject(err) diff --git a/src/utils/unlock.ts b/src/utils/unlock.ts index efecd1a..9ba6c2e 100644 --- a/src/utils/unlock.ts +++ b/src/utils/unlock.ts @@ -21,9 +21,13 @@ export async function tryToUnlockLND() { var pwd = await getFirstLine(config.lnd_pwd_path); if(!pwd) return - console.log('==>',pwd) + console.log('==>',pwd,typeof pwd) - await unlockWallet(pwd) + try { + await unlockWallet(String(pwd)) + } catch(e) { + console.log('[unlock] Error:',e) + } } async function getFirstLine(pathToFile) { From 1045399b2c90f74c4c2ce2fa5bbbf67672203705 Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Tue, 24 Nov 2020 10:58:31 -0800 Subject: [PATCH 29/38] log --- dist/src/controllers/messages.js | 1 + dist/src/controllers/messages.js.map | 2 +- dist/src/grpc/index.js | 2 +- dist/src/grpc/index.js.map | 2 +- src/controllers/messages.ts | 1 + src/grpc/index.ts | 2 +- 6 files changed, 6 insertions(+), 4 deletions(-) diff --git a/dist/src/controllers/messages.js b/dist/src/controllers/messages.js index 2cf8a91..9372529 100644 --- a/dist/src/controllers/messages.js +++ b/dist/src/controllers/messages.js @@ -184,6 +184,7 @@ exports.sendMessage = (req, res) => __awaiter(void 0, void 0, void 0, function* if (reply_uuid) msg.replyUuid = reply_uuid; // console.log(msg) + console.log("=> SAVED MSG", JSON.stringify(msg, null, 2)); const message = yield models_1.models.Message.create(msg); res_1.success(res, jsonUtils.messageToJson(message, chat)); const msgToSend = { diff --git a/dist/src/controllers/messages.js.map b/dist/src/controllers/messages.js.map index 69ae57a..38a6856 100644 --- a/dist/src/controllers/messages.js.map +++ b/dist/src/controllers/messages.js.map @@ -1 +1 @@ -{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/controllers/messages.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,yCAA8B;AAC9B,2CAAoC;AACpC,gCAAyC;AACzC,0CAAyC;AACzC,2CAA0C;AAC1C,sCAAqC;AACrC,sCAA+C;AAC/C,0CAAyC;AAC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SAAM;QACN,aAAO,CAAC,GAAG,EAAE,SAAS,CAAC,CAAA;KACvB;AACF,CAAC,CAAA,CAAA;AAEY,QAAA,aAAa,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IACzC,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;IAErD,aAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;AACjB,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/src/grpc/index.js b/dist/src/grpc/index.js index 2781d89..76ece43 100644 --- a/dist/src/grpc/index.js +++ b/dist/src/grpc/index.js @@ -155,7 +155,7 @@ function reconnectToLND(innerCtx, callback) { } setTimeout(() => __awaiter(this, void 0, void 0, function* () { if (ctx === innerCtx) { // if another retry fires, then this will not run - yield reconnectToLND(innerCtx); + yield reconnectToLND(innerCtx, callback); } }), 2000); } diff --git a/dist/src/grpc/index.js.map b/dist/src/grpc/index.js.map index 87f8b41..118c9d2 100644 --- a/dist/src/grpc/index.js.map +++ b/dist/src/grpc/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/grpc/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,0CAAyC;AACzC,gCAAsD;AACtD,2CAA0C;AAC1C,+CAA8C;AAC9C,kDAAgD;AAChD,sCAAqC;AACrC,iCAAgC;AAChC,4CAAoC;AACpC,4CAA8C;AAE9C,MAAM,oBAAoB,GAAG,EAAE,CAAA;AAC/B,MAAM,uBAAuB,GAAG,CAAC,CAAA;AACjC,MAAM,sBAAsB,GAAG,EAAE,CAAA,CAAC,SAAS;AAE3C,SAAgB,iBAAiB,CAAC,mBAAmB;IACpD,OAAO,IAAI,OAAO,CAAC,CAAM,OAAO,EAAC,MAAM,EAAC,EAAE;QACzC,MAAM,SAAS,GAAG,MAAM,yBAAa,EAAE,CAAA;QAEvC,IAAI,I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B,CAAC,CAAC,CAAA;QACF,UAAU,CAAC,GAAE,EAAE;YACd,OAAO,CAAC,IAAI,CAAC,CAAA;QACd,CAAC,EAAC,GAAG,CAAC,CAAA;IACP,CAAC,CAAA,CAAC,CAAA;AACH,CAAC;AAlHD,8CAkHC;AAED,IAAI,CAAC,GAAG,CAAC,CAAA;AACT,IAAI,GAAG,GAAG,CAAC,CAAA;AACX,SAAsB,cAAc,CAAC,QAAe,EAAE,QAAkB;;QACvE,GAAG,GAAG,QAAQ,CAAA;QACd,CAAC,EAAE,CAAA;QACH,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,IAAI,EAAE,CAAC;QAC1D,OAAO,CAAC,GAAG,CAAC,MAAM,GAAG,mCAAmC,CAAC,EAAE,CAAC,CAAA;QAC5D,IAAI;YACH,MAAM,OAAO,CAAC,qBAAqB,EAAE,CAAA;YACrC,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,IAAI,EAAE,CAAC;YAC1D,OAAO,CAAC,GAAG,CAAC,uBAAuB,GAAG,EAAE,CAAC,CAAA;YACzC,IAAG,QAAQ;gBAAE,QAAQ,EAAE,CAAA;SACvB;QAAC,OAAM,CAAC,EAAE;YACV,IAAG,CAAC,CAAC,IAAI,KAAG,sBAAsB,EAAE;gBACnC,MAAM,uBAAc,EAAE,CAAA;aACtB;YACD,UAAU,CAAC,GAAO,EAAE;gBACnB,IAAG,GAAG,KAAG,QAAQ,EAAE,EAAE,iDAAiD;oBACrE,MAAM,cAAc,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAA;iBACxC;YACF,CAAC,CAAA,EAAC,IAAI,CAAC,CAAA;SACP;IACF,CAAC;CAAA;AApBD,wCAoBC"} \ No newline at end of file diff --git a/src/controllers/messages.ts b/src/controllers/messages.ts index 694f1a6..95c51ba 100644 --- a/src/controllers/messages.ts +++ b/src/controllers/messages.ts @@ -206,6 +206,7 @@ export const sendMessage = async (req, res) => { } if(reply_uuid) msg.replyUuid=reply_uuid // console.log(msg) + console.log("=> SAVED MSG",JSON.stringify(msg,null,2)) const message = await models.Message.create(msg) success(res, jsonUtils.messageToJson(message, chat)) diff --git a/src/grpc/index.ts b/src/grpc/index.ts index 64abdd8..36787ec 100644 --- a/src/grpc/index.ts +++ b/src/grpc/index.ts @@ -147,7 +147,7 @@ export async function reconnectToLND(innerCtx:number, callback?:Function) { } setTimeout(async()=>{ // retry each 2 secs if(ctx===innerCtx) { // if another retry fires, then this will not run - await reconnectToLND(innerCtx) + await reconnectToLND(innerCtx, callback) } },2000) } From 16da350e4f960794640a64b5eddcf67b6b14e0c3 Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Tue, 24 Nov 2020 11:02:41 -0800 Subject: [PATCH 30/38] network typ elogic --- dist/src/controllers/messages.js | 2 +- dist/src/controllers/messages.js.map | 2 +- src/controllers/messages.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/src/controllers/messages.js b/dist/src/controllers/messages.js index 9372529..cbcddd1 100644 --- a/dist/src/controllers/messages.js +++ b/dist/src/controllers/messages.js @@ -155,7 +155,7 @@ exports.sendMessage = (req, res) => __awaiter(void 0, void 0, void 0, function* // IF BOOST AND TRIBE OWNER NEED TO SEND ACTUAL SATS TO OG POSTER const isTribe = chat.type === constants_1.default.chat_types.tribe; const isTribeOwner = isTribe && owner.publicKey === chat.ownerPubkey; - if (isTribeOwner && reply_uuid && boost && amount) { + if ((!isTribe || isTribeOwner) && reply_uuid && boost && amount) { const ogMsg = yield models_1.models.Message.findOne({ where: { uuid: reply_uuid, } }); diff --git a/dist/src/controllers/messages.js.map b/dist/src/controllers/messages.js.map index 38a6856..d4f2018 100644 --- a/dist/src/controllers/messages.js.map +++ b/dist/src/controllers/messages.js.map @@ -1 +1 @@ -{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/controllers/messages.ts"],"names":[],"mappings":";;;;;;;;;;;AAA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AEY,QAAA,aAAa,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IACzC,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;IAErD,aAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;AACjB,CAAC,CAAA"} \ No newline at end of file +{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/controllers/messages.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,yCAA8B;AAC9B,2CAAoC;AACpC,gCAAyC;AACzC,0CAAyC;AACzC,2CAA0C;AAC1C,sCAAqC;AACrC,sCAA+C;AAC/C,0CAAyC;AACzC,mDAAgD;AAChD,sCAAqC;AACrC,oCAAmC;AACnC,4CAAoC;AAEvB,QAAA,WAAW,GAAG,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;IAC7C,MAAM,YAAY,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;IAEpC,IAAI,CAAC,YAAY,EAAE;QAClB,OAAO,sBAAc,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;KAC/B;IACD,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;IACzB,MAAM,KAAK,GAAG,MAAM,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,CAAA;IACxE,mCAAmC;IAEnC,IAAI,gBAAgB,GAAG;QACtB,IAAI,EAAE,EAAE,CAAC,cAAE,CAAC,GAAG,CAAC,EAAE,YAAY,EAAE;QAChC,CAAC,cAAE,CAAC,EAAE,CAAC,EAAE;YACR,EAAC,QAAQ,EAAE,KAAK,CAAC,EAAE,EAAC;YACpB,EAAC,QAAQ,EAAE,IAAI,EAAC;SAChB;KACD,CAAA;IAED,IAAI,sBAAsB,GAAG;QAC5B,UAAU,EAAE,EAAE,CAAC,cAA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AAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAClC,aAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;QAChB,sBAAgB,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;QACnC,MAAM,CAAC,QAAQ,CAAC;YACf,IAAI,EAAE,WAAW;YACjB,QAAQ,EAAE,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC;SACpC,CAAC,CAAA;KACF;SAAM;QACN,aAAO,CAAC,GAAG,EAAE,SAAS,CAAC,CAAA;KACvB;AACF,CAAC,CAAA,CAAA;AAEY,QAAA,aAAa,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IACzC,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;IAErD,aAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;AACjB,CAAC,CAAA"} \ No newline at end of file diff --git a/src/controllers/messages.ts b/src/controllers/messages.ts index 95c51ba..60c33c2 100644 --- a/src/controllers/messages.ts +++ b/src/controllers/messages.ts @@ -177,7 +177,7 @@ export const sendMessage = async (req, res) => { // IF BOOST AND TRIBE OWNER NEED TO SEND ACTUAL SATS TO OG POSTER const isTribe = chat.type===constants.chat_types.tribe const isTribeOwner = isTribe && owner.publicKey===chat.ownerPubkey - if(isTribeOwner && reply_uuid && boost && amount) { + if((!isTribe || isTribeOwner) && reply_uuid && boost && amount) { const ogMsg = await models.Message.findOne({where:{ uuid: reply_uuid, }}) From 85ca7551c4101963814610e3b4092887dda99ea1 Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Tue, 24 Nov 2020 11:08:12 -0800 Subject: [PATCH 31/38] simplify --- dist/src/controllers/media.js | 3 ++- dist/src/controllers/media.js.map | 2 +- dist/src/controllers/messages.js | 5 ++--- dist/src/controllers/messages.js.map | 2 +- dist/src/controllers/payment.js | 3 ++- dist/src/controllers/payment.js.map | 2 +- src/controllers/media.ts | 3 ++- src/controllers/messages.ts | 5 ++--- src/controllers/payment.ts | 3 ++- 9 files changed, 15 insertions(+), 13 deletions(-) diff --git a/dist/src/controllers/media.js b/dist/src/controllers/media.js index a0705af..5c06568 100644 --- a/dist/src/controllers/media.js +++ b/dist/src/controllers/media.js @@ -175,7 +175,8 @@ exports.purchase = (req, res) => __awaiter(void 0, void 0, void 0, function* () mediaToken: media_token, date: date, createdAt: date, - updatedAt: date + updatedAt: date, + network_type: constants_1.default.network_types.lightning }); const msg = { mediaToken: media_token, id: message.id, uuid: message.uuid, diff --git a/dist/src/controllers/media.js.map b/dist/src/controllers/media.js.map index 1ef32f9..7ce71c7 100644 --- a/dist/src/controllers/media.js.map +++ b/dist/src/controllers/media.js.map @@ -1 +1 @@ -{"version":3,"file":"media.js","sourceRoot":"","sources":["../../../src/controllers/media.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,0CAAyC;AACzC,2CAA0C;AAC1C,yCAAwC;AACxC,sCAAqC;AACrC,gCAAyC;AACzC,kDAA8D;AAC9D,sCAAqC;AACrC,kDAAkD;AAClD,wCAAqF;AACrF,+BAA4B;AAC5B,4CAA2C;AAC3C,qCAAoC;AACpC,mDAAgD;AAChD,6BAA4B;AAC5B,sCAAqC;AACrC,sCAAqC;AACrC,oCAAmC;AACnC,4CAAoC;AAEpC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,uBAAuB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AAEzE;;;;;;;;;;;;;;;;EAgBE;AAEW,QAAA,qBAAqB,GAAG,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;IACtD,QAAQ;IACR,8CAA8C;IAC9C,eAAe;IACf,4CAA4C;IAC5C,IAAI;IAEJ,MAAM,EACJ,OAAO,EACP,UAAU,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K,CAAC,GAAG,CAAC,CAAA;YAC5B,IAAG,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,EAAC;gBACvB,MAAM,IAAI,KAAK,CAAC,UAAU,CAAC,CAAA;aAC5B;YACD,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;YAC9B,OAAO,IAAI,CAAC,KAAK,CAAA;SAClB;QAAC,OAAM,CAAC,EAAE;YACT,MAAM,CAAC,CAAA;SACR;IACH,CAAC;CAAA;AAlCD,sCAkCC;AAED,SAAsB,YAAY,CAAC,IAAI;;QACrC,IAAI;YACF,MAAM,KAAK,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,CAAA;YACvC,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC,GAAG,CAAC,QAAQ,GAAC,UAAU,GAAC,IAAI,EAAC;gBAChD,OAAO,EAAE;oBACP,eAAe,EAAE,UAAU,KAAK,EAAE;oBAClC,cAAc,EAAE,kBAAkB;iBACnC;gBACD,IAAI,EAAC,IAAI;aACV,CAAC,CAAA;YACF,OAAO,GAAG,CAAA;SACX;QAAC,OAAM,CAAC,EAAE;YACT,OAAO,IAAI,CAAA;SACZ;IACH,CAAC;CAAA;AAdD,oCAcC"} \ No newline at end of file +{"version":3,"file":"media.js","sourceRoot":"","sources":["../../../src/controllers/media.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,0CAAyC;AACzC,2CAA0C;AAC1C,yCAAwC;AACxC,sCAAqC;AACrC,gCAAyC;AACzC,kDAA8D;AAC9D,sCAAqC;AACrC,kDAAkD;AAClD,wCAAqF;AACrF,+BAA4B;AAC5B,4CAA2C;AAC3C,qCAAoC;AACpC,mDAAgD;AAChD,6BAA4B;AAC5B,sCAAqC;AACrC,sCAAqC;AACrC,oCAAmC;AACnC,4CAAoC;AAEpC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,MAAM,MAA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Q,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA;YACpC,MAAM,SAAS,GAAG,yBAAkB,CAAC,QAAQ,CAAC,CAAA;YAE9C,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC,IAAI,CAAC,QAAQ,GAAC,QAAQ,EAAE;gBAC3C,IAAI,EAAC,EAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,GAAG,EAAC,SAAS,EAAE,MAAM,EAAC;aACvC,CAAC,CAAA;YACF,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;YAC5B,IAAG,CAAC,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,CAAC,EAAC;gBACvB,MAAM,IAAI,KAAK,CAAC,UAAU,CAAC,CAAA;aAC5B;YACD,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;YAC9B,OAAO,IAAI,CAAC,KAAK,CAAA;SAClB;QAAC,OAAM,CAAC,EAAE;YACT,MAAM,CAAC,CAAA;SACR;IACH,CAAC;CAAA;AAlCD,sCAkCC;AAED,SAAsB,YAAY,CAAC,IAAI;;QACrC,IAAI;YACF,MAAM,KAAK,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,CAAA;YACvC,MAAM,GAAG,GAAG,MAAM,EAAE,CAAC,GAAG,CAAC,QAAQ,GAAC,UAAU,GAAC,IAAI,EAAC;gBAChD,OAAO,EAAE;oBACP,eAAe,EAAE,UAAU,KAAK,EAAE;oBAClC,cAAc,EAAE,kBAAkB;iBACnC;gBACD,IAAI,EAAC,IAAI;aACV,CAAC,CAAA;YACF,OAAO,GAAG,CAAA;SACX;QAAC,OAAM,CAAC,EAAE;YACT,OAAO,IAAI,CAAA;SACZ;IACH,CAAC;CAAA;AAdD,oCAcC"} \ No newline at end of file diff --git a/dist/src/controllers/messages.js b/dist/src/controllers/messages.js index cbcddd1..6fc2ca4 100644 --- a/dist/src/controllers/messages.js +++ b/dist/src/controllers/messages.js @@ -155,7 +155,7 @@ exports.sendMessage = (req, res) => __awaiter(void 0, void 0, void 0, function* // IF BOOST AND TRIBE OWNER NEED TO SEND ACTUAL SATS TO OG POSTER const isTribe = chat.type === constants_1.default.chat_types.tribe; const isTribeOwner = isTribe && owner.publicKey === chat.ownerPubkey; - if ((!isTribe || isTribeOwner) && reply_uuid && boost && amount) { + if (isTribeOwner && reply_uuid && boost && amount) { const ogMsg = yield models_1.models.Message.findOne({ where: { uuid: reply_uuid, } }); @@ -177,14 +177,13 @@ exports.sendMessage = (req, res) => __awaiter(void 0, void 0, void 0, function* status: constants_1.default.statuses.pending, createdAt: date, updatedAt: date, - network_type: realSatsContactId ? + network_type: (!isTribe || realSatsContactId) ? constants_1.default.network_types.lightning : constants_1.default.network_types.mqtt }; if (reply_uuid) msg.replyUuid = reply_uuid; // console.log(msg) - console.log("=> SAVED MSG", JSON.stringify(msg, null, 2)); const message = yield models_1.models.Message.create(msg); res_1.success(res, jsonUtils.messageToJson(message, chat)); const msgToSend = { diff --git a/dist/src/controllers/messages.js.map b/dist/src/controllers/messages.js.map index d4f2018..391e1d5 100644 --- a/dist/src/controllers/messages.js.map +++ b/dist/src/controllers/messages.js.map @@ -1 +1 @@ -{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/controllers/messages.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,yCAA8B;AAC9B,2CAAoC;AACpC,gCAAyC;AACzC,0CAAyC;AACzC,2CAA0C;AAC1C,sCAAqC;AACrC,sCAA+C;AAC/C,0CAAyC;AACzC,mDAAgD;AAChD,sCAAqC;AACrC,oCAAmC;AACnC,4CAAoC;AAEvB,QAAA,WAAW,GAAG,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;IAC7C,MAAM,YAAY,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;IAEpC,IAAI,CAAC,YAAY,EAAE;QAClB,OAAO,sBAAc,CAAC,GAAG,EAAE,GAAG,CAAC,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AC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAC,CAAC,CAAA;IAEvE,MAAM,eAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;QAC3C,KAAK,EAAE;YACL,MAAM,EAAE;gBACT,CAAC,cAAE,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE;aACf;YACD,MAAM,EAAE,OAAO;SAChB;KACD,CAAC,CAAC;IACH,MAAM,IAAI,GAAG,MAAM,eAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,CAAA;IAClE,IAAG,IAAI,EAAE;QACR,MAAM,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAClC,aAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;QAChB,sBAAgB,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;QACnC,MAAM,CAAC,QAAQ,CAAC;YACf,IAAI,EAAE,WAAW;YACjB,QAAQ,EAAE,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC;SACpC,CAAC,CAAA;KACF;SAAM;QACN,aAAO,CAAC,GAAG,EAAE,SAAS,CAAC,CAAA;KACvB;AACF,CAAC,CAAA,CAAA;AAEY,QAAA,aAAa,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IACzC,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;IAErD,aAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;AACjB,CAAC,CAAA"} \ No newline at end of file +{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/controllers/messages.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,yCAA8B;AAC9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EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;IAErD,aAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;AACjB,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/src/controllers/payment.js b/dist/src/controllers/payment.js index 113a373..59e80be 100644 --- a/dist/src/controllers/payment.js +++ b/dist/src/controllers/payment.js @@ -51,7 +51,8 @@ exports.sendPayment = (req, res) => __awaiter(void 0, void 0, void 0, function* amountMsat: parseFloat(amount) * 1000, date: date, createdAt: date, - updatedAt: date + updatedAt: date, + network_type: constants_1.default.network_types.lightning, }; if (text) msg.messageContent = text; diff --git a/dist/src/controllers/payment.js.map b/dist/src/controllers/payment.js.map index 0eed230..b6be6f0 100644 --- a/dist/src/controllers/payment.js.map +++ b/dist/src/controllers/payment.js.map @@ -1 +1 @@ -{"version":3,"file":"payment.js","sourceRoot":"","sources":["../../../src/controllers/payment.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,gCAAyC;AACzC,0CAAyC;AACzC,2CAA0C;AAC1C,sCAAqC;AACrC,sCAA+C;AAC/C,wCAA4C;AAC5C,sCAAqC;AACrC,oCAAmC;AACnC,4CAAoC;AACpC,yCAA8B;AAC9B,iCAAuC;AAE1B,QAAA,WAAW,GAAG,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;IAC5C,MAAM,EACJ,MAAM,EACN,OAAO,EACP,UAAU,EACV,eAAe,EACf,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,WAAW,EACX,UAAU,EACV,eAAe,EACf,WAAW,EACX,UAAU,GACX,GAAG,GAAG,CAAC,IAAI,CAAA;IAEZ,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,GAAG,CAAC,IAAI,CAAC,CAAA;IAEvC,MAAM,KAAK,GAAG,MAAM,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAC,CAAC,CAAA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,CAAC,OAAO;6BAChC,EAAC;qBACH;oBACD;wBACE,IAAI,EAAG,EAAC,CAAC,cAAE,CAAC,EAAE,CAAC,EAAE;gCACf,mBAAS,CAAC,aAAa,CAAC,OAAO;gCAC/B,mBAAS,CAAC,aAAa,CAAC,KAAK;6BAC9B,EAAC;wBACF,MAAM,EAAE;4BACN,CAAC,cAAE,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,eAAe;yBACjC;wBACD,YAAY,EAAE,mBAAS,CAAC,aAAa,CAAC,SAAS;qBAChD;iBACF;aACF;YACD,KAAK,EAAE,CAAC,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;YAC9B,KAAK;YACL,MAAM;SACP,CAAC,CAAA;QACF,MAAM,GAAG,GAAG,IAAI,IAAE,EAAE,CAAA;QACpB,aAAO,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,OAAO,CAAA,EAAE,CAAC,SAAS,CAAC,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,CAAA;KACxE;IAAC,OAAM,CAAC,EAAE;QACT,aAAO,CAAC,GAAG,EAAE,oBAAoB,CAAC,CAAA;KACnC;AACH,CAAC,CAAA,CAAC"} \ No newline at end of file diff --git a/src/controllers/media.ts b/src/controllers/media.ts index 7722c2d..cb63436 100644 --- a/src/controllers/media.ts +++ b/src/controllers/media.ts @@ -195,7 +195,8 @@ export const purchase = async (req, res) => { mediaToken: media_token, date: date, createdAt: date, - updatedAt: date + updatedAt: date, + network_type: constants.network_types.lightning }) const msg={ diff --git a/src/controllers/messages.ts b/src/controllers/messages.ts index 60c33c2..572fca4 100644 --- a/src/controllers/messages.ts +++ b/src/controllers/messages.ts @@ -177,7 +177,7 @@ export const sendMessage = async (req, res) => { // IF BOOST AND TRIBE OWNER NEED TO SEND ACTUAL SATS TO OG POSTER const isTribe = chat.type===constants.chat_types.tribe const isTribeOwner = isTribe && owner.publicKey===chat.ownerPubkey - if((!isTribe || isTribeOwner) && reply_uuid && boost && amount) { + if(isTribeOwner && reply_uuid && boost && amount) { const ogMsg = await models.Message.findOne({where:{ uuid: reply_uuid, }}) @@ -200,13 +200,12 @@ export const sendMessage = async (req, res) => { status: constants.statuses.pending, createdAt: date, updatedAt: date, - network_type: realSatsContactId ? + network_type: (!isTribe || realSatsContactId) ? constants.network_types.lightning : constants.network_types.mqtt } if(reply_uuid) msg.replyUuid=reply_uuid // console.log(msg) - console.log("=> SAVED MSG",JSON.stringify(msg,null,2)) const message = await models.Message.create(msg) success(res, jsonUtils.messageToJson(message, chat)) diff --git a/src/controllers/payment.ts b/src/controllers/payment.ts index 606c820..725b964 100644 --- a/src/controllers/payment.ts +++ b/src/controllers/payment.ts @@ -63,7 +63,8 @@ export const sendPayment = async (req, res) => { amountMsat: parseFloat(amount) * 1000, date: date, createdAt: date, - updatedAt: date + updatedAt: date, + network_type: constants.network_types.lightning, } if(text) msg.messageContent = text if(remote_text) msg.remoteMessageContent = remote_text From 43b7cd9776d0b134aeebfbe7b814d632aee562fb Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Tue, 24 Nov 2020 11:35:59 -0800 Subject: [PATCH 32/38] fix boost for tribe sub --- app.ts | 1 + dist/app.js | 1 + dist/app.js.map | 2 +- dist/src/auth.js | 4 ++++ dist/src/auth.js.map | 2 +- dist/src/controllers/messages.js | 8 +++----- dist/src/controllers/messages.js.map | 2 +- src/auth.ts | 5 +++++ src/controllers/messages.ts | 8 +++----- 9 files changed, 20 insertions(+), 13 deletions(-) diff --git a/app.ts b/app.ts index 5013999..a724c2a 100644 --- a/app.ts +++ b/app.ts @@ -80,6 +80,7 @@ async function setupApp(){ app.post('/unlock', async function(req,res){ const ok = await unlocker(req,res) if(ok) { + console.log('=> relay unlocked!') controllers.set(app); socket.connect(server) } diff --git a/dist/app.js b/dist/app.js index 305f785..2e68cc1 100644 --- a/dist/app.js +++ b/dist/app.js @@ -93,6 +93,7 @@ function setupApp() { return __awaiter(this, void 0, void 0, function* () { const ok = yield auth_1.unlocker(req, res); if (ok) { + console.log('=> relay unlocked!'); controllers.set(app); socket.connect(server); } diff --git a/dist/app.js.map b/dist/app.js.map index 0f4a1a3..2b5bcc5 100644 --- a/dist/app.js.map +++ b/dist/app.js.map @@ -1 +1 @@ -{"version":3,"file":"app.js","sourceRoot":"","sources":["../app.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,mCAAkC;AAClC,0CAAyC;AACzC,iCAAgC;AAChC,8CAA6C;AAC7C,6BAA4B;AAC5B,6BAA4B;AAC5B,+CAAuC;AACvC,mCAAkE;AAClE,6CAA0D;AAC1D,iDAAgD;AAChD,6CAA4C;AAC5C,yCAAwC;AACxC,qCAA+C;AAC/C,mCAAkC;AAElC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AACrE,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,IAAI,IAAI,MAAM,CAAC,cAAc,IAAI,IAAI,CAAA;AAE9D,OAAO,CAAC,GAAG,CAAC,SAAS,EAAC,GAAG,CAAC,CAAA;AAC1B,OAAO,CAAC,GAAG,CAAC,sBAAsB,EAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;AACpD,OAAO,CAAC,GAAG,CAAC,2BAA2B,EAAC,MAAM,CAAC,cAAc,CAAC,CAAA;AAE9D,OAAO,CAAC,GAAG,CAAC,sBAAsB,GAAG,YAAY,CAAA;AAEjD,eAAe;AACf,SAAe,KAAK;;QACnB,MAAM,qBAAa,EAAE,CAAA;QACrB,YAAY,EAAE,CAAA;QACd,qBAAe,CAAC,KAAK,CAAC,CAAA;IACvB,CAAC;CAAA;AACD,KAAK,EAAE,CAAA;AAEP,SAAe,YAAY;;QAC1B,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,E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C,GAAG,CAAC,CAAA;oBAClC,IAAG,EAAE,EAAE;wBACN,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC,CAAA;wBACjC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;wBACrB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;qBACtB;gBACF,CAAC;aAAA,CAAC,CAAA;SACF;IACF,CAAC;CAAA"} \ No newline at end of file diff --git a/dist/src/auth.js b/dist/src/auth.js index 7df83e9..2c9be40 100644 --- a/dist/src/auth.js +++ b/dist/src/auth.js @@ -18,6 +18,10 @@ const macaroon_1 = require("./utils/macaroon"); const fs = require('fs'); const env = process.env.NODE_ENV || 'development'; const config = require(path.join(__dirname, '../config/app.json'))[env]; +/* +"unlock": true, +"encrypted_macaroon_path": "/relay/.lnd/admin.macaroon.enc" +*/ function unlocker(req, res) { return __awaiter(this, void 0, void 0, function* () { const { password } = req.body; diff --git a/dist/src/auth.js.map b/dist/src/auth.js.map index ed5dfe9..2110267 100644 --- a/dist/src/auth.js.map +++ b/dist/src/auth.js.map @@ -1 +1 @@ -{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/auth.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,iCAAgC;AAChC,qCAAiC;AACjC,yCAAgC;AAChC,6BAA4B;AAC5B,qCAA8C;AAC9C,+CAAoD;AACpD,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;AAExB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAExE,SAAsB,QAAQ,CAAC,GAAG,EAAE,GAAG;;QACrC,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG,CAAC,IAAI,CAAA;QAC7B,IAAG,CAAC,QAAQ,EAAE;YACZ,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AAC,mBAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,CAAA;QAC9F,MAAM,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC,CAAA;QACrC,OAAO,aAAa,CAAA;KACrB;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,CAAC,KAAK,CAAC,6CAA6C,CAAC,CAAA;QAC5D,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QAChB,OAAO,EAAE,CAAA;KACV;AACH,CAAC;AAED,SAAgB,WAAW,CAAE,GAAG;IAC9B,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAA;IACrB,IAAI,MAAM,GAAG,EAAE,CAAA;IACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACnC,MAAM,GAAG,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;QAC1C,MAAM,IAAI,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,CAAC,CAAA;KAC/C;IACD,OAAO,MAAM,CAAC,WAAW,EAAE,CAAA;AAC7B,CAAC;AARD,kCAQC;AAED,MAAM,IAAI,GAAG,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/src/controllers/messages.js b/dist/src/controllers/messages.js index 6fc2ca4..11e494f 100644 --- a/dist/src/controllers/messages.js +++ b/dist/src/controllers/messages.js @@ -152,10 +152,8 @@ exports.sendMessage = (req, res) => __awaiter(void 0, void 0, void 0, function* recipient_id: contact_id, }); let realSatsContactId; - // IF BOOST AND TRIBE OWNER NEED TO SEND ACTUAL SATS TO OG POSTER - const isTribe = chat.type === constants_1.default.chat_types.tribe; - const isTribeOwner = isTribe && owner.publicKey === chat.ownerPubkey; - if (isTribeOwner && reply_uuid && boost && amount) { + // IF BOOST NEED TO SEND ACTUAL SATS TO OG POSTER + if (reply_uuid && boost && amount) { const ogMsg = yield models_1.models.Message.findOne({ where: { uuid: reply_uuid, } }); @@ -177,7 +175,7 @@ exports.sendMessage = (req, res) => __awaiter(void 0, void 0, void 0, function* status: constants_1.default.statuses.pending, createdAt: date, updatedAt: date, - network_type: (!isTribe || realSatsContactId) ? + network_type: realSatsContactId ? constants_1.default.network_types.lightning : constants_1.default.network_types.mqtt }; diff --git a/dist/src/controllers/messages.js.map b/dist/src/controllers/messages.js.map index 391e1d5..3623c23 100644 --- a/dist/src/controllers/messages.js.map +++ b/dist/src/controllers/messages.js.map @@ -1 +1 @@ -{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/controllers/messages.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,yCAA8B;AAC9B,2CAAoC;AACpC,gCAAyC;AACzC,0CAAyC;AACzC,2CAA0C;AAC1C,sCAAqC;AACrC,sCAA+C;AAC/C,0CAAyC;AACzC,mDAAgD;AAChD,sCAAqC;AACrC,oCAAmC;AACnC,4CAAoC;AAEvB,QAAA,WAAW,GAAG,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;IAC7C,MAAM,YAAY,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;IAEpC,IAAI,CAAC,YAAY,EAAE;QAClB,OAAO,sBAAc,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;KAC/B;IACD,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;IACzB,MAAM,KAAK,GAAG,MAAM,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,CAAC,CAAA;IACxE,mCAAmC;IAEnC,IAAI,gBAAgB,GAAG;QACtB,IAAI,EAAE,EAAE,CAAC,c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AAE,KAAK,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,CAAA;IAClE,IAAG,IAAI,EAAE;QACR,MAAM,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAClC,aAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;QAChB,sBAAgB,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;QACnC,MAAM,CAAC,QAAQ,CAAC;YACf,IAAI,EAAE,WAAW;YACjB,QAAQ,EAAE,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC;SACpC,CAAC,CAAA;KACF;SAAM;QACN,aAAO,CAAC,GAAG,EAAE,SAAS,CAAC,CAAA;KACvB;AACF,CAAC,CAAA,CAAA;AAEY,QAAA,aAAa,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IACzC,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;IAErD,aAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;AACjB,CAAC,CAAA"} \ No newline at end of file +{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/controllers/messages.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,yCAA8B;AAC9B,2CAAoC;AACpC,gCAAyC;AACzC,0CAAyC;AACzC,2CAA0C;AAC1C,sCAAqC;AACrC,sCAA+C;AAC/C,0CAAyC;AACzC,mDAAgD;AAChD,sCAAqC;AACrC,oCAAmC;AACnC,4CAAoC;AAEvB,QAAA,WAAW,GAAG,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;IAC7C,MAAM,YAAY,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;IAEpC,IAAI,CAAC,YAAY,EAAE;QAClB,OAAO,sBAAc,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;KAC/B;IACD,O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M,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,CAAA;IAClE,IAAG,IAAI,EAAE;QACR,MAAM,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAClC,aAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;QAChB,sBAAgB,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;QACnC,MAAM,CAAC,QAAQ,CAAC;YACf,IAAI,EAAE,WAAW;YACjB,QAAQ,EAAE,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC;SACpC,CAAC,CAAA;KACF;SAAM;QACN,aAAO,CAAC,GAAG,EAAE,SAAS,CAAC,CAAA;KACvB;AACF,CAAC,CAAA,CAAA;AAEY,QAAA,aAAa,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IACzC,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;IAErD,aAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;AACjB,CAAC,CAAA"} \ No newline at end of file diff --git a/src/auth.ts b/src/auth.ts index baa43b1..557b659 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -9,6 +9,11 @@ const fs = require('fs') const env = process.env.NODE_ENV || 'development'; const config = require(path.join(__dirname, '../config/app.json'))[env]; +/* +"unlock": true, +"encrypted_macaroon_path": "/relay/.lnd/admin.macaroon.enc" +*/ + export async function unlocker(req, res): Promise { const { password } = req.body if(!password) { diff --git a/src/controllers/messages.ts b/src/controllers/messages.ts index 572fca4..dc5e6d3 100644 --- a/src/controllers/messages.ts +++ b/src/controllers/messages.ts @@ -174,10 +174,8 @@ export const sendMessage = async (req, res) => { }) let realSatsContactId - // IF BOOST AND TRIBE OWNER NEED TO SEND ACTUAL SATS TO OG POSTER - const isTribe = chat.type===constants.chat_types.tribe - const isTribeOwner = isTribe && owner.publicKey===chat.ownerPubkey - if(isTribeOwner && reply_uuid && boost && amount) { + // IF BOOST NEED TO SEND ACTUAL SATS TO OG POSTER + if(reply_uuid && boost && amount) { const ogMsg = await models.Message.findOne({where:{ uuid: reply_uuid, }}) @@ -200,7 +198,7 @@ export const sendMessage = async (req, res) => { status: constants.statuses.pending, createdAt: date, updatedAt: date, - network_type: (!isTribe || realSatsContactId) ? + network_type: realSatsContactId ? constants.network_types.lightning : constants.network_types.mqtt } From 46755e523e2deee00529c5ee18e7a3696ef1fbd2 Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Tue, 24 Nov 2020 11:46:47 -0800 Subject: [PATCH 33/38] purchase typ on tx list --- app.ts | 5 +++-- dist/app.js | 7 +++---- dist/app.js.map | 2 +- dist/src/controllers/messages.js | 3 ++- dist/src/controllers/messages.js.map | 2 +- dist/src/controllers/payment.js | 1 + dist/src/controllers/payment.js.map | 2 +- src/controllers/messages.ts | 3 ++- src/controllers/payment.ts | 1 + 9 files changed, 15 insertions(+), 11 deletions(-) diff --git a/app.ts b/app.ts index a724c2a..6e727a8 100644 --- a/app.ts +++ b/app.ts @@ -32,9 +32,10 @@ async function start(){ start() async function connectToLND(){ - grpc.reconnectToLND(Math.random(), async function(){ + // await unlocker here? + grpc.reconnectToLND(Math.random(), function(){ console.log(">> SETUP MAIN") - await mainSetup() + mainSetup() }) // recursive } diff --git a/dist/app.js b/dist/app.js index 2e68cc1..e951db8 100644 --- a/dist/app.js +++ b/dist/app.js @@ -41,11 +41,10 @@ function start() { start(); function connectToLND() { return __awaiter(this, void 0, void 0, function* () { + // await unlocker here? grpc.reconnectToLND(Math.random(), function () { - return __awaiter(this, void 0, void 0, function* () { - console.log(">> SETUP MAIN"); - yield mainSetup(); - }); + console.log(">> SETUP MAIN"); + mainSetup(); }); // recursive }); } diff --git a/dist/app.js.map b/dist/app.js.map index 2b5bcc5..6e772fa 100644 --- a/dist/app.js.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AC,oBAAoB,CAAC,CAAA;wBACjC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;wBACrB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;qBACtB;gBACF,CAAC;aAAA,CAAC,CAAA;SACF;IACF,CAAC;CAAA"} \ No newline at end of file diff --git a/dist/src/controllers/messages.js b/dist/src/controllers/messages.js index 11e494f..b4f9d42 100644 --- a/dist/src/controllers/messages.js +++ b/dist/src/controllers/messages.js @@ -153,6 +153,7 @@ exports.sendMessage = (req, res) => __awaiter(void 0, void 0, void 0, function* }); let realSatsContactId; // IF BOOST NEED TO SEND ACTUAL SATS TO OG POSTER + const isTribe = chat.type === constants_1.default.chat_types.tribe; if (reply_uuid && boost && amount) { const ogMsg = yield models_1.models.Message.findOne({ where: { uuid: reply_uuid, @@ -175,7 +176,7 @@ exports.sendMessage = (req, res) => __awaiter(void 0, void 0, void 0, function* status: constants_1.default.statuses.pending, createdAt: date, updatedAt: date, - network_type: realSatsContactId ? + network_type: (!isTribe || realSatsContactId) ? constants_1.default.network_types.lightning : constants_1.default.network_types.mqtt }; diff --git a/dist/src/controllers/messages.js.map b/dist/src/controllers/messages.js.map index 3623c23..2d0715b 100644 --- a/dist/src/controllers/messages.js.map +++ b/dist/src/controllers/messages.js.map @@ -1 +1 @@ -{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/controllers/messages.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,yCAA8B;AAC9B,2CAAoC;AACpC,gCAAyC;AACzC,0CAAyC;AACzC,2CAA0C;AAC1C,sCAAqC;AACrC,sCAA+C;AAC/C,0CAAyC;AACzC,mDAAgD;AAChD,sCAAqC;AACrC,oCAAmC;AACnC,4CAAoC;AAEvB,QAAA,WAAW,GAAG,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;IAC7C,MAAM,YAAY,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;IAEpC,IAAI,CAAC,YAAY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D,MAAM,EAAE,OAAO;SAChB;KACD,CAAC,CAAC;IACH,MAAM,IAAI,GAAG,MAAM,eAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,CAAA;IAClE,IAAG,IAAI,EAAE;QACR,MAAM,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAClC,aAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;QAChB,sBAAgB,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;QACnC,MAAM,CAAC,QAAQ,CAAC;YACf,IAAI,EAAE,WAAW;YACjB,QAAQ,EAAE,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC;SACpC,CAAC,CAAA;KACF;SAAM;QACN,aAAO,CAAC,GAAG,EAAE,SAAS,CAAC,CAAA;KACvB;AACF,CAAC,CAAA,CAAA;AAEY,QAAA,aAAa,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IACzC,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;IAErD,aAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;AACjB,CAAC,CAAA"} \ No newline at end of file +{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/controllers/messages.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,yCAA8B;AAC9B,2CAAoC;AACpC,gCAAyC;AACzC,0CAAyC;AACzC,2CAA0C;AAC1C,sCAAqC;AACrC,sCAA+C;AAC/C,0CAAyC;AACzC,mDAAgD;AAChD,sCAAqC;AACrC,oCAAmC;AACnC,4CAAoC;AAEvB,QAAA,WAAW,GAAG,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;IAC7C,MAAM,YAAY,GAAG,GAAG,CAAC,KAAK,CAAC,IA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AAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;QAC3C,KAAK,EAAE;YACL,MAAM,EAAE;gBACT,CAAC,cAAE,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE;aACf;YACD,MAAM,EAAE,OAAO;SAChB;KACD,CAAC,CAAC;IACH,MAAM,IAAI,GAAG,MAAM,eAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,CAAA;IAClE,IAAG,IAAI,EAAE;QACR,MAAM,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAClC,aAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;QAChB,sBAAgB,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;QACnC,MAAM,CAAC,QAAQ,CAAC;YACf,IAAI,EAAE,WAAW;YACjB,QAAQ,EAAE,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC;SACpC,CAAC,CAAA;KACF;SAAM;QACN,aAAO,CAAC,GAAG,EAAE,SAAS,CAAC,CAAA;KACvB;AACF,CAAC,CAAA,CAAA;AAEY,QAAA,aAAa,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IACzC,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;IAErD,aAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;AACjB,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/src/controllers/payment.js b/dist/src/controllers/payment.js index 59e80be..0578089 100644 --- a/dist/src/controllers/payment.js +++ b/dist/src/controllers/payment.js @@ -164,6 +164,7 @@ exports.listPayments = (req, res) => __awaiter(void 0, void 0, void 0, function* constants_1.default.message_types.payment, constants_1.default.message_types.direct_payment, constants_1.default.message_types.keysend, + constants_1.default.message_types.purchase, ] } }, { diff --git a/dist/src/controllers/payment.js.map b/dist/src/controllers/payment.js.map index b6be6f0..009a8bc 100644 --- a/dist/src/controllers/payment.js.map +++ b/dist/src/controllers/payment.js.map @@ -1 +1 @@ -{"version":3,"file":"payment.js","sourceRoot":"","sources":["../../../src/controllers/payment.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,gCAAyC;AACzC,0CAAyC;AACzC,2CAA0C;AAC1C,sCAAqC;AACrC,sCAA+C;AAC/C,wCAA4C;AAC5C,sCAAqC;AACrC,oCAAmC;AACnC,4CAAoC;AACpC,yCAA8B;AAC9B,iCAAuC;AAE1B,QAAA,WAAW,GAAG,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;IAC5C,MAAM,EACJ,MAAM,EACN,OAAO,EACP,UAAU,EACV,eAAe,EACf,UAAU,EACV,IAAI,EACJ,IAAI,EACJ,WAAW,EACX,UAAU,EACV,eAAe,EACf,WAAW,EACX,UAAU,GACX,GAAG,GAAG,CAAC,IAAI,CAAA;IAEZ,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,GAAG,CAAC,IAAI,CAAC,CAAA;IAEvC,MAAM,KAAK,GAAG,MAAM,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,EAAC,CAAC,CAAA;IAEvE,IAAI,eAAe,IAAI,CAAC,UAAU,IAAI,CAAC,OAAO,EAAE;QAC9C,uBAAgB,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,IAAE,EAAE,EAAE,IAAI,IAAE,EAAE,EAC3D,UAAS,IAAI;YACX,aAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAA;QACpB,CAAC,EACD,UAAS,KAAK;YACZ,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YAChB,GAAG,CAAC,IAAI,CAAC,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;YACpC,GAA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AAC,cAAE,CAAC,EAAE,CAAC,EAAE;gCACd,mBAAS,CAAC,aAAa,CAAC,OAAO;gCAC/B,mBAAS,CAAC,aAAa,CAAC,cAAc;gCACtC,mBAAS,CAAC,aAAa,CAAC,OAAO;6BAChC,EAAC;qBACH;oBACD;wBACE,IAAI,EAAG,EAAC,CAAC,cAAE,CAAC,EAAE,CAAC,EAAE;gCACf,mBAAS,CAAC,aAAa,CAAC,OAAO;gCAC/B,mBAAS,CAAC,aAAa,CAAC,KAAK;6BAC9B,EAAC;wBACF,MAAM,EAAE;4BACN,CAAC,cAAE,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,eAAe;yBACjC;wBACD,YAAY,EAAE,mBAAS,CAAC,aAAa,CAAC,SAAS;qBAChD;iBACF;aACF;YACD,KAAK,EAAE,CAAC,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;YAC9B,KAAK;YACL,MAAM;SACP,CAAC,CAAA;QACF,MAAM,GAAG,GAAG,IAAI,IAAE,EAAE,CAAA;QACpB,aAAO,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,OAAO,CAAA,EAAE,CAAC,SAAS,CAAC,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,CAAA;KACxE;IAAC,OAAM,CAAC,EAAE;QACT,aAAO,CAAC,GAAG,EAAE,oBAAoB,CAAC,CAAA;KACnC;AACH,CAAC,CAAA,CAAC"} \ No newline at end of file +{"version":3,"file":"payment.js","sourceRoot":"","sources":["../../../src/controllers/payment.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,gCAAyC;AACzC,0CAAyC;AACzC,2CAA0C;AAC1C,sCAAqC;AACrC,sCAA+C;AAC/C,wCAA4C;AAC5C,sCAAqC;AACrC,oCAAmC;AACnC,4CAAoC;AACpC,yCAA8B;AAC9B,iCAAuC;AAE1B,QAAA,WAAW,GAAG,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;IAC5C,MAAM,EACJ,MA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S,CAAC,aAAa,CAAC,SAAS;qBAChD;iBACF;aACF;YACD,KAAK,EAAE,CAAC,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;YAC9B,KAAK;YACL,MAAM;SACP,CAAC,CAAA;QACF,MAAM,GAAG,GAAG,IAAI,IAAE,EAAE,CAAA;QACpB,aAAO,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,OAAO,CAAA,EAAE,CAAC,SAAS,CAAC,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC,CAAC,CAAA;KACxE;IAAC,OAAM,CAAC,EAAE;QACT,aAAO,CAAC,GAAG,EAAE,oBAAoB,CAAC,CAAA;KACnC;AACH,CAAC,CAAA,CAAC"} \ No newline at end of file diff --git a/src/controllers/messages.ts b/src/controllers/messages.ts index dc5e6d3..a66353a 100644 --- a/src/controllers/messages.ts +++ b/src/controllers/messages.ts @@ -175,6 +175,7 @@ export const sendMessage = async (req, res) => { let realSatsContactId // IF BOOST NEED TO SEND ACTUAL SATS TO OG POSTER + const isTribe = chat.type===constants.chat_types.tribe if(reply_uuid && boost && amount) { const ogMsg = await models.Message.findOne({where:{ uuid: reply_uuid, @@ -198,7 +199,7 @@ export const sendMessage = async (req, res) => { status: constants.statuses.pending, createdAt: date, updatedAt: date, - network_type: realSatsContactId ? + network_type: (!isTribe || realSatsContactId) ? constants.network_types.lightning : constants.network_types.mqtt } diff --git a/src/controllers/payment.ts b/src/controllers/payment.ts index 725b964..8b9a4f6 100644 --- a/src/controllers/payment.ts +++ b/src/controllers/payment.ts @@ -180,6 +180,7 @@ export const listPayments = async (req, res) => { constants.message_types.payment, constants.message_types.direct_payment, constants.message_types.keysend, + constants.message_types.purchase, ]} }, { From 8e8090d47c81d2ae444e4425125206b5e2e8e4be Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Tue, 24 Nov 2020 11:54:26 -0800 Subject: [PATCH 34/38] cofigurable main setup --- app.ts | 94 ++++++++++++++++++++++++++----------------------- dist/app.js | 22 ++++++------ dist/app.js.map | 2 +- 3 files changed, 63 insertions(+), 55 deletions(-) diff --git a/app.ts b/app.ts index 6e727a8..4297d05 100644 --- a/app.ts +++ b/app.ts @@ -26,65 +26,71 @@ process.env.GRPC_SSL_CIPHER_SUITES = 'HIGH+ECDSA' // START SETUP! async function start(){ await setupDatabase() - connectToLND() - pingHubInterval(15000) + mainSetup() + if (config.hub_api_url) { + pingHubInterval(15000) + } } start() -async function connectToLND(){ - // await unlocker here? +async function mainSetup(){ + await setupApp() // setup routes grpc.reconnectToLND(Math.random(), function(){ - console.log(">> SETUP MAIN") - mainSetup() + console.log(">> FINISH SETUP") + finishSetup() }) // recursive } -async function mainSetup(){ +async function finishSetup(){ await network.initTribesSubscriptions() if (config.hub_api_url) { - // pingHubInterval(15000) checkInvitesHubInterval(5000) } - await setupApp() setupDone() } -async function setupApp(){ - const app = express(); - const server = require("http").Server(app); +function setupApp(){ + return new Promise(resolve=>{ - app.use(helmet()); - app.use(bodyParser.json()); - app.use(bodyParser.urlencoded({ extended: true })); - app.use(logger) - app.use(cors({ - allowedHeaders:['X-Requested-With','Content-Type','Accept','x-user-token'] - })) - app.use(cookieParser()) - if (env != 'development') { - app.use(authModule); - } - app.use('/static', express.static('public')); - app.get('/app', (req, res) => res.send('INDEX')) + const app = express(); + const server = require("http").Server(app); - server.listen(port, (err) => { - if (err) throw err; - /* eslint-disable no-console */ - console.log(`Node listening on ${port}.`); - }); + app.use(helmet()); + app.use(bodyParser.json()); + app.use(bodyParser.urlencoded({ extended: true })); + app.use(logger) + app.use(cors({ + allowedHeaders:['X-Requested-With','Content-Type','Accept','x-user-token'] + })) + app.use(cookieParser()) + if (env != 'development') { + app.use(authModule); + } + app.use('/static', express.static('public')); + app.get('/app', (req, res) => res.send('INDEX')) - // start all routes! - if(!config.unlock) { - controllers.set(app); - socket.connect(server) - } else { - app.post('/unlock', async function(req,res){ - const ok = await unlocker(req,res) - if(ok) { - console.log('=> relay unlocked!') - controllers.set(app); - socket.connect(server) - } - }) - } + server.listen(port, (err) => { + if (err) throw err; + /* eslint-disable no-console */ + console.log(`Node listening on ${port}.`); + }); + + // start all routes! + if(!config.unlock) { + controllers.set(app); + socket.connect(server) + resolve() + } else { + app.post('/unlock', async function(req,res){ + const ok = await unlocker(req,res) + if(ok) { + console.log('=> relay unlocked!') + controllers.set(app); + socket.connect(server) + resolve() + } + }) + } + + }) } diff --git a/dist/app.js b/dist/app.js index e951db8..d421570 100644 --- a/dist/app.js +++ b/dist/app.js @@ -34,33 +34,33 @@ process.env.GRPC_SSL_CIPHER_SUITES = 'HIGH+ECDSA'; function start() { return __awaiter(this, void 0, void 0, function* () { yield setup_1.setupDatabase(); - connectToLND(); - hub_1.pingHubInterval(15000); + mainSetup(); + if (config.hub_api_url) { + hub_1.pingHubInterval(15000); + } }); } start(); -function connectToLND() { +function mainSetup() { return __awaiter(this, void 0, void 0, function* () { - // await unlocker here? + yield setupApp(); // setup routes grpc.reconnectToLND(Math.random(), function () { - console.log(">> SETUP MAIN"); - mainSetup(); + console.log(">> FINISH SETUP"); + finishSetup(); }); // recursive }); } -function mainSetup() { +function finishSetup() { return __awaiter(this, void 0, void 0, function* () { yield network.initTribesSubscriptions(); if (config.hub_api_url) { - // pingHubInterval(15000) hub_1.checkInvitesHubInterval(5000); } - yield setupApp(); setup_1.setupDone(); }); } function setupApp() { - return __awaiter(this, void 0, void 0, function* () { + return new Promise(resolve => { const app = express(); const server = require("http").Server(app); app.use(helmet()); @@ -86,6 +86,7 @@ function setupApp() { if (!config.unlock) { controllers.set(app); socket.connect(server); + resolve(); } else { app.post('/unlock', function (req, res) { @@ -95,6 +96,7 @@ function setupApp() { console.log('=> relay unlocked!'); controllers.set(app); socket.connect(server); + resolve(); } }); }); diff --git a/dist/app.js.map b/dist/app.js.map index 6e772fa..034b93f 100644 --- a/dist/app.js.map +++ b/dist/app.js.map @@ -1 +1 @@ -{"version":3,"file":"app.js","sourceRoot":"","sources":["../app.ts"],"names":[],"mappings":";;;;;;;;;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,oBAAoB,CAAC,CAAA;wBACjC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;wBACrB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;wBACtB,OAAO,EAAE,CAAA;qBACT;gBACF,CAAC;aAAA,CAAC,CAAA;SACF;IAEF,CAAC,CAAC,CAAA;AACH,CAAC"} \ No newline at end of file From dfe403174da1bd535fb1bb6b4a00f6c9104f92b6 Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Tue, 24 Nov 2020 12:07:13 -0800 Subject: [PATCH 35/38] price_per_message in pay tx, expose voltage unlock --- dist/src/auth.js | 1 + dist/src/auth.js.map | 2 +- dist/src/controllers/messages.js | 3 ++- dist/src/controllers/messages.js.map | 2 +- src/auth.ts | 1 + src/controllers/messages.ts | 4 +++- src/controllers/payment.ts | 2 +- 7 files changed, 10 insertions(+), 5 deletions(-) diff --git a/dist/src/auth.js b/dist/src/auth.js index 2c9be40..7b87066 100644 --- a/dist/src/auth.js +++ b/dist/src/auth.js @@ -68,6 +68,7 @@ function authModule(req, res, next) { return __awaiter(this, void 0, void 0, function* () { if (req.path == '/app' || req.path == '/' || + req.path == '/unlock' || req.path == '/info' || req.path == '/action' || req.path == '/contacts/tokens' || diff --git a/dist/src/auth.js.map b/dist/src/auth.js.map index 2110267..83e38aa 100644 --- a/dist/src/auth.js.map +++ b/dist/src/auth.js.map @@ -1 +1 @@ -{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/auth.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,iCAAgC;AAChC,qCAAiC;AACjC,yCAAgC;AAChC,6BAA4B;AAC5B,qCAA8C;AAC9C,+CAAoD;AACpD,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;AAExB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS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dist/src/controllers/messages.js index b4f9d42..669b4a2 100644 --- a/dist/src/controllers/messages.js +++ b/dist/src/controllers/messages.js @@ -162,6 +162,7 @@ exports.sendMessage = (req, res) => __awaiter(void 0, void 0, void 0, function* realSatsContactId = ogMsg.sender; } } + const hasRealAmount = amount && amount > constants_1.default.min_sat_amount; const remoteMessageContent = remote_text_map ? JSON.stringify(remote_text_map) : remote_text; const uuid = short.generate(); const msg = { @@ -176,7 +177,7 @@ exports.sendMessage = (req, res) => __awaiter(void 0, void 0, void 0, function* status: constants_1.default.statuses.pending, createdAt: date, updatedAt: date, - network_type: (!isTribe || realSatsContactId) ? + network_type: (!isTribe || hasRealAmount || realSatsContactId) ? constants_1.default.network_types.lightning : constants_1.default.network_types.mqtt }; diff --git a/dist/src/controllers/messages.js.map b/dist/src/controllers/messages.js.map index 2d0715b..27b1b71 100644 --- a/dist/src/controllers/messages.js.map +++ b/dist/src/controllers/messages.js.map @@ -1 +1 @@ -{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/controllers/messages.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,yCAA8B;AAC9B,2CAAoC;AACpC,gCAAyC;AACzC,0CAAyC;AACzC,2CAA0C;AAC1C,sCAAqC;AACrC,sCAA+C;AAC/C,0CAAyC;AACzC,mDAAgD;AAChD,sCAAqC;AACrC,oCAAmC;AACnC,4CAAoC;AAEvB,QAAA,WAAW,GAAG,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;IAC7C,MAAM,YAAY,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;IAEpC,IAAI,CAAC,YAAY,EAAE;QAClB,OAAO,sBAAc,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;KAC/B;IACD,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;IACzB,MAAM,KAAK,GAAG,MAAM,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,IA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AC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,CAAA;IAClE,IAAG,IAAI,EAAE;QACR,MAAM,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAClC,aAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;QAChB,sBAAgB,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;QACnC,MAAM,CAAC,QAAQ,CAAC;YACf,IAAI,EAAE,WAAW;YACjB,QAAQ,EAAE,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC;SACpC,CAAC,CAAA;KACF;SAAM;QACN,aAAO,CAAC,GAAG,EAAE,SAAS,CAAC,CAAA;KACvB;AACF,CAAC,CAAA,CAAA;AAEY,QAAA,aAAa,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IACzC,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;IAErD,aAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;AACjB,CAAC,CAAA"} \ No newline at end of file +{"version":3,"file":"messages.js","sourceRoot":"","sources":["../../../src/controllers/messages.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAgC;AAChC,yCAA8B;AAC9B,2CAAoC;AACpC,gCAAyC;AACzC,0CAAyC;AACzC,2CAA0C;AAC1C,sCAAqC;AACrC,sCAA+C;AAC/C,0CAAyC;AACzC,mDAAgD;AAChD,sCAAqC;AACrC,oCAAmC;AACnC,4CAAoC;AAEvB,QAAA,WAAW,GAAG,CAAO,GAAG,EAAE,GAAG,EAAE,EAAE;IAC7C,MAAM,YAAY,GAAG,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC;IAEpC,IAAI,CAAC,YAAY,EAAE;QAClB,OAAO,sBAAc,CAAC,GAAG,EAAE,GAAG,CAAC,CAAA;KAC/B;I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AAI,EAAE,IAAI,EAAE,EAAE;QAC3C,KAAK,EAAE;YACL,MAAM,EAAE;gBACT,CAAC,cAAE,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,EAAE;aACf;YACD,MAAM,EAAE,OAAO;SAChB;KACD,CAAC,CAAC;IACH,MAAM,IAAI,GAAG,MAAM,eAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,CAAC,CAAA;IAClE,IAAG,IAAI,EAAE;QACR,MAAM,IAAI,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;QAClC,aAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;QAChB,sBAAgB,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAA;QACnC,MAAM,CAAC,QAAQ,CAAC;YACf,IAAI,EAAE,WAAW;YACjB,QAAQ,EAAE,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC;SACpC,CAAC,CAAA;KACF;SAAM;QACN,aAAO,CAAC,GAAG,EAAE,SAAS,CAAC,CAAA;KACvB;AACF,CAAC,CAAA,CAAA;AAEY,QAAA,aAAa,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;IACzC,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;IAErD,aAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAA;AACjB,CAAC,CAAA"} \ No newline at end of file diff --git a/src/auth.ts b/src/auth.ts index 557b659..66411d8 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -64,6 +64,7 @@ export async function authModule(req, res, next) { if ( req.path == '/app' || req.path == '/' || + req.path == '/unlock' || req.path == '/info' || req.path == '/action' || req.path == '/contacts/tokens' || diff --git a/src/controllers/messages.ts b/src/controllers/messages.ts index a66353a..9e4ed40 100644 --- a/src/controllers/messages.ts +++ b/src/controllers/messages.ts @@ -185,6 +185,8 @@ export const sendMessage = async (req, res) => { } } + const hasRealAmount = amount && amount>constants.min_sat_amount + const remoteMessageContent = remote_text_map?JSON.stringify(remote_text_map) : remote_text const uuid = short.generate() const msg:{[k:string]:any}={ @@ -199,7 +201,7 @@ export const sendMessage = async (req, res) => { status: constants.statuses.pending, createdAt: date, updatedAt: date, - network_type: (!isTribe || realSatsContactId) ? + network_type: (!isTribe || hasRealAmount || realSatsContactId) ? constants.network_types.lightning : constants.network_types.mqtt } diff --git a/src/controllers/payment.ts b/src/controllers/payment.ts index 8b9a4f6..6e3370a 100644 --- a/src/controllers/payment.ts +++ b/src/controllers/payment.ts @@ -185,7 +185,7 @@ export const listPayments = async (req, res) => { }, { type: {[Op.or]: [ - constants.message_types.message, // paid bot msgs + constants.message_types.message, // paid bot msgs, or price_per_message msgs constants.message_types.boost, ]}, amount: { From cf65c466c5085f48b2a6d4f5036cf86e287cc3fa Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Tue, 24 Nov 2020 12:10:15 -0800 Subject: [PATCH 36/38] import cryptojs --- dist/src/auth.js | 4 ++-- dist/src/auth.js.map | 2 +- src/auth.ts | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/src/auth.js b/dist/src/auth.js index 7b87066..d256a49 100644 --- a/dist/src/auth.js +++ b/dist/src/auth.js @@ -11,7 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge Object.defineProperty(exports, "__esModule", { value: true }); const crypto = require("crypto"); const models_1 = require("./models"); -const crypto_js_1 = require("crypto-js"); +const cryptoJS = require("crypto-js"); const path = require("path"); const res_1 = require("./utils/res"); const macaroon_1 = require("./utils/macaroon"); @@ -110,7 +110,7 @@ function authModule(req, res, next) { exports.authModule = authModule; function decryptMacaroon(password, macaroon) { try { - const decrypted = crypto_js_1.default.AES.decrypt(macaroon || '', password).toString(crypto_js_1.default.enc.Base64); + const decrypted = cryptoJS.AES.decrypt(macaroon || '', password).toString(cryptoJS.enc.Base64); const decryptResult = atob(decrypted); return decryptResult; } diff --git a/dist/src/auth.js.map b/dist/src/auth.js.map index 83e38aa..64807f9 100644 --- a/dist/src/auth.js.map +++ b/dist/src/auth.js.map @@ -1 +1 @@ -{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/auth.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,iCAAgC;AAChC,qCAAiC;AACjC,yCAAgC;AAChC,6BAA4B;AAC5B,qCAA8C;AAC9C,+CAAoD;AACpD,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;AAExB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAExE;;;EAGE;AAEF,SAAsB,QAAQ,CAAC,GAAG,EAAE,GAAG;;QACrC,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG,CAAC,IAAI,CAAA;QAC7B,IAAG,CAAC,QAAQ,EAAE;YACZ,aAAO,CAAC,GAAG,EAAE,aAAa,CAAC,CAAA;YAC3B,OAAO,KAAK,CAAA;SACb;QAED,MAAM,UAAU,GAAG,MAAM,CAAC,uBAAuB,CAAA;QACjD,IAAG,CAAC,UAAU,EAAE;YACd,aAAO,CAAC,GAAG,EAAE,kBAAkB,CAAC,CAAA;YAChC,OAAO,KAAK,CAAA;SACb;QAED,IAAI,MAAa,CAAA;QAEjB,IAAI;YAEF,IAAI,MAAM,GAAG,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC;YAC7D,IAAG,CAAC,MAAM,EAAE;gBACV,aAAO,CAAC,GAAG,EAAE,aAAa,CAAC,CAAA;gBAC3B,OAAO,KAAK,CAAA;aACb;YAED,MAAM,MAAM,GAAG,eAAe,CAA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ACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACnC,MAAM,GAAG,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;QAC1C,MAAM,IAAI,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,CAAC,CAAA;KAC/C;IACD,OAAO,MAAM,CAAC,WAAW,EAAE,CAAA;AAC7B,CAAC;AARD,kCAQC;AAED,MAAM,IAAI,GAAG,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA"} \ No newline at end of file diff --git a/src/auth.ts b/src/auth.ts index 66411d8..a00dc21 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -1,6 +1,6 @@ import * as crypto from 'crypto' import { models } from './models' -import cryptoJS from 'crypto-js' +import * as cryptoJS from 'crypto-js' import * as path from 'path' import { success, failure } from './utils/res' import {setInMemoryMacaroon} from './utils/macaroon' From 14ce9f13feb0a28c3617f935e01fbabae54d5ea8 Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Tue, 24 Nov 2020 12:12:50 -0800 Subject: [PATCH 37/38] log --- dist/src/auth.js | 2 ++ dist/src/auth.js.map | 2 +- src/auth.ts | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/dist/src/auth.js b/dist/src/auth.js index d256a49..8e09549 100644 --- a/dist/src/auth.js +++ b/dist/src/auth.js @@ -41,6 +41,8 @@ function unlocker(req, res) { res_1.failure(res, 'no macaroon'); return false; } + console.log("PWD", password, typeof password); + console.log("ENCMAC", encMac, typeof encMac); const decMac = decryptMacaroon(password, encMac); if (!decMac) { res_1.failure(res, 'failed to decrypt macaroon'); diff --git a/dist/src/auth.js.map b/dist/src/auth.js.map index 64807f9..789012d 100644 --- a/dist/src/auth.js.map +++ b/dist/src/auth.js.map @@ -1 +1 @@ -{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/auth.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,iCAAgC;AAChC,qCAAiC;AACjC,sCAAqC;AACrC,6BAA4B;AAC5B,qCAA8C;AAC9C,+CAAoD;AACpD,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;AAExB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAExE;;;EAGE;AAEF,SAAsB,QAAQ,CAAC,GAAG,EAAE,GAAG;;QACrC,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG,CAAC,IAAI,CAAA;QAC7B,IAAG,CAAC,QAAQ,EAAE;YACZ,aAAO,CAAC,GAAG,EAAE,aAAa,CAAC,CAAA;YAC3B,OAAO,KAAK,CAAA;SACb;QAED,MAAM,UAAU,GAAG,MAAM,CAAC,uBAAuB,CAAA;QACjD,IAAG,CAAC,UAAU,EAAE;YACd,aAAO,CAAC,GAAG,EAAE,kBAAkB,CAAC,CAAA;YAChC,OAAO,KAAK,CAAA;SACb;QAED,IAAI,MAAa,CAAA;QAEjB,IAAI;YAEF,IAAI,MAAM,GAAG,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC;YAC7D,IAAG,CAAC,MAAM,EAAE;gBACV,aAAO,CAAC,GAAG,EAAE,aAAa,CAAC,CAAA;gBAC3B,OAAO,KAAK,CAAA;aACb;YAED,MAAM,MAAM,GAAG,eAAe,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;YAChD,IAAG,CAAC,MAAM,EAAE;gBACV,aAAO,CAAC,GAAG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GAAG,IAAI,CAAC,GAAG,CAAC,CAAA;IACrB,IAAI,MAAM,GAAG,EAAE,CAAA;IACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACnC,MAAM,GAAG,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;QAC1C,MAAM,IAAI,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,CAAC,CAAA;KAC/C;IACD,OAAO,MAAM,CAAC,WAAW,EAAE,CAAA;AAC7B,CAAC;AARD,kCAQC;AAED,MAAM,IAAI,GAAG,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA"} \ No newline at end of file diff --git a/src/auth.ts b/src/auth.ts index a00dc21..83445ce 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -37,6 +37,8 @@ export async function unlocker(req, res): Promise { return false } + console.log("PWD",password,typeof password) + console.log("ENCMAC",encMac,typeof encMac) const decMac = decryptMacaroon(password, encMac) if(!decMac) { failure(res, 'failed to decrypt macaroon') From c6cbc11c149fae9fd556f56bb2901487fb6dd23b Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Tue, 24 Nov 2020 12:16:59 -0800 Subject: [PATCH 38/38] decode mac utf8 --- dist/src/auth.js | 2 +- dist/src/auth.js.map | 2 +- src/auth.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/src/auth.js b/dist/src/auth.js index 8e09549..190162f 100644 --- a/dist/src/auth.js +++ b/dist/src/auth.js @@ -36,7 +36,7 @@ function unlocker(req, res) { } let hexMac; try { - var encMac = fs.readFileSync(config.encrypted_macaroon_path); + var encMac = fs.readFileSync(config.encrypted_macaroon_path, "utf8"); if (!encMac) { res_1.failure(res, 'no macaroon'); return false; diff --git a/dist/src/auth.js.map b/dist/src/auth.js.map index 789012d..c3be911 100644 --- a/dist/src/auth.js.map +++ b/dist/src/auth.js.map @@ -1 +1 @@ -{"version":3,"file":"auth.js","sourceRoot":"","sources":["../../src/auth.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,iCAAgC;AAChC,qCAAiC;AACjC,sCAAqC;AACrC,6BAA4B;AAC5B,qCAA8C;AAC9C,+CAAoD;AACpD,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;AAExB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,oBAAoB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAExE;;;EAGE;AAEF,SAAsB,QAAQ,CAAC,GAAG,EAAE,GAAG;;QACrC,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG,CAAC,IAAI,CAAA;QAC7B,IAAG,CAAC,QAAQ,EAAE;YACZ,aAAO,CAAC,GAAG,EAAE,aAAa,CAAC,CAAA;YAC3B,OAAO,KAAK,CAAA;SACb;QAED,MAAM,UAAU,GAAG,MAAM,CAAC,uBAAuB,CAAA;QACjD,IAAG,CAAC,UAAU,EAAE;YACd,aAAO,CAAC,GAAG,EAAE,kBAAkB,CAAC,CAAA;YAChC,OAAO,KAAK,CAAA;SACb;QAED,IAAI,MAAa,CAAA;QAEjB,IAAI;YAEF,IAAI,MAAM,GAAG,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,uBAAuB,CAAC,CAAC;YAC7D,IAAG,CAAC,MAAM,EAAE;gBACV,aAAO,CAAC,GAAG,EAAE,aAAa,CAAC,CAAA;gBAC3B,OAAO,KAAK,CAAA;aACb;YAED,OAAO,CAAC,GAAG,CAAC,KAAK,EAAC,QAAQ,EAAC,O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,OAAO,aAAa,CAAA;KACrB;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,CAAC,KAAK,CAAC,6CAA6C,CAAC,CAAA;QAC5D,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;QAChB,OAAO,EAAE,CAAA;KACV;AACH,CAAC;AAED,SAAgB,WAAW,CAAE,GAAG;IAC9B,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAA;IACrB,IAAI,MAAM,GAAG,EAAE,CAAA;IACf,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACnC,MAAM,GAAG,GAAG,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAA;QAC1C,MAAM,IAAI,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,CAAC,CAAA;KAC/C;IACD,OAAO,MAAM,CAAC,WAAW,EAAE,CAAA;AAC7B,CAAC;AARD,kCAQC;AAED,MAAM,IAAI,GAAG,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA"} \ No newline at end of file diff --git a/src/auth.ts b/src/auth.ts index 83445ce..053a80b 100644 --- a/src/auth.ts +++ b/src/auth.ts @@ -31,7 +31,7 @@ export async function unlocker(req, res): Promise { try { - var encMac = fs.readFileSync(config.encrypted_macaroon_path); + var encMac = fs.readFileSync(config.encrypted_macaroon_path, "utf8"); if(!encMac) { failure(res, 'no macaroon') return false