Browse Source

price_per_message in pay tx, expose voltage unlock

dependabot/npm_and_yarn/ini-1.3.7
Evan Feenstra 4 years ago
parent
commit
dfe403174d
  1. 1
      dist/src/auth.js
  2. 2
      dist/src/auth.js.map
  3. 3
      dist/src/controllers/messages.js
  4. 2
      dist/src/controllers/messages.js.map
  5. 1
      src/auth.ts
  6. 4
      src/controllers/messages.ts
  7. 2
      src/controllers/payment.ts

1
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' ||

2
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,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C,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"}

3
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
};

2
dist/src/controllers/messages.js.map

File diff suppressed because one or more lines are too long

1
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' ||

4
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
}

2
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: {

Loading…
Cancel
Save