Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

custom provider not set with pairfactory #22

Open
csidi90 opened this issue Oct 7, 2021 · 4 comments
Open

custom provider not set with pairfactory #22

csidi90 opened this issue Oct 7, 2021 · 4 comments

Comments

@csidi90
Copy link

csidi90 commented Oct 7, 2021

Following the docs I am trying to pass my own chainstack web3 provider to the UniswapPair

const provider = new Web3.providers.HttpProvider(providerUrl);

const uniswapPair = new UniswapPair({,
ethereumProvider : provider,
........

When I log I still get some infura provider shown in the object and not my custom provider.

const uniswapPairFactory = await uniswapPair.createFactory();
console.log('pairProvider', uniswapPairFactory._uniswapPairFactoryContext.ethersProvider);
@marcelo-mason
Copy link

marcelo-mason commented Oct 14, 2021

Same issue here

const provider = new ethers.providers.WebSocketProvider(quicknodeUrl) 

const uniswapPair = new UniswapPair({
  ethereumProvider: provider
})

const uniswapPairFactory = await uniswapPair.createFactory()
console.log('pairProvider', uniswapPairFactory.providerUrl) // returns infura

@joshstevens19
Copy link
Owner

Ahh ok will check this out sorry for any issues will fix soon

@joshstevens19
Copy link
Owner

Hey guys the ethereum provider only accepts a EIP-1193 provider as per https://eips.ethereum.org/EIPS/eip-1193 exactly what metamask provider is this does not accept a web3 instance or ethers instance. This is something we may add later but for now we do not support a custom ethers provider or web3 instance just a custom EIP-1193 provider. Thanks

@joshstevens19
Copy link
Owner

This is not correct it should work with an ethers instance or web3 instance.. will reopen and look at both errors

@joshstevens19 joshstevens19 reopened this Oct 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants