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

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

@Nouman-funavry

Description

@Nouman-funavry

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions