From 14b1b1d27a0f2a41dcac863e76934d8643edd686 Mon Sep 17 00:00:00 2001 From: Marcos Rodriguez Velez Date: Sun, 27 Oct 2024 12:43:58 -0400 Subject: [PATCH] wip --- src/openapi/constants.ts | 3 +-- src/worker-processmempool.ts | 5 ----- src/worker-sender.ts | 5 +---- 3 files changed, 2 insertions(+), 11 deletions(-) diff --git a/src/openapi/constants.ts b/src/openapi/constants.ts index a273821..7797c35 100644 --- a/src/openapi/constants.ts +++ b/src/openapi/constants.ts @@ -3,5 +3,4 @@ import { components } from "./api"; export const NOTIFICATION_LEVEL_TRANSACTIONS: components["schemas"]["NotificationLevel"] = "transactions"; export const NOTIFICATION_LEVEL_NEWS: components["schemas"]["NotificationLevel"] = "news"; export const NOTIFICATION_LEVEL_PRICE: components["schemas"]["NotificationLevel"] = "price"; -export const NOTIFICATION_LEVEL_TIPS: components["schemas"]["NotificationLevel"] = "tips"; -export const NOTIFICATION_CATEGORY_TRANSACTION = "TRANSACTION_CATEGORY"; // Add category only for type 2, 3 and 4 +export const NOTIFICATION_LEVEL_TIPS: components["schemas"]["NotificationLevel"] = "tips"; \ No newline at end of file diff --git a/src/worker-processmempool.ts b/src/worker-processmempool.ts index 3ca25c3..d821b42 100644 --- a/src/worker-processmempool.ts +++ b/src/worker-processmempool.ts @@ -70,11 +70,6 @@ async function processMempool() { os: "ios", }; - // Add category only if type is 2, 3, or 4 - if ([2, 3, 4].includes(payload.type)) { - payload.category = NOTIFICATION_CATEGORY_TRANSACTION; - } - allPotentialPushPayloadsArray.push(payload); } } diff --git a/src/worker-sender.ts b/src/worker-sender.ts index 2db5845..663c83d 100644 --- a/src/worker-sender.ts +++ b/src/worker-sender.ts @@ -2,7 +2,7 @@ import "reflect-metadata"; import { SendQueue } from "./entity/SendQueue"; import { GroundControlToMajorTom } from "./class/GroundControlToMajorTom"; import { TokenConfiguration } from "./entity/TokenConfiguration"; -import { NOTIFICATION_CATEGORY_TRANSACTION, NOTIFICATION_LEVEL_NEWS, NOTIFICATION_LEVEL_PRICE, NOTIFICATION_LEVEL_TIPS, NOTIFICATION_LEVEL_TRANSACTIONS } from "./openapi/constants"; +import { NOTIFICATION_LEVEL_NEWS, NOTIFICATION_LEVEL_PRICE, NOTIFICATION_LEVEL_TIPS, NOTIFICATION_LEVEL_TRANSACTIONS } from "./openapi/constants"; import dataSource from "./data-source"; import { components } from "./openapi/api"; require("dotenv").config(); @@ -107,14 +107,12 @@ dataSource switch (payload.type) { case 2: payload = payload; - payload.category = NOTIFICATION_CATEGORY_TRANSACTION; process.env.VERBOSE && console.log("pushing to token", payload.token, payload.os); await GroundControlToMajorTom.pushOnchainAddressWasPaid(connection, GroundControlToMajorTom.getGoogleServerKey(), GroundControlToMajorTom.getApnsJwtToken(), payload); await sendQueueRepository.remove(record); break; case 3: payload = payload; - payload.category = NOTIFICATION_CATEGORY_TRANSACTION; process.env.VERBOSE && console.log("pushing to token", payload.token, payload.os); await GroundControlToMajorTom.pushOnchainAddressGotUnconfirmedTransaction(connection, GroundControlToMajorTom.getGoogleServerKey(), GroundControlToMajorTom.getApnsJwtToken(), payload); await sendQueueRepository.remove(record); @@ -127,7 +125,6 @@ dataSource break; case 4: payload = payload; - payload.category = NOTIFICATION_CATEGORY_TRANSACTION; process.env.VERBOSE && console.log("pushing to token", payload.token, payload.os); await GroundControlToMajorTom.pushOnchainTxidGotConfirmed(connection, GroundControlToMajorTom.getGoogleServerKey(), GroundControlToMajorTom.getApnsJwtToken(), payload); await sendQueueRepository.remove(record);