Binacne smart chain #1360
Unanswered
phatwasin01
asked this question in
Q&A
Replies: 2 comments 10 replies
-
Does Binance support the eth_chainId operation? If you specify the network details explicitly, this error should go away. Something similar to |
Beta Was this translation helpful? Give feedback.
4 replies
-
I've also added a new BSC package. Still very experimental, but try it out and let me know if you have any problems: https://github.com/ethers-io/ancillary-bsc Or simply, |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
How can I solve this ?
const {ChainId, Fetcher, WETH ,Route,Trade, TokenAmount, TradeType} = require('@pancakeswap-libs/sdk'); const ethers = require("ethers") const chainId = ChainId.MAINNET; const tokenAddresss = '0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82'; const bscProvider = new ethers.providers.JsonRpcProvider('https://bsc-dataseed.binance.org/') const init = async() => { const cake = await Fetcher.fetchTokenData(chainId,tokenAddresss,bscProvider); const weth = WETH[chainId]; const pair = await Fetcher.fetchPairData(cake,weth); const route = new Route([pair], weth); console.log(route.midPrice.toSignificant(6)) console.log(route.midPrice.invert().toSignificant(6)) } init();
ERROR :
(node:12788) UnhandledPromiseRejectionWarning: Error: unsupported getDefaultProvider network (operation="getDefaultProvider", network={"chainId":56,"name":"unknown"}, code=NETWORK_ERROR, version=providers/5.0.24)
Beta Was this translation helpful? Give feedback.
All reactions