Developers Forum for XinFin XDC Network

Discussion on: BlocksScan Contributed towards XDCPay 2.0 and It's ready for Beta Testing.

Collapse
sudeep profile image
Sudeep Ravindran

Hi,

XDC Pay 2.0 seems to break our existing integration with the web3-onboard library(formerly bnc-onboard) that we use for detecting network change.

At the root of this issue seems to be the problem that web3.currentProvider now gives chainId as "0xNaN" (with XDCPay 2.0).

We think this code below is responsible for the issue

github.com/XinFinOrg/XDCPay/blob/b...

Firstly, the list of standard selectors in the file do not contain XDC Networks (neither apothem nor mainnet).

So, the "OR" condition is triggered which has its own set of problems. Most likely, the chainId configured elsewhere is not int & hence the parseInt fails with NaN. The whole outcome triggers the "0xNaN" which messes up the onboard library as the value is non-null but unintelligible.

For reference, we are using v 1.34.1 of onboard and our dapp has otherwise been stable for a while now. This is the line where XDC Pay 2.0 fails for us.

github.com/blocknative/web3-onboar...

Collapse
ivan_blocksscan profile image
Ivan_BlocksScan

Hello @sudeep,

BlocksScan team have already fixed the issue, Kindly check the updated build (latest version) of XDCPay 2.0

Collapse
sudeep profile image
Sudeep Ravindran

Thanks. The issue has been resolved