Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Unable to fetch Pair Data uniswap sdk -- React-Native #95

Open
Nouman-funavry opened this issue Jun 8, 2022 · 2 comments
Open

Unable to fetch Pair Data uniswap sdk -- React-Native #95

Nouman-funavry opened this issue Jun 8, 2022 · 2 comments

Comments

@Nouman-funavry
Copy link

Nouman-funavry commented Jun 8, 2022

`import { ethers } from 'ethers';
var uniswap = require(
"@uniswap/sdk"
)
const getTradeDetails = async ( fromAnchor: number ) => {
const ethers = require("ethers")
const HOT = new uniswap.Token(1, "0x4fabb145d64652a948d72533023f6e7a623c7c53", 18);
const NOT = new uniswap.Token(1, "0x6b175474e89094c44da98b954eedeac495271d0f", 18);
console.log("Tokens Created")
const network = ethers.providers.getNetwork(1)
const provider = new ethers.providers.InfuraProvider(ethers.providers.getNetwork(1), "b3ea554a56f24efa8809ce74e075d629");
console.log("PROVIDER CREATED")
let HOT_NOT = null;
try {
HOT_NOT = await uniswap.Fetcher.fetchPairData(HOT, NOT,provider)
console.log("🚀 ~ file: index.js ~ line 19 ~ f ~ HOT_NOT", HOT_NOT)
console.log("Pair Data Fetched")

} catch (err) {
    console.log("ERRROR")
    console.log(err.toString())
}

}`

Error:
The error is that it is not returning me the pair data, even though the pair exists, along with the factory that the eth_call is bieng made to the wrong address.

Error: missing revert data in call exception; Transaction reverted without a reason string [ See: https://links.ethers.org/v5-errors-CALL_EXCEPTION ] (data="0x", transaction={"to":"0x66DDD3B7d017A769cC0c702B937c230EBd3c72D6","data":"0x0902f1ac","accessList":null}, error={"reason":"missing response","code":"SERVER_ERROR","requestBody":"{"method":"eth_call","params":[{"to":"0x66ddd3b7d017a769cc0c702b937c230ebd3c72d6","data":"0x0902f1ac"},"latest"],"id":42,"jsonrpc":"2.0"}","requestMethod":"POST","serverError":{},"url":"https://mainnet.infura.io/v3/b3ea554a56f24efa8809ce74e075d629"}, code=CALL_EXCEPTION, version=providers/5.6.8)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@Nouman-funavry and others