ho1
1
i trying to connect web3auth to zksync
but it is throwing an error, how can i fix this?
Error: Invalid network, net_version is: 361257328
the code is below
const zksyncChainConfig: CustomChainConfig = {
chainNamespace: CHAIN_NAMESPACES.EIP155,
chainId: "300",
rpcTarget: "https://sepolia.era.zksync.dev",
displayName: "zkSync Sepolia",
blockExplorerUrl: "https://sepolia-era.zksync.network/",
ticker: "ETH",
tickerName: "Ethereum",
logo: "https://cryptologos.cc/logos/ethereum-eth-logo.png",
isTestnet: true,
}
const privateKeyProvider = new EthereumPrivateKeyProvider({
config: { chainConfig: zksyncChainConfig },
})
const web3auth = new Web3Auth({
clientId,
web3AuthNetwork: WEB3AUTH_NETWORK.SAPPHIRE_DEVNET,
privateKeyProvider: privateKeyProvider,
})
is the network supported?
vjgee
2
@ho1 Welcome Aboard!
The chainID should be in hex format 0x12c
You can get the chain details for Sepolia zksync here : https://chainlist.org/chain/300
ho1
3
yes it is working after I change it to use hex
however, when i try another chain (Japan Open Chain) , i meet the same issue
const jocChainConfig = {
chainNamespace: CHAIN_NAMESPACES.EIP155,
chainId: "0x2761",
rpcTarget: "https://rpc-1.testnet.japanopenchain.org:8545",
displayName: "Japan Open Chain Testnet",
blockExplorerUrl: "https://explorer.testnet.japanopenchain.org/",
ticker: "JOCT",
tickerName: "Japan Open Chain Testnet",
isTestnet: true,
}
with the following error code
Error: Invalid network, net_version is: 361257328
vjgee
4
There is some issue with the chain details then that you need to check.
ho1
5
vjgee
6
The error Invalid network, net_version is: … typically occurs when the network configuration is not set correctly.
- Check the Network Configuration:
Ensure that the network configuration is set correctly i.e. chainId
and the rpcTarget
- Verify the RPC Endpoint:
Double-check that the RPC endpoint is correct and accessible.
Do check here About Japan Open Chain specifications | Japan Open Chain
system
Closed
7
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.