From a947924261741507e0a105a47a720c191bec8735 Mon Sep 17 00:00:00 2001 From: Evan Feenstra Date: Thu, 11 Jun 2020 17:05:52 -0700 Subject: [PATCH] escrow spam protection --- api/controllers/chatTribes.ts | 17 ++++++-- api/controllers/chats.ts | 6 ++- api/helpers.ts | 4 +- api/models/index.ts | 3 +- api/models/ts/chat.ts | 6 +++ api/models/ts/timer.ts | 23 ++++++++++ api/network/receive.ts | 8 ++++ api/network/send.ts | 12 ++++-- api/utils/lightning.ts | 1 + api/utils/setup.ts | 36 ++++++---------- api/utils/timers.ts | 37 ++++++++++++++++ api/utils/tribes.ts | 8 +++- dist/api/controllers/chatTribes.js | 14 ++++-- dist/api/controllers/chatTribes.js.map | 2 +- dist/api/controllers/chats.js | 6 ++- dist/api/controllers/chats.js.map | 2 +- dist/api/helpers.js | 4 +- dist/api/helpers.js.map | 2 +- dist/api/models/index.js | 3 +- dist/api/models/index.js.map | 2 +- dist/api/models/ts/chat.js | 8 ++++ dist/api/models/ts/chat.js.map | 2 +- dist/api/models/ts/timer.js | 40 +++++++++++++++++ dist/api/models/ts/timer.js.map | 1 + dist/api/network/receive.js | 8 ++++ dist/api/network/receive.js.map | 2 +- dist/api/network/send.js | 12 ++++-- dist/api/network/send.js.map | 2 +- dist/api/utils/lightning.js | 1 + dist/api/utils/lightning.js.map | 2 +- dist/api/utils/setup.js | 38 +++++++--------- dist/api/utils/setup.js.map | 2 +- dist/api/utils/timers.js | 60 ++++++++++++++++++++++++++ dist/api/utils/timers.js.map | 1 + dist/api/utils/tribes.js | 8 +++- dist/api/utils/tribes.js.map | 2 +- 36 files changed, 300 insertions(+), 85 deletions(-) create mode 100644 api/models/ts/timer.ts create mode 100644 api/utils/timers.ts create mode 100644 dist/api/models/ts/timer.js create mode 100644 dist/api/models/ts/timer.js.map create mode 100644 dist/api/utils/timers.js create mode 100644 dist/api/utils/timers.js.map diff --git a/api/controllers/chatTribes.ts b/api/controllers/chatTribes.ts index f720dc5..5da75ed 100644 --- a/api/controllers/chatTribes.ts +++ b/api/controllers/chatTribes.ts @@ -99,6 +99,8 @@ async function editTribe(req, res) { is_listed, price_per_message, price_to_join, + escrow_amount, + escrow_millis, img, description, tags, @@ -123,6 +125,8 @@ async function editTribe(req, res) { host: chat.host, price_per_message: price_per_message||0, price_to_join: price_to_join||0, + escrow_amount: escrow_amount||0, + escrow_millis: escrow_millis||0, description, tags, img, @@ -138,7 +142,9 @@ async function editTribe(req, res) { photoUrl: img||'', name: name, pricePerMessage: price_per_message||0, - priceToJoin: price_to_join||0 + priceToJoin: price_to_join||0, + escrowAmount: escrow_amount||0, + escrowMillis: escrow_millis||0, }) success(res, jsonUtils.chatToJson(chat)) } else { @@ -190,12 +196,12 @@ async function replayChatHistory(chat, contact) { msg = await decryptMessage(msg, chat) const data = await personalizeMessage(msg, contact, true) const mqttTopic = `${contact.publicKey}/${chat.uuid}` - await network.signAndSend({data}, owner.publicKey, mqttTopic) + await network.signAndSend({data}, mqttTopic) }) } -async function createTribeChatParams(owner, contactIds, name, img, price_per_message, price_to_join): Promise<{[k:string]:any}> { +async function createTribeChatParams(owner, contactIds, name, img, price_per_message, price_to_join, escrow_amount, escrow_millis): Promise<{[k:string]:any}> { let date = new Date() date.setMilliseconds(0) if (!(owner && contactIds && Array.isArray(contactIds))) { @@ -220,6 +226,8 @@ async function createTribeChatParams(owner, contactIds, name, img, price_per_mes host: tribes.getHost(), pricePerMessage: price_per_message||0, priceToJoin: price_to_join||0, + escrowMillis: escrow_millis||0, + escrowAmount: escrow_amount||0, } } @@ -233,4 +241,5 @@ async function asyncForEach(array, callback) { for (let index = 0; index < array.length; index++) { await callback(array[index], index, array); } -} \ No newline at end of file +} + diff --git a/api/controllers/chats.ts b/api/controllers/chats.ts index e76728f..a8cc22f 100644 --- a/api/controllers/chats.ts +++ b/api/controllers/chats.ts @@ -46,6 +46,8 @@ async function createGroupChat(req, res) { is_listed, price_per_message, price_to_join, + escrow_amount, + escrow_millis, img, description, tags, @@ -69,7 +71,7 @@ async function createGroupChat(req, res) { let chatParams:any = null let okToCreate = true if(is_tribe){ - chatParams = await createTribeChatParams(owner, contact_ids, name, img, price_per_message, price_to_join) + chatParams = await createTribeChatParams(owner, contact_ids, name, img, price_per_message, price_to_join, escrow_amount, escrow_millis) if(is_listed && chatParams.uuid){ // publish to tribe server try { @@ -80,6 +82,8 @@ async function createGroupChat(req, res) { group_key: chatParams.groupKey, price_per_message: price_per_message||0, price_to_join: price_to_join||0, + escrow_amount: escrow_amount||0, + escrow_millis: escrow_millis||0, description, tags, img, owner_pubkey: owner.publicKey, owner_alias: owner.alias, diff --git a/api/helpers.ts b/api/helpers.ts index 7c783a3..26ed7e7 100644 --- a/api/helpers.ts +++ b/api/helpers.ts @@ -83,8 +83,8 @@ const performKeysendMessage = async ({ destination_key, amount, msg, success, fa amt: Math.max(amount, 3) } try { - const r = await network.signAndSend(opts, sender.publicKey) - console.log("=> external keysend") + const r = await network.signAndSend(opts) + // console.log("=> keysend to new contact") if (success) success(r) } catch (e) { console.log("MESSAGE ERROR", e) diff --git a/api/models/index.ts b/api/models/index.ts index 9d2b685..189d7ae 100644 --- a/api/models/index.ts +++ b/api/models/index.ts @@ -7,6 +7,7 @@ import Message from './ts/message' import Subscription from './ts/subscription' import MediaKey from './ts/mediaKey' import ChatMember from './ts/chatMember' +import Timer from './ts/timer' const env = process.env.NODE_ENV || 'development'; const config = require(path.join(__dirname,'../../config/config.json'))[env] @@ -14,7 +15,7 @@ const config = require(path.join(__dirname,'../../config/config.json'))[env] const sequelize = new Sequelize({ ...config, logging: process.env.SQL_LOG==='true' ? console.log : false, - models: [Chat,Contact,Invite,Message,Subscription,MediaKey,ChatMember] + models: [Chat,Contact,Invite,Message,Subscription,MediaKey,ChatMember,Timer] }) const models = sequelize.models diff --git a/api/models/ts/chat.ts b/api/models/ts/chat.ts index f63ad20..221c93a 100644 --- a/api/models/ts/chat.ts +++ b/api/models/ts/chat.ts @@ -60,6 +60,12 @@ export default class Chat extends Model { @Column pricePerMessage: number + @Column(DataType.BIGINT) + escrowAmount: number + + @Column(DataType.BIGINT) + escrowMillis: number + @Column ownerPubkey: string diff --git a/api/models/ts/timer.ts b/api/models/ts/timer.ts new file mode 100644 index 0000000..30a1d95 --- /dev/null +++ b/api/models/ts/timer.ts @@ -0,0 +1,23 @@ +import { Table, Column, Model, DataType } from 'sequelize-typescript'; + +@Table({tableName: 'sphinx_timers', underscored: true}) +export default class Timer extends Model { + + @Column({ + type: DataType.BIGINT, + primaryKey: true, + unique: true, + autoIncrement: true + }) + id: number + + @Column(DataType.BIGINT) + millis: number + + @Column(DataType.BIGINT) + receiver: number + + @Column(DataType.DECIMAL) + amount: number + +} \ No newline at end of file diff --git a/api/network/receive.ts b/api/network/receive.ts index d8407d7..730c0e8 100644 --- a/api/network/receive.ts +++ b/api/network/receive.ts @@ -10,6 +10,7 @@ import {modifyPayloadAndSaveMediaKey,purchaseFromOriginalSender,sendFinalMemeIfF // import {modifyPayloadAndSaveMediaKey} from './modify' import {decryptMessage,encryptTribeBroadcast} from '../utils/msg' import { Op } from 'sequelize' +import * as timers from '../utils/timers' const constants = require(path.join(__dirname,'../../config/constants.json')) const msgtypes = constants.message_types @@ -53,6 +54,13 @@ async function onReceive(payload){ // CHECK PRICES if(needsPricePerJoin) { if(payload.message.amount { console.log('=> [db] starting setup...') @@ -31,6 +31,18 @@ async function setVersion(){ } async function migrate(){ + try{ + await sequelize.query(` +CREATE TABLE sphinx_timers ( + id BIGINT, + receiver BIGINT, + millis BIGINT, + amount DECIMAL +)`) + } catch(e){console.log(e)} + addTableColumn('sphinx_chats', 'escrow_amount', 'BIGINT') + addTableColumn('sphinx_messages', 'escrow_millis', 'BIGINT') + addTableColumn('sphinx_contacts', 'private_photo', 'BOOLEAN') addTableColumn('sphinx_media_keys', 'media_type') @@ -41,28 +53,6 @@ async function migrate(){ addTableColumn('sphinx_messages', 'reply_uuid') addTableColumn('sphinx_media_keys', 'sender', 'BIGINT') - - addTableColumn('sphinx_chats', 'group_key') - addTableColumn('sphinx_chats', 'group_private_key') - addTableColumn('sphinx_chats', 'host') - addTableColumn('sphinx_chats', 'price_to_join', 'BIGINT') - addTableColumn('sphinx_chats', 'price_per_message', 'BIGINT') - addTableColumn('sphinx_chats', 'owner_pubkey') - addTableColumn('sphinx_messages', 'sender_alias') - addTableColumn('sphinx_chat_members', 'alias') - addTableColumn('sphinx_contacts', 'from_group') - try{ - await sequelize.query(` -CREATE TABLE sphinx_chat_members ( - chat_id INT, - contact_id INT, - alias TEXT, - role INT, - total_spent INT, - total_messages INT, - last_active DATETIME -)`) - } catch(e){} } async function addTableColumn(table:string, column:string, type='TEXT') { diff --git a/api/utils/timers.ts b/api/utils/timers.ts new file mode 100644 index 0000000..bb729e1 --- /dev/null +++ b/api/utils/timers.ts @@ -0,0 +1,37 @@ +import { models } from '../models' +import * as network from '../network' + +export async function addTimer({amount, millis, receiver}){ + const now = new Date().valueOf() + const when = now + millis + const t = await models.Timer.create({ + amount, millis:when, receiver, + }) + setTimer(when, async ()=>{ + payBack(t) + }) +} +export function setTimer(when:number, cb){ + const now = new Date().valueOf() + const ms = when-now + if(ms<0) cb() // fire right away if its already passed + else setTimeout(cb, ms) +} +export async function reloadTimers(){ + const timers = await models.Timer.findAll() + timers && timers.forEach(t=>{ + setTimer(t.millis, async ()=>{ + payBack(t) + }) + }) +} +export async function payBack(t){ + const contact = await models.Contact.findOne({where:{id:t.receiver}}) + if(contact){ + network.signAndSend({ + amt: t.amount, + dest: contact.publicKey, + }) + } + models.Timer.destroy({where:{id:t.id}}) +} diff --git a/api/utils/tribes.ts b/api/utils/tribes.ts index d018d51..40b7768 100644 --- a/api/utils/tribes.ts +++ b/api/utils/tribes.ts @@ -69,7 +69,7 @@ export function publish(topic, msg) { if (client) client.publish(topic, msg) } -export async function declare({ uuid, name, description, tags, img, group_key, host, price_per_message, price_to_join, owner_alias, owner_pubkey }) { +export async function declare({ uuid, name, description, tags, img, group_key, host, price_per_message, price_to_join, owner_alias, owner_pubkey, escrow_amount, escrow_millis }) { try { await fetch('https://' + host + '/tribes', { method: 'POST', @@ -79,6 +79,8 @@ export async function declare({ uuid, name, description, tags, img, group_key, h price_per_message: price_per_message || 0, price_to_join: price_to_join || 0, owner_alias, owner_pubkey, + escrow_amount: escrow_amount || 0, + escrow_millis: escrow_millis || 0, }), headers: { 'Content-Type': 'application/json' } }) @@ -89,7 +91,7 @@ export async function declare({ uuid, name, description, tags, img, group_key, h } } -export async function edit({ uuid, host, name, description, tags, img, price_per_message, price_to_join, owner_alias }) { +export async function edit({ uuid, host, name, description, tags, img, price_per_message, price_to_join, owner_alias, escrow_amount, escrow_millis }) { try { const token = await genSignedTimestamp() await fetch('https://' + host + '/tribe?token=' + token, { @@ -99,6 +101,8 @@ export async function edit({ uuid, host, name, description, tags, img, price_per name, description, tags, img: img || '', price_per_message: price_per_message || 0, price_to_join: price_to_join || 0, + escrow_amount: escrow_amount || 0, + escrow_millis: escrow_millis || 0, owner_alias, }), headers: { 'Content-Type': 'application/json' } diff --git a/dist/api/controllers/chatTribes.js b/dist/api/controllers/chatTribes.js index f959f8e..1445dbc 100644 --- a/dist/api/controllers/chatTribes.js +++ b/dist/api/controllers/chatTribes.js @@ -100,7 +100,7 @@ function joinTribe(req, res) { exports.joinTribe = joinTribe; function editTribe(req, res) { return __awaiter(this, void 0, void 0, function* () { - const { name, is_listed, price_per_message, price_to_join, img, description, tags, } = req.body; + const { name, is_listed, price_per_message, price_to_join, escrow_amount, escrow_millis, img, description, tags, } = req.body; const { id } = req.params; if (!id) return res_1.failure(res, 'group id is required'); @@ -118,6 +118,8 @@ function editTribe(req, res) { host: chat.host, price_per_message: price_per_message || 0, price_to_join: price_to_join || 0, + escrow_amount: escrow_amount || 0, + escrow_millis: escrow_millis || 0, description, tags, img, @@ -133,7 +135,9 @@ function editTribe(req, res) { photoUrl: img || '', name: name, pricePerMessage: price_per_message || 0, - priceToJoin: price_to_join || 0 + priceToJoin: price_to_join || 0, + escrowAmount: escrow_amount || 0, + escrowMillis: escrow_millis || 0, }); res_1.success(res, jsonUtils.chatToJson(chat)); } @@ -182,12 +186,12 @@ function replayChatHistory(chat, contact) { msg = yield msg_1.decryptMessage(msg, chat); const data = yield msg_1.personalizeMessage(msg, contact, true); const mqttTopic = `${contact.publicKey}/${chat.uuid}`; - yield network.signAndSend({ data }, owner.publicKey, mqttTopic); + yield network.signAndSend({ data }, mqttTopic); })); }); } exports.replayChatHistory = replayChatHistory; -function createTribeChatParams(owner, contactIds, name, img, price_per_message, price_to_join) { +function createTribeChatParams(owner, contactIds, name, img, price_per_message, price_to_join, escrow_amount, escrow_millis) { return __awaiter(this, void 0, void 0, function* () { let date = new Date(); date.setMilliseconds(0); @@ -212,6 +216,8 @@ function createTribeChatParams(owner, contactIds, name, img, price_per_message, host: tribes.getHost(), pricePerMessage: price_per_message || 0, priceToJoin: price_to_join || 0, + escrowMillis: escrow_millis || 0, + escrowAmount: escrow_amount || 0, }; }); } diff --git a/dist/api/controllers/chatTribes.js.map b/dist/api/controllers/chatTribes.js.map index c6556c6..6deb117 100644 --- a/dist/api/controllers/chatTribes.js.map +++ b/dist/api/controllers/chatTribes.js.map @@ -1 +1 @@ -{"version":3,"file":"chatTribes.js","sourceRoot":"","sources":["../../../api/controllers/chatTribes.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAkC;AAClC,2CAA0C;AAC1C,sCAA+C;AAC/C,sCAAqC;AACrC,qCAAoC;AACpC,0CAAyC;AACzC,6BAA4B;AAC5B,sCAA+D;AAC/D,yCAA8B;AAE9B,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,6BAA6B,CAAC,CAAC,CAAA;AAE7E,SAAe,SAAS,CAAC,GAAG,EAAE,GAAG;;QAChC,OAAO,CAAC,GAAG,CAAC,cAAc,CAAC,CAAA;QAC3B,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,YAAY,EA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AAI,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/api/controllers/chats.js b/dist/api/controllers/chats.js index d672926..49eaccf 100644 --- a/dist/api/controllers/chats.js +++ b/dist/api/controllers/chats.js @@ -49,7 +49,7 @@ exports.mute = mute; // or can u add contacts as members? function createGroupChat(req, res) { return __awaiter(this, void 0, void 0, function* () { - const { name, is_tribe, is_listed, price_per_message, price_to_join, img, description, tags, } = req.body; + const { name, is_tribe, is_listed, price_per_message, price_to_join, escrow_amount, escrow_millis, img, description, tags, } = req.body; const contact_ids = req.body.contact_ids || []; const members = {}; //{pubkey:{key,alias}, ...} const owner = yield models_1.models.Contact.findOne({ where: { isOwner: true } }); @@ -66,7 +66,7 @@ function createGroupChat(req, res) { let chatParams = null; let okToCreate = true; if (is_tribe) { - chatParams = yield chatTribes_1.createTribeChatParams(owner, contact_ids, name, img, price_per_message, price_to_join); + chatParams = yield chatTribes_1.createTribeChatParams(owner, contact_ids, name, img, price_per_message, price_to_join, escrow_amount, escrow_millis); if (is_listed && chatParams.uuid) { // publish to tribe server try { @@ -77,6 +77,8 @@ function createGroupChat(req, res) { group_key: chatParams.groupKey, price_per_message: price_per_message || 0, price_to_join: price_to_join || 0, + escrow_amount: escrow_amount || 0, + escrow_millis: escrow_millis || 0, description, tags, img, owner_pubkey: owner.publicKey, owner_alias: owner.alias, diff --git a/dist/api/controllers/chats.js.map b/dist/api/controllers/chats.js.map index 8923031..99c493b 100644 --- a/dist/api/controllers/chats.js.map +++ b/dist/api/controllers/chats.js.map @@ -1 +1 @@ -{"version":3,"file":"chats.js","sourceRoot":"","sources":["../../../api/controllers/chats.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAkC;AAClC,2CAA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,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,SAAS,CAAC,UAAU,CAAC,KAAK;KAChC,CAAA;AACF,CAAC;AAQD,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/api/helpers.js b/dist/api/helpers.js index 95039fa..698c1f6 100644 --- a/dist/api/helpers.js +++ b/dist/api/helpers.js @@ -90,8 +90,8 @@ const performKeysendMessage = ({ destination_key, amount, msg, success, failure, amt: Math.max(amount, 3) }; try { - const r = yield network.signAndSend(opts, sender.publicKey); - console.log("=> external keysend"); + const r = yield network.signAndSend(opts); + // console.log("=> keysend to new contact") if (success) success(r); } diff --git a/dist/api/helpers.js.map b/dist/api/helpers.js.map index 14a1629..1e962ec 100644 --- a/dist/api/helpers.js.map +++ b/dist/api/helpers.js.map @@ -1 +1 @@ -{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../api/helpers.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,qCAAiC;AACjC,2BAA0B;AAC1B,qCAAoC;AAEpC,MAAM,SAAS,GAAG,OAAO,CAAC,0BAA0B,CAAC,CAAC;AAEtD,MAAM,gBAAgB,GAAG,CAAO,MAAM,EAAE,EAAE;IACzC,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,GAAG,MAAM,CAAA;IAClD,IAAI,IAAI,CAAA;IAC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E,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/api/models/index.js b/dist/api/models/index.js index 3fa32e0..65a8cb1 100644 --- a/dist/api/models/index.js +++ b/dist/api/models/index.js @@ -9,9 +9,10 @@ const message_1 = require("./ts/message"); const subscription_1 = require("./ts/subscription"); const mediaKey_1 = require("./ts/mediaKey"); const chatMember_1 = require("./ts/chatMember"); +const timer_1 = require("./ts/timer"); const env = process.env.NODE_ENV || 'development'; const config = require(path.join(__dirname, '../../config/config.json'))[env]; -const sequelize = new sequelize_typescript_1.Sequelize(Object.assign(Object.assign({}, config), { logging: process.env.SQL_LOG === 'true' ? console.log : false, models: [chat_1.default, contact_1.default, invite_1.default, message_1.default, subscription_1.default, mediaKey_1.default, chatMember_1.default] })); +const sequelize = new sequelize_typescript_1.Sequelize(Object.assign(Object.assign({}, config), { logging: process.env.SQL_LOG === 'true' ? console.log : false, models: [chat_1.default, contact_1.default, invite_1.default, message_1.default, subscription_1.default, mediaKey_1.default, chatMember_1.default, timer_1.default] })); exports.sequelize = sequelize; const models = sequelize.models; exports.models = models; diff --git a/dist/api/models/index.js.map b/dist/api/models/index.js.map index effaf18..901599f 100644 --- a/dist/api/models/index.js.map +++ b/dist/api/models/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../api/models/index.ts"],"names":[],"mappings":";;AAAA,+DAA+C;AAC/C,6BAA4B;AAC5B,oCAA4B;AAC5B,0CAAkC;AAClC,wCAAgC;AAChC,0CAAkC;AAClC,oDAA4C;AAC5C,4CAAoC;AACpC,gDAAwC;AAExC,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,0BAA0B,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AAE5E,MAAM,SAAS,GAAG,IAAI,gCAAS,iCAC1B,MAAM,KACT,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,KAAG,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAC3D,MAAM,EAAE,CAAC,cAAI,EAAC,iBAAO,EAAC,gBAAM,EAAC,iBAAO,EAAC,sBAAY,EAAC,kBAAQ,EAAC,oBAAU,CAAC,IACtE,CAAA;AAIA,8BAAS;AAHX,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAA;AAI7B,wBAAM"} \ No newline at end of file +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../api/models/index.ts"],"names":[],"mappings":";;AAAA,+DAA+C;AAC/C,6BAA4B;AAC5B,oCAA4B;AAC5B,0CAAkC;AAClC,wCAAgC;AAChC,0CAAkC;AAClC,oDAA4C;AAC5C,4CAAoC;AACpC,gDAAwC;AACxC,sCAA8B;AAE9B,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,IAAI,aAAa,CAAC;AAClD,MAAM,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,0BAA0B,CAAC,CAAC,CAAC,GAAG,CAAC,CAAA;AAE5E,MAAM,SAAS,GAAG,IAAI,gCAAS,iCAC1B,MAAM,KACT,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,KAAG,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,EAC3D,MAAM,EAAE,CAAC,cAAI,EAAC,iBAAO,EAAC,gBAAM,EAAC,iBAAO,EAAC,sBAAY,EAAC,kBAAQ,EAAC,oBAAU,EAAC,eAAK,CAAC,IAC5E,CAAA;AAIA,8BAAS;AAHX,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAAA;AAI7B,wBAAM"} \ No newline at end of file diff --git a/dist/api/models/ts/chat.js b/dist/api/models/ts/chat.js index 4a9fba4..ce2f9ed 100644 --- a/dist/api/models/ts/chat.js +++ b/dist/api/models/ts/chat.js @@ -85,6 +85,14 @@ __decorate([ sequelize_typescript_1.Column, __metadata("design:type", Number) ], Chat.prototype, "pricePerMessage", void 0); +__decorate([ + sequelize_typescript_1.Column(sequelize_typescript_1.DataType.BIGINT), + __metadata("design:type", Number) +], Chat.prototype, "escrowAmount", void 0); +__decorate([ + sequelize_typescript_1.Column(sequelize_typescript_1.DataType.BIGINT), + __metadata("design:type", Number) +], Chat.prototype, "escrowMillis", void 0); __decorate([ sequelize_typescript_1.Column, __metadata("design:type", String) diff --git a/dist/api/models/ts/chat.js.map b/dist/api/models/ts/chat.js.map index 3826dff..1ce3dd6 100644 --- a/dist/api/models/ts/chat.js.map +++ b/dist/api/models/ts/chat.js.map @@ -1 +1 @@ -{"version":3,"file":"chat.js","sourceRoot":"","sources":["../../../../api/models/ts/chat.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAsE;AAGtE,IAAqB,IAAI,GAAzB,MAAqB,IAAK,SAAQ,4BAAW;CA8D5C,CAAA;AAtDC;IANC,6BAAM,CAAC;QACN,IAAI,EAAE,+BAAQ,CAAC,MAAM;QACrB,UAAU,EAAE,IAAI;QAChB,MAAM,EAAE,IAAI;QACZ,aAAa,EAAE,IAAI;KACpB,CAAC;;gCACQ;AAGV;IADC,6BAAM;;kCACK;AAGZ;IADC,6BAAM;;kCACK;AAGZ;IADC,6BAAM;;sCACS;AAGhB;IADC,6BAAM,CAAC,+BAAQ,CAAC,MAAM,CAAC;;kCACZ;AAGZ;IADC,6BAAM,CAAC,+BAAQ,CAAC,MAAM,CAAC;;oCACV;AAGd;IADC,6BAAM;;wCACW;AAGlB;IADC,6BAAM;;qCACS;AAGhB;IADC,6BAAM;8BACI,IAAI;uCAAA;AAGf;IADC,6BAAM;8BACI,IAAI;uCAAA;AAOf;IALC,6BAAM,CAAC;QACN,IAAI,EAAE,+BAAQ,CAAC,OAAO;QACtB,YAAY,EAAE,KAAK;QACnB,SAAS,EAAE,KAAK;KACjB,CAAC;;qCACc;AAGhB;IADC,6BAAM;;sCACS;AAGhB;IADC,6BAAM;;6CACgB;AAGvB;IADC,6BAAM;;kCACK;AAGZ;IADC,6BAAM;;yCACY;AAGnB;IADC,6BAAM;;6CACgB;AAGvB;IADC,6BAAM;;yCACY;AA5DA,IAAI;IADxB,4BAAK,CAAC,EAAC,SAAS,EAAE,cAAc,EAAE,WAAW,EAAE,IAAI,EAAC,CAAC;GACjC,IAAI,CA8DxB;kBA9DoB,IAAI"} \ No newline at end of file +{"version":3,"file":"chat.js","sourceRoot":"","sources":["../../../../api/models/ts/chat.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAsE;AAGtE,IAAqB,IAAI,GAAzB,MAAqB,IAAK,SAAQ,4BAAW;CAoE5C,CAAA;AA5DC;IANC,6BAAM,CAAC;QACN,IAAI,EAAE,+BAAQ,CAAC,MAAM;QACrB,UAAU,EAAE,IAAI;QAChB,MAAM,EAAE,IAAI;QACZ,aAAa,EAAE,IAAI;KACpB,CAAC;;gCACQ;AAGV;IADC,6BAAM;;kCACK;AAGZ;IADC,6BAAM;;kCACK;AAGZ;IADC,6BAAM;;sCACS;AAGhB;IADC,6BAAM,CAAC,+BAAQ,CAAC,MAAM,CAAC;;kCACZ;AAGZ;IADC,6BAAM,CAAC,+BAAQ,CAAC,MAAM,CAAC;;oCACV;AAGd;IADC,6BAAM;;wCACW;AAGlB;IADC,6BAAM;;qCACS;AAGhB;IADC,6BAAM;8BACI,IAAI;uCAAA;AAGf;IADC,6BAAM;8BACI,IAAI;uCAAA;AAOf;IALC,6BAAM,CAAC;QACN,IAAI,EAAE,+BAAQ,CAAC,OAAO;QACtB,YAAY,EAAE,KAAK;QACnB,SAAS,EAAE,KAAK;KACjB,CAAC;;qCACc;AAGhB;IADC,6BAAM;;sCACS;AAGhB;IADC,6BAAM;;6CACgB;AAGvB;IADC,6BAAM;;kCACK;AAGZ;IADC,6BAAM;;yCACY;AAGnB;IADC,6BAAM;;6CACgB;AAGvB;IADC,6BAAM,CAAC,+BAAQ,CAAC,MAAM,CAAC;;0CACJ;AAGpB;IADC,6BAAM,CAAC,+BAAQ,CAAC,MAAM,CAAC;;0CACJ;AAGpB;IADC,6BAAM;;yCACY;AAlEA,IAAI;IADxB,4BAAK,CAAC,EAAC,SAAS,EAAE,cAAc,EAAE,WAAW,EAAE,IAAI,EAAC,CAAC;GACjC,IAAI,CAoExB;kBApEoB,IAAI"} \ No newline at end of file diff --git a/dist/api/models/ts/timer.js b/dist/api/models/ts/timer.js new file mode 100644 index 0000000..c1ac0cd --- /dev/null +++ b/dist/api/models/ts/timer.js @@ -0,0 +1,40 @@ +"use strict"; +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const sequelize_typescript_1 = require("sequelize-typescript"); +let Timer = class Timer extends sequelize_typescript_1.Model { +}; +__decorate([ + sequelize_typescript_1.Column({ + type: sequelize_typescript_1.DataType.BIGINT, + primaryKey: true, + unique: true, + autoIncrement: true + }), + __metadata("design:type", Number) +], Timer.prototype, "id", void 0); +__decorate([ + sequelize_typescript_1.Column(sequelize_typescript_1.DataType.BIGINT), + __metadata("design:type", Number) +], Timer.prototype, "millis", void 0); +__decorate([ + sequelize_typescript_1.Column(sequelize_typescript_1.DataType.BIGINT), + __metadata("design:type", Number) +], Timer.prototype, "receiver", void 0); +__decorate([ + sequelize_typescript_1.Column(sequelize_typescript_1.DataType.DECIMAL), + __metadata("design:type", Number) +], Timer.prototype, "amount", void 0); +Timer = __decorate([ + sequelize_typescript_1.Table({ tableName: 'sphinx_timers', underscored: true }) +], Timer); +exports.default = Timer; +//# sourceMappingURL=timer.js.map \ No newline at end of file diff --git a/dist/api/models/ts/timer.js.map b/dist/api/models/ts/timer.js.map new file mode 100644 index 0000000..6c3530a --- /dev/null +++ b/dist/api/models/ts/timer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"timer.js","sourceRoot":"","sources":["../../../../api/models/ts/timer.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAsE;AAGtE,IAAqB,KAAK,GAA1B,MAAqB,KAAM,SAAQ,4BAAY;CAmB9C,CAAA;AAXC;IANC,6BAAM,CAAC;QACN,IAAI,EAAE,+BAAQ,CAAC,MAAM;QACrB,UAAU,EAAE,IAAI;QAChB,MAAM,EAAE,IAAI;QACZ,aAAa,EAAE,IAAI;KACpB,CAAC;;iCACQ;AAGV;IADC,6BAAM,CAAC,+BAAQ,CAAC,MAAM,CAAC;;qCACV;AAGd;IADC,6BAAM,CAAC,+BAAQ,CAAC,MAAM,CAAC;;uCACR;AAGhB;IADC,6BAAM,CAAC,+BAAQ,CAAC,OAAO,CAAC;;qCACX;AAjBK,KAAK;IADzB,4BAAK,CAAC,EAAC,SAAS,EAAE,eAAe,EAAE,WAAW,EAAE,IAAI,EAAC,CAAC;GAClC,KAAK,CAmBzB;kBAnBoB,KAAK"} \ No newline at end of file diff --git a/dist/api/network/receive.js b/dist/api/network/receive.js index a3471de..c362c08 100644 --- a/dist/api/network/receive.js +++ b/dist/api/network/receive.js @@ -21,6 +21,7 @@ const modify_1 = require("./modify"); // import {modifyPayloadAndSaveMediaKey} from './modify' const msg_1 = require("../utils/msg"); const sequelize_1 = require("sequelize"); +const timers = require("../utils/timers"); const constants = require(path.join(__dirname, '../../config/constants.json')); const msgtypes = constants.message_types; exports.typesToForward = [ @@ -66,6 +67,13 @@ function onReceive(payload) { if (needsPricePerJoin) { if (payload.message.amount < chat.pricePerMessage) doAction = false; + if (chat.escrowAmount) { + timers.addTimer({ + amount: chat.escrowAmount, + millis: chat.escrowMillis, + receiver: senderContact.id, + }); + } } // check price to join if (payload.type === msgtypes.group_join) { diff --git a/dist/api/network/receive.js.map b/dist/api/network/receive.js.map index d609cc1..a487f15 100644 --- a/dist/api/network/receive.js.map +++ b/dist/api/network/receive.js.map @@ -1 +1 @@ -{"version":3,"file":"receive.js","sourceRoot":"","sources":["../../../api/network/receive.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,6BAA4B;AAC5B,sCAAqC;AACrC,kDAA0C;AAC1C,gDAAsC;AACtC,0CAAyC;AACzC,kDAAwE;AACxE,sCAAkC;AAClC,iCAAkC;AAClC,qCAA8G;AAC9G,wDAAwD;AACxD,sCAAiE;AACjE,yCAA8B;AAE9B,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAC,6BAA6B,CAAC,CAAC,CAAA;AAC7E,MAAM,QAAQ,GAAG,SAAS,CAAC,aAAa,CAAA;AAE3B,QAAA,cAAc,GAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,WAAW,EAAE,QAAQ,CAAC,UAAU;CAChF,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,EAAE,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,WAAW;CAC3D,CAAA;AACD,SAAe,SAAS,CAAC,OAAO;;QAC/B,uCAAuC;QACvC,IAAI,QAAQ,GAAG,IAAI,CA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,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/api/network/send.js b/dist/api/network/send.js index b8e09ae..5a540aa 100644 --- a/dist/api/network/send.js +++ b/dist/api/network/send.js @@ -77,7 +77,7 @@ function sendMessage(params) { }; try { const mqttTopic = networkType === 'mqtt' ? `${destkey}/${chatUUID}` : ''; - const r = yield signAndSend(opts, sender.publicKey, mqttTopic); + const r = yield signAndSend(opts, mqttTopic); yes = r; } catch (e) { @@ -97,14 +97,18 @@ function sendMessage(params) { }); } exports.sendMessage = sendMessage; -function signAndSend(opts, pubkey, mqttTopic) { +function signAndSend(opts, mqttTopic) { // console.log('sign and send!!!!',opts.data) return new Promise(function (resolve, reject) { return __awaiter(this, void 0, void 0, function* () { - if (!opts.data || typeof opts.data !== 'object') { + if (!opts || typeof opts !== 'object') { return reject('object plz'); } - let data = JSON.stringify(opts.data); + if (!opts.dest) { + return reject('no dest pubkey'); + } + let data = JSON.stringify(opts.data || {}); + opts.amt = opts.amt || 0; const sig = yield LND.signAscii(data); data = data + sig; // console.log("ACTUALLY SEND", mqttTopic) diff --git a/dist/api/network/send.js.map b/dist/api/network/send.js.map index 5e2c643..f7de7fc 100644 --- a/dist/api/network/send.js.map +++ b/dist/api/network/send.js.map @@ -1 +1 @@ -{"version":3,"file":"send.js","sourceRoot":"","sources":["../../../api/network/send.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAkC;AAClC,0CAAyC;AACzC,sCAA+D;AAC/D,6BAA4B;AAC5B,0CAAyC;AAEzC,MAAM,SAAS,GAAG,O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,EAAE,IAAI,CAAC,OAAO,EAAE,GACzC,CAAC,eAAe,IAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,GAC/D,CAAC,eAAe,IAAE,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,CACtD;QACD,OAAO,EAAE,OAAO;QAChB,MAAM,gCACL,OAAO,EAAE,MAAM,CAAC,SAAS,IACtB,YAAY,IAAI,EAAC,KAAK,EAAE,MAAM,CAAC,KAAK,EAAC,GACrC,eAAe,IAAI,EAAC,SAAS,EAAE,MAAM,CAAC,QAAQ,EAAC,CAElD;KACD,CAAA;AACF,CAAC;AAtBD,wBAsBC;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 diff --git a/dist/api/utils/lightning.js b/dist/api/utils/lightning.js index c391511..b522a1b 100644 --- a/dist/api/utils/lightning.js +++ b/dist/api/utils/lightning.js @@ -146,6 +146,7 @@ const keysend = (opts) => { }); }); }; +exports.keysend = keysend; const MAX_MSG_LENGTH = 972; // 1146 - 20 ??? function keysendMessage(opts) { return __awaiter(this, void 0, void 0, function* () { diff --git a/dist/api/utils/lightning.js.map b/dist/api/utils/lightning.js.map index 0accc01..f4dd686 100644 --- a/dist/api/utils/lightning.js.map +++ b/dist/api/utils/lightning.js.map @@ -1 +1 @@ -{"version":3,"file":"lightning.js","sourceRoot":"","sources":["../../../api/utils/lightning.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,yCAAwC;AACxC,yBAAwB;AACxB,6BAA4B;AAC5B,wCAAmC;AACnC,iCAAgC;AAChC,iCAAgC;AAChC,6BAA4B;AAE5B,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;AAoYhC,0CAAe;AAnYjB,MAAM,wBAAwB,GAAG,SAAS,CAAA;AAoYxC,4DAAwB;AAlY1B,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,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC;IACnD,IAAI,QAAQ,GAAG,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IACjC,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;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AAC,EAAC,GAAG,CAAC,CAAA;YACvD,OAAO,CAAC,CAAA;SACT;QAAC,OAAM,CAAC,EAAE;YACT,MAAM,CAAC,CAAA;SACR;IACH,CAAC;CAAA;AAoCC,kCAAW;AAlCb,SAAe,OAAO;;QACrB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAC,MAAM,EAAC,EAAE;YACpC,MAAM,SAAS,GAAG,aAAa,EAAE,CAAA;YACjC,SAAS,CAAC,OAAO,CAAC,EAAE,EAAE,UAAS,GAAG,EAAE,QAAQ;gBAC3C,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;AA+BC,0BAAO;AA7BT,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/api/utils/setup.js b/dist/api/utils/setup.js index 0c331df..01f516d 100644 --- a/dist/api/utils/setup.js +++ b/dist/api/utils/setup.js @@ -16,7 +16,7 @@ const QRCode = require("qrcode"); const publicIp = require("public-ip"); const password_1 = require("../utils/password"); const gitinfo_1 = require("../utils/gitinfo"); -const USER_VERSION = 3; +const USER_VERSION = 4; const setupDatabase = () => __awaiter(void 0, void 0, void 0, function* () { console.log('=> [db] starting setup...'); yield setVersion(); @@ -44,6 +44,20 @@ function setVersion() { } function migrate() { return __awaiter(this, void 0, void 0, function* () { + try { + yield models_1.sequelize.query(` +CREATE TABLE sphinx_timers ( + id BIGINT, + receiver BIGINT, + millis BIGINT, + amount DECIMAL +)`); + } + catch (e) { + console.log(e); + } + addTableColumn('sphinx_chats', 'escrow_amount', 'BIGINT'); + addTableColumn('sphinx_messages', 'escrow_millis', 'BIGINT'); addTableColumn('sphinx_contacts', 'private_photo', 'BOOLEAN'); addTableColumn('sphinx_media_keys', 'media_type'); addTableColumn('sphinx_media_keys', 'original_muid'); @@ -51,28 +65,6 @@ function migrate() { addTableColumn('sphinx_messages', 'uuid'); addTableColumn('sphinx_messages', 'reply_uuid'); addTableColumn('sphinx_media_keys', 'sender', 'BIGINT'); - addTableColumn('sphinx_chats', 'group_key'); - addTableColumn('sphinx_chats', 'group_private_key'); - addTableColumn('sphinx_chats', 'host'); - addTableColumn('sphinx_chats', 'price_to_join', 'BIGINT'); - addTableColumn('sphinx_chats', 'price_per_message', 'BIGINT'); - addTableColumn('sphinx_chats', 'owner_pubkey'); - addTableColumn('sphinx_messages', 'sender_alias'); - addTableColumn('sphinx_chat_members', 'alias'); - addTableColumn('sphinx_contacts', 'from_group'); - try { - yield models_1.sequelize.query(` -CREATE TABLE sphinx_chat_members ( - chat_id INT, - contact_id INT, - alias TEXT, - role INT, - total_spent INT, - total_messages INT, - last_active DATETIME -)`); - } - catch (e) { } }); } function addTableColumn(table, column, type = 'TEXT') { diff --git a/dist/api/utils/setup.js.map b/dist/api/utils/setup.js.map index f2f5f82..c7ef0ec 100644 --- a/dist/api/utils/setup.js.map +++ b/dist/api/utils/setup.js.map @@ -1 +1 @@ -{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../../api/utils/setup.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,2CAA2C;AAC3C,sCAA2C;AAC3C,iDAAoC;AACpC,iCAAgC;AAChC,s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UAAU,EAAE,CAAC,CAAA;IAChE,CAAC;CAAA;AAED,SAAe,OAAO;;QACpB,MAAM,EAAE,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAA;QAC9B,IAAI,SAAS,CAAA;QACb,IAAG,CAAC,EAAE,EAAE;YACN,IAAI;gBACF,SAAS,GAAG,MAAM,QAAQ,CAAC,EAAE,EAAE,CAAA;aAChC;YAAC,OAAM,CAAC,EAAC,GAAE;SACb;aAAM;YACL,SAAS,GAAG,EAAE,CAAA;SACf;QACD,IAAG,CAAC,SAAS,EAAE;YACb,OAAO,CAAC,GAAG,CAAC,0BAA0B,CAAC,CAAA;YACvC,OAAM;SACP;QACD,IAAI,KAAK,GAAG,SAAS,CAAA;QACrB,qDAAqD;QAErD,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,KAAK,KAAK,kBAAQ,IAAE,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAA;QAC3E,OAAO,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAA;QAC1C,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QAChB,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAC,EAAC,IAAI,EAAC,UAAU,EAAC,EAAE,UAAU,GAAG,EAAE,GAAG;YACvD,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QAClB,CAAC,CAAC,CAAA;IACJ,CAAC;CAAA"} \ No newline at end of file diff --git a/dist/api/utils/timers.js b/dist/api/utils/timers.js new file mode 100644 index 0000000..373f8a5 --- /dev/null +++ b/dist/api/utils/timers.js @@ -0,0 +1,60 @@ +"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 models_1 = require("../models"); +const network = require("../network"); +function addTimer({ amount, millis, receiver }) { + return __awaiter(this, void 0, void 0, function* () { + const now = new Date().valueOf(); + const when = now + millis; + const t = yield models_1.models.Timer.create({ + amount, millis: when, receiver, + }); + setTimer(when, () => __awaiter(this, void 0, void 0, function* () { + payBack(t); + })); + }); +} +exports.addTimer = addTimer; +function setTimer(when, cb) { + const now = new Date().valueOf(); + const ms = when - now; + if (ms < 0) + cb(); // fire right away if its already passed + else + setTimeout(cb, ms); +} +exports.setTimer = setTimer; +function reloadTimers() { + return __awaiter(this, void 0, void 0, function* () { + const timers = yield models_1.models.Timer.findAll(); + timers && timers.forEach(t => { + setTimer(t.millis, () => __awaiter(this, void 0, void 0, function* () { + payBack(t); + })); + }); + }); +} +exports.reloadTimers = reloadTimers; +function payBack(t) { + return __awaiter(this, void 0, void 0, function* () { + const contact = yield models_1.models.Contact.findOne({ where: { id: t.receiver } }); + if (contact) { + network.signAndSend({ + amt: t.amount, + dest: contact.publicKey, + }); + } + models_1.models.Timer.destroy({ where: { id: t.id } }); + }); +} +exports.payBack = payBack; +//# sourceMappingURL=timers.js.map \ No newline at end of file diff --git a/dist/api/utils/timers.js.map b/dist/api/utils/timers.js.map new file mode 100644 index 0000000..54a211b --- /dev/null +++ b/dist/api/utils/timers.js.map @@ -0,0 +1 @@ +{"version":3,"file":"timers.js","sourceRoot":"","sources":["../../../api/utils/timers.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,sCAAkC;AAClC,sCAAqC;AAErC,SAAsB,QAAQ,CAAC,EAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAC;;QACrD,MAAM,GAAG,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAA;QAChC,MAAM,IAAI,GAAG,GAAG,GAAG,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AA;SACL;QACD,eAAM,CAAC,KAAK,CAAC,OAAO,CAAC,EAAC,KAAK,EAAC,EAAC,EAAE,EAAC,CAAC,CAAC,EAAE,EAAC,EAAC,CAAC,CAAA;IAC3C,CAAC;CAAA;AATD,0BASC"} \ No newline at end of file diff --git a/dist/api/utils/tribes.js b/dist/api/utils/tribes.js index 9f52612..bf2dcb4 100644 --- a/dist/api/utils/tribes.js +++ b/dist/api/utils/tribes.js @@ -84,7 +84,7 @@ function publish(topic, msg) { client.publish(topic, msg); } exports.publish = publish; -function declare({ uuid, name, description, tags, img, group_key, host, price_per_message, price_to_join, owner_alias, owner_pubkey }) { +function declare({ uuid, name, description, tags, img, group_key, host, price_per_message, price_to_join, owner_alias, owner_pubkey, escrow_amount, escrow_millis }) { return __awaiter(this, void 0, void 0, function* () { try { yield fetch('https://' + host + '/tribes', { @@ -95,6 +95,8 @@ function declare({ uuid, name, description, tags, img, group_key, host, price_pe price_per_message: price_per_message || 0, price_to_join: price_to_join || 0, owner_alias, owner_pubkey, + escrow_amount: escrow_amount || 0, + escrow_millis: escrow_millis || 0, }), headers: { 'Content-Type': 'application/json' } }); @@ -107,7 +109,7 @@ function declare({ uuid, name, description, tags, img, group_key, host, price_pe }); } exports.declare = declare; -function edit({ uuid, host, name, description, tags, img, price_per_message, price_to_join, owner_alias }) { +function edit({ uuid, host, name, description, tags, img, price_per_message, price_to_join, owner_alias, escrow_amount, escrow_millis }) { return __awaiter(this, void 0, void 0, function* () { try { const token = yield genSignedTimestamp(); @@ -118,6 +120,8 @@ function edit({ uuid, host, name, description, tags, img, price_per_message, pri name, description, tags, img: img || '', price_per_message: price_per_message || 0, price_to_join: price_to_join || 0, + escrow_amount: escrow_amount || 0, + escrow_millis: escrow_millis || 0, owner_alias, }), headers: { 'Content-Type': 'application/json' } diff --git a/dist/api/utils/tribes.js.map b/dist/api/utils/tribes.js.map index c06e806..bc84594 100644 --- a/dist/api/utils/tribes.js.map +++ b/dist/api/utils/tribes.js.map @@ -1 +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