From fbe3d5b294c0b7127f1206e3b3a2407071d5250f Mon Sep 17 00:00:00 2001 From: Oluwatobi Bamidele Date: Fri, 2 Feb 2024 22:04:34 +0100 Subject: [PATCH 1/2] update: added recipient pubkey to bot pay api --- dist/src/controllers/botapi/index.js.map | 2 +- dist/src/controllers/botapi/pay.js | 28 ++++++++++++++++++--- dist/src/controllers/botapi/pay.js.map | 2 +- src/controllers/botapi/index.ts | 1 + src/controllers/botapi/pay.ts | 32 +++++++++++++++++++++--- 5 files changed, 55 insertions(+), 10 deletions(-) diff --git a/dist/src/controllers/botapi/index.js.map b/dist/src/controllers/botapi/index.js.map index 6bcc542fd..eb8d486d2 100644 --- a/dist/src/controllers/botapi/index.js.map +++ b/dist/src/controllers/botapi/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/controllers/botapi/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,yCAAwC;AACxC,yCASqB;AACrB,yCAAgE;AAChE,+CAAuC;AACvC,+CAA6D;AAC7D,+CAA0D;AAC1D,0CAAyC;AACzC,2CAA6E;AAC7E,2CAA4C;AAE5C,iDAAsE;AACtE,yCAA4C;AAC5C,6BAAiC;AACjC,+BAAuB;AACvB,2CAAmC;AA4BnC,SAAsB,cAAc,CAAC,GAAQ,EAAE,GAAQ;;;QACrD,qBAAY,CAAC,IAAI,CAAC,qBAAqB,GAAG,CAAC,IAAI,EAAE,CAAC,CAAA;QAClD,MAAM,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAA;QAC9C,IAAI,CAAC,GAAG,EAAE;YACR,qBAAY,CAAC,KAAK,CAAC,mBAAmB,EAAE,gBAAO,CAAC,IAAI,CAAC,CAAA;YACrD,OAAO,IAAA,kBAAY,EAAC,GAAG,CAAC,CAAA;SACzB;QAED,MAAM,UAAU,GACd,GAAG,CAAC,OAAO,CAAC,gBAAgB,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,gBAAgB,CAA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AA;QAClE,IAAI,OAAO,CAAC,IAAI,KAAK,mBAAS,CAAC,UAAU,CAAC,KAAK;YAC7C,OAAO,qBAAY,CAAC,KAAK,CAAC,aAAa,CAAC,CAAA;QAC1C,MAAM,KAAK,GAAkB,CAAC,MAAM,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC;YACzD,KAAK,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,MAAM,EAAE;SAC9B,CAAC,CAAkB,CAAA;QACpB,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAA;IACjC,CAAC;CAAA;AAVD,wCAUC;AAED,SAAsB,iBAAiB,CAAC,GAAQ,EAAE,GAAQ;;QACxD,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,IAAI,CAAA;QAC1B,IAAI,CAAC,IAAI,EAAE;YACT,OAAO,IAAA,aAAO,EAAC,GAAG,EAAE,SAAS,CAAC,CAAA;SAC/B;QACD,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAA;QAClC,IAAI,CAAC,UAAU,EAAE;YACf,OAAO,IAAA,aAAO,EAAC,GAAG,EAAE,eAAe,CAAC,CAAA;SACrC;QACD,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAA;QAC9B,IAAI,CAAC,QAAQ,EAAE;YACb,OAAO,IAAA,aAAO,EAAC,GAAG,EAAE,aAAa,CAAC,CAAA;SACnC;QAED,IAAI,cAAS,CAAC,UAAU,CAAC,EAAE;YACzB,cAAS,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,CAAA;SAChC;QAED,IAAA,aAAO,EAAC,GAAG,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAA;IAC5B,CAAC;CAAA;AAnBD,8CAmBC"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/controllers/botapi/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,yCAAwC;AACxC,yCASqB;AACrB,yCAAgE;AAChE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I,CAAC,UAAU,CAAA;QAClC,IAAI,CAAC,UAAU,EAAE;YACf,OAAO,IAAA,aAAO,EAAC,GAAG,EAAE,eAAe,CAAC,CAAA;SACrC;QACD,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAA;QAC9B,IAAI,CAAC,QAAQ,EAAE;YACb,OAAO,IAAA,aAAO,EAAC,GAAG,EAAE,aAAa,CAAC,CAAA;SACnC;QAED,IAAI,cAAS,CAAC,UAAU,CAAC,EAAE;YACzB,cAAS,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,CAAA;SAChC;QAED,IAAA,aAAO,EAAC,GAAG,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAA;IAC5B,CAAC;CAAA;AAnBD,8CAmBC"} \ No newline at end of file diff --git a/dist/src/controllers/botapi/pay.js b/dist/src/controllers/botapi/pay.js index efcf2567b..158ed8cd7 100644 --- a/dist/src/controllers/botapi/pay.js +++ b/dist/src/controllers/botapi/pay.js @@ -21,10 +21,10 @@ const rsa = require("../../crypto/rsa"); const index_1 = require("./index"); function pay(a) { return __awaiter(this, void 0, void 0, function* () { - const { amount, bot_name, msg_uuid, reply_uuid, recipient_id, parent_id, content, } = a; + const { amount, bot_name, msg_uuid, reply_uuid, recipient_id, parent_id, content, recipient_pubkey, } = a; logger_1.sphinxLogger.info(`=> BOT PAY ${JSON.stringify(a, null, 2)}`); - if (!a.recipient_id) - return logger_1.sphinxLogger.error(`no recipient_id`); + if (!recipient_id && !recipient_pubkey) + return logger_1.sphinxLogger.error(`no recipient detail`); const ret = yield (0, index_1.validateAction)(a); if (!ret) return; @@ -35,6 +35,26 @@ function pay(a) { const encryptedForMeText = rsa.encrypt(owner.contactKey, content || ''); const encryptedText = rsa.encrypt(chat.groupKey, content || ''); const textMap = { chat: encryptedText }; + let recipient_detail; + if (recipient_pubkey) { + try { + const user = (yield models_1.models.Contact.findOne({ + where: { tenant, publicKey: recipient_pubkey }, + })); + if (!user) { + logger_1.sphinxLogger.error(`=> RECIPIENT PUBKEY DOES NOT EXIST IN ADMIN RECORD`, logger_1.logging.Bots); + return; + } + recipient_detail = user.id; + } + catch (error) { + logger_1.sphinxLogger.error(`=> RECIPIENT PUBKEY ERROR ${error}`, logger_1.logging.Bots); + return; + } + } + else { + recipient_detail = recipient_id; + } const date = new Date(); date.setMilliseconds(0); const msg = Object.assign({ chatId: chat.id, uuid: msg_uuid || short.generate(), type: reply_uuid @@ -77,7 +97,7 @@ function pay(a) { return logger_1.sphinxLogger.error(e); }), isForwarded: true, - realSatsContactId: recipient_id, + realSatsContactId: recipient_detail, }); }); } diff --git a/dist/src/controllers/botapi/pay.js.map b/dist/src/controllers/botapi/pay.js.map index b40a8b3cc..2a109b85f 100644 --- a/dist/src/controllers/botapi/pay.js.map +++ b/dist/src/controllers/botapi/pay.js.map @@ -1 +1 @@ -{"version":3,"file":"pay.js","sourceRoot":"","sources":["../../../../src/controllers/botapi/pay.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,oCAAmC;AACnC,yCAAwC;AACxC,yCAA8C;AAC9C,8CAA6C;AAC7C,6CAA4C;AAC5C,+CAAuC;AACvC,+CAAiD;AACjD,2DAAuD;AACvD,wCAAuC;AACvC,mCAAgD;AAEhD,SAA8B,GAAG,CAAC,CAAS;;QACzC,MAAM,EACJ,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,SAAS,EACT,OAAO,GACR,GAAG,CAAC,CAAA;QAEL,qBAAY,CAAC,IAAI,CAAC,cAAc,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAA;QAC7D,IAAI,CAAC,CAAC,CAAC,YAAY;YAAE,OAAO,qBAAY,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAA;QACjE,MAAM,GAAG,GAAG,MAAM,IAAA,sBAAc,EAAC,CAAC,CAAC,CAAA;QACnC,IAAI,CAAC,GAAG;YAAE,OAAM;QAChB,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S,CAAC,QAAQ,CAAC,MAAM;iBAClC,CAAC,CAAA;gBACF,OAAO,qBAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;YAC9B,CAAC,CAAA;YACD,WAAW,EAAE,IAAI;YACjB,iBAAiB,EAAE,YAAY;SAChC,CAAC,CAAA;IACJ,CAAC;CAAA;AAzFD,sBAyFC"} \ No newline at end of file +{"version":3,"file":"pay.js","sourceRoot":"","sources":["../../../../src/controllers/botapi/pay.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,oCAAmC;AACnC,yCAAwC;AACxC,yCAA6D;AAC7D,8CAA6C;AAC7C,6CAA4C;AAC5C,+CAAuC;AACvC,+CAA0D;AAC1D,2DAAuD;AACvD,wCAAuC;AACvC,mCAAgD;AAEhD,SAA8B,GAAG,CAAC,CAAS;;QACzC,MAAM,EACJ,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,UAAU,EACV,YAAY,EACZ,SAAS,EACT,OAAO,EACP,gBAAgB,GACjB,GAAG,CAAC,CAAA;QAEL,qBAAY,CAAC,IAAI,CAAC,cAAc,IAAI,CAAC,SAAS,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAA;QAC7D,IAAI,CAAC,YAAY,IAAI,CAAC,gBAAgB;YACpC,OAAO,qBAAY,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAA;QAClD,MAAM,GAAG,GAAG,MAAM,IAAA,sBAAc,EAAC,CAAC,CAAC,CAAA;QACnC,IAAI,CAAC,GAAG;YAAE,OAAM;QAChB,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,GAAG,CAAA;QAC3B,MAAM,MAAM,GAAW,KAAK,CAAC,EAAE,CAAA;QAC/B,MAAM,KAAK,GAAG,QAAQ,IAAI,KAAK,CAAC,KAAK,CAAA;QACrC,MAAM,YAAY,GAAG,CAAC,CAAC,CAAA;QACvB,MAAM,kBAAkB,GAAG,GAAG,CAAC,OAAO,CAAC,KAAK,CAAC,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C,CAAC,mBAAS,CAAC,aAAa,CAAC,cAAc;YAC1C,OAAO,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;YAClC,OAAO,EAAE,CAAO,CAAC,EAAE,EAAE;gBACnB,MAAM,QAAQ,GAAG,IAAA,2BAAY,EAAC,CAAC,CAAC,CAAA;gBAChC,MAAM,OAAO,CAAC,MAAM,CAAC;oBACnB,YAAY,EAAE,QAAQ;oBACtB,MAAM,EAAE,mBAAS,CAAC,QAAQ,CAAC,MAAM;iBAClC,CAAC,CAAA;gBACF,OAAO,qBAAY,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;YAC9B,CAAC,CAAA;YACD,WAAW,EAAE,IAAI;YACjB,iBAAiB,EAAE,gBAAgB;SACpC,CAAC,CAAA;IACJ,CAAC;CAAA;AAjHD,sBAiHC"} \ No newline at end of file diff --git a/src/controllers/botapi/index.ts b/src/controllers/botapi/index.ts index 7739fca0c..7f9d01b00 100644 --- a/src/controllers/botapi/index.ts +++ b/src/controllers/botapi/index.ts @@ -49,6 +49,7 @@ export interface Action { only_owner?: boolean only_user?: number only_pubkey?: string + recipient_pubkey?: string } export async function processWebhook(req: Req, res: Res): Promise { diff --git a/src/controllers/botapi/pay.ts b/src/controllers/botapi/pay.ts index 0e8adbd4b..246fb823c 100644 --- a/src/controllers/botapi/pay.ts +++ b/src/controllers/botapi/pay.ts @@ -1,10 +1,10 @@ import * as short from 'short-uuid' import * as network from '../../network' -import { models, Message } from '../../models' +import { models, Message, ContactRecord } from '../../models' import * as jsonUtils from '../../utils/json' import * as socket from '../../utils/socket' import constants from '../../constants' -import { sphinxLogger } from '../../utils/logger' +import { logging, sphinxLogger } from '../../utils/logger' import { errMsgString } from '../../utils/errMsgString' import * as rsa from '../../crypto/rsa' import { Action, validateAction } from './index' @@ -18,10 +18,12 @@ export default async function pay(a: Action): Promise { recipient_id, parent_id, content, + recipient_pubkey, } = a sphinxLogger.info(`=> BOT PAY ${JSON.stringify(a, null, 2)}`) - if (!a.recipient_id) return sphinxLogger.error(`no recipient_id`) + if (!recipient_id && !recipient_pubkey) + return sphinxLogger.error(`no recipient detail`) const ret = await validateAction(a) if (!ret) return const { chat, owner } = ret @@ -31,6 +33,28 @@ export default async function pay(a: Action): Promise { const encryptedForMeText = rsa.encrypt(owner.contactKey, content || '') const encryptedText = rsa.encrypt(chat.groupKey, content || '') const textMap = { chat: encryptedText } + let recipient_detail + + if (recipient_pubkey) { + try { + const user = (await models.Contact.findOne({ + where: { tenant, publicKey: recipient_pubkey }, + })) as ContactRecord + if (!user) { + sphinxLogger.error( + `=> RECIPIENT PUBKEY DOES NOT EXIST IN ADMIN RECORD`, + logging.Bots + ) + return + } + recipient_detail = user.id + } catch (error) { + sphinxLogger.error(`=> RECIPIENT PUBKEY ERROR ${error}`, logging.Bots) + return + } + } else { + recipient_detail = recipient_id + } const date = new Date() date.setMilliseconds(0) @@ -96,6 +120,6 @@ export default async function pay(a: Action): Promise { return sphinxLogger.error(e) }, isForwarded: true, - realSatsContactId: recipient_id, + realSatsContactId: recipient_detail, }) } From 25c31b12a5a99b1e2b55ee87664849a6ed1a82ef Mon Sep 17 00:00:00 2001 From: Oluwatobi Bamidele Date: Fri, 2 Feb 2024 23:10:23 +0100 Subject: [PATCH 2/2] update: added recipient pubkey --- dist/src/controllers/botapi/index.js | 3 ++- dist/src/controllers/botapi/index.js.map | 2 +- src/controllers/botapi/index.ts | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dist/src/controllers/botapi/index.js b/dist/src/controllers/botapi/index.js index 753de79b4..c44e05e75 100644 --- a/dist/src/controllers/botapi/index.js +++ b/dist/src/controllers/botapi/index.js @@ -134,7 +134,7 @@ function processAction(req, res) { return (0, res_1.failure)(res, 'failed to parse webhook body json'); } } - const { action, bot_id, bot_secret, pubkey, amount, content, chat_uuid, msg_uuid, reply_uuid, recipient_id, parent_id, only_pubkey, only_owner, } = body; + const { action, bot_id, bot_secret, pubkey, amount, content, chat_uuid, msg_uuid, reply_uuid, recipient_id, parent_id, only_pubkey, only_owner, recipient_pubkey, } = body; if (!bot_id) return (0, res_1.failure)(res, 'no bot_id'); const bot = (yield models_1.models.Bot.findOne({ where: { id: bot_id } })); @@ -169,6 +169,7 @@ function processAction(req, res) { recipient_id: recipient_id ? parseInt(recipient_id) : 0, only_pubkey: only_pubkey || '', only_owner: only_owner || false, + recipient_pubkey: recipient_pubkey || '', }; try { const r = yield finalAction(a); diff --git a/dist/src/controllers/botapi/index.js.map b/dist/src/controllers/botapi/index.js.map index eb8d486d2..9e73847e1 100644 --- a/dist/src/controllers/botapi/index.js.map +++ b/dist/src/controllers/botapi/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/controllers/botapi/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,yCAAwC;AACxC,yCASqB;AACrB,yCAAgE;AAChE,+CAAuC;AACvC,+CAA6D;AAC7D,+CAA0D;AAC1D,0CAAyC;AACzC,2CAA6E;AAC7E,2CAA4C;AAE5C,iDAAsE;AACtE,yCAA4C;AAC5C,6BAAiC;AACjC,+BAAuB;AACvB,2CAAmC;AA6BnC,SAAsB,cAAc,CAAC,GAAQ,EAAE,GAAQ;;;QACrD,qBAAY,CAAC,IAAI,CAAC,qBAAqB,GAAG,CAAC,IAAI,EAAE,CAAC,CAAA;QAClD,MAAM,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAA;QAC9C,IAAI,CAAC,GAAG,EAAE;YACR,qBAAY,CAAC,KAAK,CAAC,mBAAmB,EAAE,gBAAO,CAAC,IAAI,CAAC,CAAA;YACrD,OAAO,IAAA,kBAAY,EAAC,GAAG,CAAC,CAAA;SACzB;QAED,MAAM,UAAU,GACd,GAAG,CAAC,OAAO,CAAC,gBAAgB,CAAC,IAAI,GAAG,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAA;QAChE,IAAI,CAAC,UAAU,EAAE;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,mBAAS,CAAC,UAAU,CAAC,KAAK;YAC7C,OAAO,qBAAY,CAAC,KAAK,CAAC,aAAa,CAAC,CAAA;QAC1C,MAAM,KAAK,GAAkB,CAAC,MAAM,eAAM,CAAC,OAAO,CAAC,OAAO,CAAC;YACzD,KAAK,EAAE,EAAE,EAAE,EAAE,OAAO,CAAC,MAAM,EAAE;SAC9B,CAAC,CAAkB,CAAA;QACpB,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAA;IACjC,CAAC;CAAA;AAVD,wCAUC;AAED,SAAsB,iBAAiB,CAAC,GAAQ,EAAE,GAAQ;;QACxD,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,IAAI,CAAA;QAC1B,IAAI,CAAC,IAAI,EAAE;YACT,OAAO,IAAA,aAAO,EAAC,GAAG,EAAE,SAAS,CAAC,CAAA;SAC/B;QACD,MAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAA;QAClC,IAAI,CAAC,UAAU,EAAE;YACf,OAAO,IAAA,aAAO,EAAC,GAAG,EAAE,eAAe,CAAC,CAAA;SACrC;QACD,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAA;QAC9B,IAAI,CAAC,QAAQ,EAAE;YACb,OAAO,IAAA,aAAO,EAAC,GAAG,EAAE,aAAa,CAAC,CAAA;SACnC;QAED,IAAI,cAAS,CAAC,UAAU,CAAC,EAAE;YACzB,cAAS,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,CAAA;SAChC;QAED,IAAA,aAAO,EAAC,GAAG,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAA;IAC5B,CAAC;CAAA;AAnBD,8CAmBC"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/controllers/botapi/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,yCAAwC;AACxC,yCASqB;AACrB,yCAAgE;AAChE,+CAAuC;AACvC,+CAA6D;AAC7D,+CAA0D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M,UAAU,GAAG,IAAI,CAAC,UAAU,CAAA;QAClC,IAAI,CAAC,UAAU,EAAE;YACf,OAAO,IAAA,aAAO,EAAC,GAAG,EAAE,eAAe,CAAC,CAAA;SACrC;QACD,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAA;QAC9B,IAAI,CAAC,QAAQ,EAAE;YACb,OAAO,IAAA,aAAO,EAAC,GAAG,EAAE,aAAa,CAAC,CAAA;SACnC;QAED,IAAI,cAAS,CAAC,UAAU,CAAC,EAAE;YACzB,cAAS,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,CAAA;SAChC;QAED,IAAA,aAAO,EAAC,GAAG,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,CAAA;IAC5B,CAAC;CAAA;AAnBD,8CAmBC"} \ No newline at end of file diff --git a/src/controllers/botapi/index.ts b/src/controllers/botapi/index.ts index 7f9d01b00..3516db42f 100644 --- a/src/controllers/botapi/index.ts +++ b/src/controllers/botapi/index.ts @@ -175,6 +175,7 @@ export async function processAction(req: Req, res: Res): Promise { parent_id, only_pubkey, only_owner, + recipient_pubkey, } = body if (!bot_id) return failure(res, 'no bot_id') @@ -210,6 +211,7 @@ export async function processAction(req: Req, res: Res): Promise { recipient_id: recipient_id ? parseInt(recipient_id) : 0, only_pubkey: only_pubkey || '', only_owner: only_owner || false, + recipient_pubkey: recipient_pubkey || '', } try {