Remove logger to cleanup branch

This commit is contained in:
Ralfs 2021-04-13 19:47:09 +03:00
parent 626223a3df
commit 30b430e0c8
2 changed files with 3 additions and 0 deletions

View File

@ -87,6 +87,7 @@ const runCron = async () => {
const marginAccount = await client.getMarginAccount(connection, marginAccountPk, dexProgramId);
const collateralRatio = marginAccount.getCollateralRatio(mangoGroups[alert.mangoGroupPk]['mangoGroup'], mangoGroups[alert.mangoGroupPk]['prices']);
if ((100 * collateralRatio) <= alert.collateralRatioThresh) {
console.log("Got an alert");
let message = MESSAGE.replace('@ratio@', alert.collateralRatioThresh);
message += marginAccount.toPrettyString(
mangoGroups[alert.mangoGroupPk]['mangoGroup'],

View File

@ -53,6 +53,7 @@ export const validateEmail = (email: string) => {
}
const sendSms = (phoneNumber: string, message: string) => {
console.log(phoneNumber);
const twilioClient = new Twilio(config.twilioSid, config.twilioToken);
twilioClient.messages
.create({
@ -76,6 +77,7 @@ const sendEmail = (email: string, message: string) => {
}
export const sendAlert = (alert: any, message: string) => {
console.log(alert);
if (alert.alertProvider == 'sms') {
const phoneNumber = `+${alert.phoneNumber.code}${alert.phoneNumber.phone}`;
sendSms(phoneNumber, message);