Trying to run a contract function

I’m trying to adapt some code from to Moralis.
The source code is here:
This code connects to curve and gets the number of pools. I’m trying to make the same contract call using Moralis. Here’s my attempt:

const GAUGE_CONTRACT_ABI = [...same as on vfat tools/curve.js, line 6...]
const ASSETS_ADDRESS = "0x90E00ACe148ca3b23Ac1bC8C240C2a7Dd9c2d7f5";
const options = {
  chain: "eth",
  address: ASSETS_ADDRESS,
  function_name: "pool_count",
  params: {},
const result = moralis.Moralis.Web3API.native

But I get this error:

          triggerUncaughtException(err, true /* fromPromise */);

[UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "#<Object>".] {

What am I doing wrong?


I don’t know what is wrong, you could try first with an example that it is expected to work, you should find working examples on a similar forum thread from the past.