forked from lnp2pBot/bot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The --downlevelIteration flag is a TypeScript compiler option that enables support for iterating over new concepts like Map, Set, or Generator in older JavaScript runtimes. By default, TypeScript targets ES3, which does not support these features. If you use a for...of loop or a spread operator on an iterable object, you may get an error. Use Date instead of Date.toISOString cause paid_at has type Date and during the conversion from js to ts, we got compilation errors.
- Loading branch information
Showing
9 changed files
with
83 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { | ||
attemptPendingPayments, | ||
attemptCommunitiesPendingPayments, | ||
} from "./pending_payments"; | ||
import cancelOrders from "./cancel_orders"; | ||
import deleteOrders from "./delete_published_orders"; | ||
import calculateEarnings from './calculate_community_earnings' | ||
import deleteCommunity from './communities' | ||
import nodeInfo from './node_info' | ||
|
||
export { | ||
attemptPendingPayments, | ||
cancelOrders, | ||
deleteOrders, | ||
calculateEarnings, | ||
attemptCommunitiesPendingPayments, | ||
deleteCommunity, | ||
nodeInfo, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,24 @@ | ||
const { Config } = require('../models'); | ||
import { Telegraf } from "telegraf"; | ||
import { MainContext } from "../bot/start"; | ||
|
||
import { Config } from '../models'; | ||
const { getInfo } = require('../ln'); | ||
const logger = require('../logger'); | ||
import logger from "../logger"; | ||
|
||
const info = async bot => { | ||
const info = async (bot: Telegraf<MainContext>) => { | ||
try { | ||
const config = await Config.findOne({}); | ||
if (config === null) throw Error("Config not found in DB"); | ||
const info = await getInfo(); | ||
if (info.is_synced_to_chain) { | ||
config.node_status = 'up'; | ||
} | ||
config.node_uri = info.uris[0]; | ||
await config.save(); | ||
} catch (error) { | ||
const message = error.toString(); | ||
const message = String(error); | ||
logger.error(`node info catch error: ${message}`); | ||
} | ||
}; | ||
|
||
module.exports = info; | ||
export default info; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters