From f9482395dc16d77371580551d6222e6b79d9a73c Mon Sep 17 00:00:00 2001 From: dafyddd Date: Tue, 1 Jun 2021 21:59:11 -0400 Subject: [PATCH] Auto approve support for MANGO_PROGRAM_ID_V2 (#276) --- src/utils/transactions.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/utils/transactions.js b/src/utils/transactions.js index b666106..62f23c3 100644 --- a/src/utils/transactions.js +++ b/src/utils/transactions.js @@ -26,6 +26,9 @@ const RAYDIUM_LP_PROGRAM_ID = new PublicKey( const MANGO_PROGRAM_ID = new PublicKey( 'JD3bq9hGdy38PuWQ4h2YJpELmHVGPPfFSuFkpzAd9zfu', ); +const MANGO_PROGRAM_ID_V2 = new PublicKey( + '5fNfvyp5czQVX77yoACa3JJVEhdRaWjPuazuWgjhTqEH', +); const marketCache = {}; let marketCacheConnection = null; @@ -133,7 +136,7 @@ const toInstruction = async ( accountKeys, 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'); let decodedInstruction = decodeMangoInstruction(decoded); return await handleMangoInstruction(