[SOLVED] Getting error while integrating Arbitrum Blockchain

I am using self hosted server and I have already integrated Polygon,Binance,Ethereum with Metamsk at frontend. While integrating Arbitrum chain API is giving error with status 400.
API: /server/functions/requestMessage
Error Message: [C0006] Request failed, Bad Request(400): chainId must be a valid enum value

code:
const { message } = await Moralis.Cloud.run(‘requestMessage’, {

          address: account,

          chain: parseInt(chainId, 16),

          networkType: 'evm',

        });

It doesn’t matter what chain you use there, it will work the same

It is giving error for self hosted server, it’s working good for all other supported

chains but giving error for Palm Mainnet and Arbitrum Mainnet.I have tested the API in postman too.

Just use eth as chain for all the requests and it should work

Thanks , the issue is resolved.
Also, I have checked Optimisim support is not showing in Morallis documentation. But after googling it got to know that Morallis has started supporting Optimism since last month. After trying to implement it in the dapp , ‘/server/functions/getTokenBalances’ api gives error: “Invalid chain”.

we have different chains supported for streams api and for web3api, I think that optimism is supported only for Streams API now

Okay .Thank you for the information.

1 Like