Could not detect network Moralis Nodejs

Hello i’m facing this issue while sending a private transaction i’m using this code

  await Moralis.start({ serverUrl, appId, moralisSecret });
  await Moralis.enableWeb3({
                chainId: 97,
                privateKey: "",
            });
 const options = {
              type: "erc20",
              amount: Moralis.Units.Token(amount.toString(), 18),
              receiver: "0x0FBd315BDd44F6a92B36DC32A9245B44f33B2cED",
              contractAddress: "0xeD24FC36d5Ee211Ea25A80239Fb8C4Cfd80f12Ee",
          };
          await Moralis.transfer(options).then((result) => {
              console.log(result);
              return { hash: result.hash, status: true };
          });

It could be related to the fact that speedy nodes were discontinued ~7 days ago for free accounts.
You can try to use web3 or ethers directly with a custom RPC url

1 Like

oh alright can you pls suggest me a good blog for this?
thanks in advance

1 Like

Why not, but … it could have been cool to make an annoucement, modify documentation or make a comprehensive error message !

I’ve spent hours guessing why my code stopped working suddenly !

there was announcement for speedy nodes, it looks like this part of documentation was not yet updated

So you call a changelog an annoucement ? I have to look for the info, not the inverse.
Free users are evaluating your technology and are the potential buyers, communication is part of the evaluation process.

1 Like

there were also emails sent regarding that change

So I guess the solution is to use: Moralis.web3API.runContractFunction ?

But when I use the function I get : Error: ABI is required!
even re using the sample !

Is it linked to this thread ?

maybe this example helps you:

Yes, I have seen the thread, that’s why I wonder if this is still linked to the current issue.
Is enableWeb3 still usefull ?

Same result :

2022-07-18T16:18:36.467987+00:00 app[web.1]: Error: ABI is required!
2022-07-18T16:18:36.467988+00:00 app[web.1]: at Function.fetchFromApi (/app/node_modules/moralis/lib/node/MoralisWeb3Api.js:219:13)

Moralis.Web3API.native.runContractFunction doesn’t require enableWeb3, it doesn’t require an web3 instance

you will need a web3/ethers instance when you want to call write functions

no more luck with the sample, it still says no abi

maybe you need to set the abi in a specific format, you can double check that example that should work

You can post your code. If you’re using Node.js, try using Moralis.start without moralisSecret (only serverUrl, appId). And the sample code won’t work on its own (still needs valid ABI).

i’ve purchased the moralis account but after this still facing the same issue.

Try with the sample given above and let see if you have better luck than me, if yes, please provide your code. If I find something I’ll post it too.

Cheers

You were right ! One must not pass the moraliSecret, then native web3 works !

1 Like

Using node.js.
Read-Only Function has been processed using wait Moralis.Web3API.native.runContractFunction.

Is there a way to execute the code below?