ethers-provider-flashbots-bundle
ethers-provider-flashbots-bundle copied to clipboard
Getting cors error on any method of Flashbots provider
Getting cors error from relay when trying to simulate/sendBundle/getUserStats

const fbProvider = await FlashbotsBundleProvider.create(
ethersProvider,
wallet,
'https://relay-goerli.flashbots.net/',
5
);
const userStatsV2 = await fbProvider.getUserStatsV2();
console.log("🚀 ~ file: provider.ts:61 ~ userStatsV2:", userStatsV2);
I don't think there's much that can be done within ethers-provider-flashbots-bundle to fix this but you might consider opening up an issue in the mev-relay-js repository (https://github.com/flashbots/mev-relay-js) to request CORS support for accessing the endpoint from the browser.
As a workaround, you could run a CORS proxy locally (for example cors-anywhere).