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

TypeError: Cannot read property 'formatted' of undefined #5

Open
ChristophSiegenthaler opened this issue Mar 4, 2021 · 3 comments
Open

Comments

@ChristophSiegenthaler
Copy link

ChristophSiegenthaler commented Mar 4, 2021

Trying to run it locally. Fresh "clone", "yarn" and "yarn start": the frontend starts, metamask running, connected to Matic. As soon I select a pair, i.e. http://localhost:3000/#/exchanges/Quick-Honey/token/DAI, to following TypeError appears:

TypeError: Cannot read property 'formatted' of undefined
Swap
src/components/Swap.js:127
  124 |   percentage = totalDiff / amount * 100
  125 | }
  126 | 
> 127 | const isReadyToSwap = currentChain?.name === fromExchange?.name
      | ^  128 |   && (parseFloat(fromTokenBalance) - amount > 0)
  129 |   && (routerOnchainBalance - quote[1].formatted) > 1
  130 | 

Any hints?

@ChristophSiegenthaler
Copy link
Author

Adding this here. I tested further under offl1.surge.sh:

  • Brave first blocked some things with the default setting to block cross site cookies(?)
  • Got a little further but got stuck here:
    {message: "Parameters from rpc request are malformed", context: {…}, type: "RpcError", stack: "Error: Parameters from rpc request are malformed↵ ….network/static/js/2.517d2e23.chunk.js:2:1127874)"} context: {invalidParamsError: "should be string", invalidParams: {…}, channelAddress: {…}, publicIdentifier: "vector7W22u8mczRA9gQDUQYDpYWAZmyE4M1mF3e2VKQYB1sNogfwyJT"} message: "Parameters from rpc request are malformed" stack: "Error: Parameters from rpc request are malformed↵ at e.<anonymous> (https://wallet.connext.network/static/js/2.517d2e23.chunk.js:2:6571010)↵ at c (https://wallet.connext.network/static/js/2.517d2e23.chunk.js:2:1127874)↵ at Generator._invoke (https://wallet.connext.network/static/js/2.517d2e23.chunk.js:2:1127627)↵ at Generator.next (https://wallet.connext.network/static/js/2.517d2e23.chunk.js:2:1128233)↵ at https://wallet.connext.network/static/js/2.517d2e23.chunk.js:2:6563564↵ at new Promise (<anonymous>)↵ at o (https://wallet.connext.network/static/js/2.517d2e23.chunk.js:2:6563309)↵ at e.value (https://wallet.connext.network/static/js/2.517d2e23.chunk.js:2:6570780)↵ at e.<anonymous> (https://wallet.connext.network/static/js/2.517d2e23.chunk.js:2:6604617)↵ at c (https://wallet.connext.network/static/js/2.517d2e23.chunk.js:2:1127874)" type: "RpcError" __proto__: Object

@makoto
Copy link
Owner

makoto commented Mar 9, 2021

Can you try again? I remember I saw the same issue but I may have fixed it.

@ChristophSiegenthaler
Copy link
Author

Updated to the latest "master", commit:3ea0482...
Currently runs until I enter the swap amount when I get this error:Uncaught (in promise) Error: call revert exception (method="getAmountsOut(uint256,address[])", errorSignature="Error(string)", errorArgs=["UniswapV2Library: IDENTICAL_ADDRESSES"], reason="UniswapV2Library: IDENTICAL_ADDRESSES", code=CALL_EXCEPTION, version=abi/5.0.12) in http://localhost:3000/#/exchanges/Quick-Honey/token/USDC

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

2 participants