simple-uniswap-sdk
simple-uniswap-sdk copied to clipboard
custom provider not set with pairfactory
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);
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
Ahh ok will check this out sorry for any issues will fix soon
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
This is not correct it should work with an ethers instance or web3 instance.. will reopen and look at both errors