From eb3d1a08c5037e4132162a31da120899c2610421 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Brzezin=CC=81ski?= Date: Sun, 7 Apr 2024 15:37:38 +0200 Subject: [PATCH] fix connection --- store/mangoStore.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/store/mangoStore.ts b/store/mangoStore.ts index 321a24e..325a9e3 100644 --- a/store/mangoStore.ts +++ b/store/mangoStore.ts @@ -83,6 +83,7 @@ const MANGO_BOOST_ID = new PublicKey( ) export const LITE_RPC_URL = 'https://api.mngo.cloud/lite-rpc/v1/' +const backupConnections = [new Connection(LITE_RPC_URL, 'recent')] const GROUP_JLP = new PublicKey('AKeMSYiJekyKfwCc3CUfVNDVAiqk9FfbQVMY3G7RUZUf') const GROUP_V1 = new PublicKey('78b8f4cGCwmZ9ysPFMWLaLTkkaYnUjwMJYStWe5RTSSX') @@ -116,7 +117,7 @@ const initMangoClient = ( opts = { prioritizationFee: DEFAULT_PRIORITY_FEE, fallbackOracleConfig: FALLBACK_ORACLES, - multipleConnections: [new Connection(LITE_RPC_URL)], + multipleConnections: backupConnections, }, ): { lst: MangoClient; jlp: MangoClient } => { return { @@ -335,7 +336,7 @@ const mangoStore = create()( const client = initMangoClient(provider, { prioritizationFee: priorityFee, fallbackOracleConfig: FALLBACK_ORACLES, - multipleConnections: [new Connection(LITE_RPC_URL)], + multipleConnections: backupConnections, }) return { @@ -774,7 +775,7 @@ const mangoStore = create()( const client = initMangoClient(provider, { prioritizationFee: priorityFee, fallbackOracleConfig: FALLBACK_ORACLES, - multipleConnections: [new Connection(LITE_RPC_URL)], + multipleConnections: backupConnections, }) set((s) => { @@ -829,7 +830,7 @@ const mangoStore = create()( const newClient = initMangoClient(newProvider, { prioritizationFee: priorityFee, fallbackOracleConfig: FALLBACK_ORACLES, - multipleConnections: [new Connection(LITE_RPC_URL)], + multipleConnections: backupConnections, }) set((state) => { state.connection = newConnection @@ -889,7 +890,7 @@ const mangoStore = create()( const newClient = initMangoClient(provider, { prioritizationFee: priorityFee, fallbackOracleConfig: FALLBACK_ORACLES, - multipleConnections: [new Connection(LITE_RPC_URL)], + multipleConnections: backupConnections, }) set((state) => { state.priorityFee = feeEstimate