ethers-provider-flashbots-bundle icon indicating copy to clipboard operation
ethers-provider-flashbots-bundle copied to clipboard

Getting cors error on any method of Flashbots provider

Open lakub-soso opened this issue 2 years ago • 1 comments

Getting cors error from relay when trying to simulate/sendBundle/getUserStats IMG_20230320_144831_102

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);

lakub-soso avatar Mar 20 '23 12:03 lakub-soso

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).

Stanback avatar Apr 06 '23 16:04 Stanback