flashbots / ethers-provider-flashbots-bundle

Flashbots provider for ethers.js
543 stars 212 forks source link

Getting cors error on any method of Flashbots provider #98

Open lakub-muravlov opened 1 year ago

lakub-muravlov commented 1 year ago

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);
Stanback commented 1 year ago

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