Auto approve support for MANGO_PROGRAM_ID_V2 (#276)

This commit is contained in:
dafyddd 2021-06-01 21:59:11 -04:00 committed by GitHub
parent 80b425c2f5
commit f9482395dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -26,6 +26,9 @@ const RAYDIUM_LP_PROGRAM_ID = new PublicKey(
const MANGO_PROGRAM_ID = new PublicKey( const MANGO_PROGRAM_ID = new PublicKey(
'JD3bq9hGdy38PuWQ4h2YJpELmHVGPPfFSuFkpzAd9zfu', 'JD3bq9hGdy38PuWQ4h2YJpELmHVGPPfFSuFkpzAd9zfu',
); );
const MANGO_PROGRAM_ID_V2 = new PublicKey(
'5fNfvyp5czQVX77yoACa3JJVEhdRaWjPuazuWgjhTqEH',
);
const marketCache = {}; const marketCache = {};
let marketCacheConnection = null; let marketCacheConnection = null;
@ -133,7 +136,7 @@ const toInstruction = async (
accountKeys, accountKeys,
decodedInstruction, decodedInstruction,
); );
} else if (programId.equals(MANGO_PROGRAM_ID)) { } else if (programId.equals(MANGO_PROGRAM_ID) || programId.equals(MANGO_PROGRAM_ID_V2)) {
console.log('[' + index + '] Handled as mango markets instruction'); console.log('[' + index + '] Handled as mango markets instruction');
let decodedInstruction = decodeMangoInstruction(decoded); let decodedInstruction = decodeMangoInstruction(decoded);
return await handleMangoInstruction( return await handleMangoInstruction(