How to use EVM API in Cloud

Hello,

How do I use the EVM API in Cloud functions?

Iā€™m trying to use this.

Hello,
That is with a self hosted server or with a managed moralis sever?

You can use directly moralis sdk in cloud code to use the API, you can also make http REST requests if you want in cloud code

with a managed moralis server

Moralis.Cloud.define("nftsss", async()=> {

    const NFTs = await Moralis.Web3Api.token.getAllTokenIds({
        address: "xxxxxxxxx",
        chain: "bsc testnet",
      });

      return NFTs
})

This is the function, however it says token is not defined.

With Moralis managed servers it is the old syntax from moralis v1 sdk

1 Like

Yes, Iā€™m using the v1 docs

the syntax in await Moralis.Web3API.token. and not await Moralis.Web3Api.token.

Do you guys still have the link for documentation? Thanks for this btw.

yes, v1docs.moralis.io is the old documentation