Api's not returning events

I’m using evm api to fetch contract’s indexed events but I’m not getting any response.


export async function getServerSideProps() {
  await Moralis.start({ apiKey: process.env.NEXT_PUBLIC_MORALIS_WEB3_API_KEY });
  const data = await Moralis.EvmApi.native.getContractEvents({
    chain: "0x13881",
    address: CONFIG.CONTRACTS.DAO_FACTORY,
    abi: {
      anonymous: false,
      inputs: [
        {
          indexed: false,
          internalType: "address",
          name: "daoToken",
          type: "address",
        },
        {
          indexed: false,
          internalType: "address",
          name: "daoTimelock",
          type: "address",
        },
        {
          indexed: false,
          internalType: "address",
          name: "dao",
          type: "address",
        },
        {
          indexed: false,
          internalType: "address",
          name: "creator",
          type: "address",
        },
      ],
      name: "DAOCreated",
      type: "event",
    },
    topic: "DAOCreated",
  });
  console.log(":: SERVER_PROPS: ", data);
  return {
    props: {},
  };
}

My output

:: SERVER_PROPS:  ApiPaginatedResultAdapter {
  data: { total: 0, page: 0, page_size: 100, result: [] },
  adapter: [Function: apiToResult],
  jsonAdapter: [Function: resultToJson],
  params: {
    chain: '0x13881',
    address: '0xC8A7Ef44347f13683F624D1ef9736DE3e84D8e41',
    abi: {
      anonymous: false,
      inputs: [Array],
      name: 'DAOCreated',
      type: 'event'
    },
    topic: 'DAOCreated'
  },
  nextHandler: undefined,
  hasNext: [Function (anonymous)],
  next: [Function (anonymous)]
}

Also how to fetch the synced events from the moralis mongodb database I can’t find any resource/docs on that?

Moralis v2 sdk doesn’t have functions to connect to mongo db.

you can also check the function in web3api interface directly with those parameters to see if it works as expected: https://admin.moralis.io/web3apis

maybe there is an error

Interesting so they don’t have any feature to fetch synced data, thanks for helping. BTW any views on the first error where I’m not getting any contract events from their web3 api.

I didn’t understand what that error says

it will be a separate api for events: moralis.io/streams

try those inputs directly in web3api interface to see if they work

that doesn’t look like an error, it looks like no results were found in order to return them