Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
marcosrdz committed Oct 27, 2024
1 parent 126f919 commit c2013b3
Show file tree
Hide file tree
Showing 8 changed files with 257 additions and 426 deletions.
5 changes: 2 additions & 3 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,6 @@ components:
type: "string"
description: txid of the transaction where this address is one of the outputs


PushNotificationOnchainAddressGotUnconfirmedTransaction:
allOf: # Combines PushNotificationBase and the inline model
- $ref: "#/components/schemas/PushNotificationBase"
Expand Down Expand Up @@ -355,7 +354,7 @@ components:
txid:
type: "string"
description: txid of the transaction that got confirmed

PushNotificationMessage:
allOf: # Combines PushNotificationBase and the inline model
- $ref: "#/components/schemas/PushNotificationBase"
Expand All @@ -368,4 +367,4 @@ components:
enum: [5]
text:
type: "string"
description: custom text thats displayed on push notification bubble
description: custom text thats displayed on push notification bubble
5 changes: 3 additions & 2 deletions scripts/mass_send.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ const fs = require("fs");
const text = fs.readFileSync("all_tokens_unique.csv", { encoding: "utf8" });

const lines = text.split("\n");
console.log('# got', lines.length, 'tokens');
console.log("# got", lines.length, "tokens");

console.log("INSERT INTO send_queue_2 VALUES ");

let fisrt = true;
for (const line of lines.slice(0, 1000000)) {
const [token, os] = line.split("\t");
const sql = (fisrt ? '' : ', ') + `(null, '{"type":5,"token":"${token}","os":"${os}","text":"If you are using Lightning, please read our blog post. The service is sunsetting. Balances should be moved to another service"}', null)`;
const sql =
(fisrt ? "" : ", ") + `(null, '{"type":5,"token":"${token}","os":"${os}","text":"If you are using Lightning, please read our blog post. The service is sunsetting. Balances should be moved to another service"}', null)`;
console.log(sql);
fisrt = false;
}
Expand Down
14 changes: 12 additions & 2 deletions src/class/GroundControlToMajorTom.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,12 @@ export class GroundControlToMajorTom {
if (pushNotification.os === "ios") return GroundControlToMajorTom._pushToApns(dataSource, apnsP8, pushNotification.token, apnsPayload, pushNotification, pushNotification.txid);
}

static async pushOnchainTxidGotConfirmed(dataSource: DataSource, serverKey: string, apnsP8: string, pushNotification: components["schemas"]["PushNotificationTxidGotConfirmed"]): Promise<[object, object]> {
static async pushOnchainTxidGotConfirmed(
dataSource: DataSource,
serverKey: string,
apnsP8: string,
pushNotification: components["schemas"]["PushNotificationTxidGotConfirmed"]
): Promise<[object, object]> {
const fcmPayload = {
data: {},
notification: {
Expand Down Expand Up @@ -143,7 +148,12 @@ export class GroundControlToMajorTom {
if (pushNotification.os === "ios") return GroundControlToMajorTom._pushToApns(dataSource, apnsP8, pushNotification.token, apnsPayload, pushNotification, pushNotification.txid);
}

static async pushOnchainAddressWasPaid(dataSource: DataSource, serverKey: string, apnsP8: string, pushNotification: components["schemas"]["PushNotificationOnchainAddressGotPaid"]): Promise<[object, object]> {
static async pushOnchainAddressWasPaid(
dataSource: DataSource,
serverKey: string,
apnsP8: string,
pushNotification: components["schemas"]["PushNotificationOnchainAddressGotPaid"]
): Promise<[object, object]> {
const fcmPayload = {
data: {},
notification: {
Expand Down
Loading

0 comments on commit c2013b3

Please sign in to comment.