Heroku
This commit is contained in:
parent
aba440ad98
commit
3f2a5202b2
|
@ -17,6 +17,7 @@ const twilioClient = new Twilio(config.twilioSid, config.twilioToken);
|
|||
|
||||
export const validateMarginAccount = (client: MangoClient, connection: Connection, dexProgramId: PublicKey, alert: any) => {
|
||||
return new Promise<void>(async (resolve, reject) => {
|
||||
try {
|
||||
const mangoGroupPk = new PublicKey(alert.mangoGroupPk);
|
||||
const marginAccountPk = new PublicKey(alert.marginAccountPk);
|
||||
const mangoGroup = await client.getMangoGroup(connection, mangoGroupPk);
|
||||
|
@ -26,6 +27,9 @@ export const validateMarginAccount = (client: MangoClient, connection: Connectio
|
|||
} else {
|
||||
resolve();
|
||||
}
|
||||
} catch (e) {
|
||||
reject(new UserError('Invalid margin account or mango group'));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue