No logs in the stream event

Hi, I am trying to write to the Parse database an event by capturing it with Moralis streams.

The transaction is recorded in the table “Txs” but a Logs table is not created.

The exact same function for another contract, with the same event type, correctly logs both Txs and Logs in the Parse table.

I also tried a beforeSave to somehow handle the input (there was a uint8 as a difference in the event) but that is not the reason.

On the moralis streams I see

Total Records

1

Logs

0

Transactions

1

Internal Transactions

0

Any idea why it is not recorded?

Hi, you receive the full transaction info in backend, also with the logs (you could use some debugging for that with console.log) and the logs somehow are not saved in the database?

I received the transaction (saved in the database) with the table name “Txs”.

With some console.logs in the “beforeSave” of the table “Logs” it is as if the function is not even called, because we do not see any server-side logs.

And the even transaction logs themselves are not saved in the database: with all other events (for other contracts) a table is created as “Logs”, in this case no.

The logs that you expect are the ones that are received in the webhook requests specific to that transaction? can you try to log with console.log the webhook request data that is received from streams api?

This is an event I wrote in the contract

NewNFTMinted(address,address,uint256,string,uint256,uint8,uint8)

I’m expecting as for other streams I created, setting this as “topic0”, after a new object is minted and the event is emitted, to have a record in the table “NewnftmintedLogs” (it’s created automatically in Parse, as I’m doing for other events and streams with Moralis, exactly same setup so tested and working for other contracts), so only the logs related to that event I’m listening with the Stream created, and then handling the after save to write my own logic.

Strange thing is that for this contract and event, the table is not created and also Moralis reports only transactions and no logs for that stream.

Hi @gerar

In case if you haven’t solved this, can you please share us your stream config?

You can get the stream config json using the below endpoint.

Hello no it’s not solved yet, we’ve the same issue here is the config

{
  "id": "56141810-1ce6-4eb8-a70a-2e2c88b17318",
  "webhookUrl": "https://5376-34-168-129-70.ngrok.io/streams-webhook",
  "description": "New Club NFT Minted Testnet",
  "tag": "NewClubNFTMinted",
  "demo": false,
  "topic0": [
    "NewClubNFTMinted(address,address,uint256,string,uint256,uint8,uint8)"
  ],
  "allAddresses": false,
  "includeNativeTxs": true,
  "includeContractLogs": true,
  "includeInternalTxs": true,
  "includeAllTxLogs": false,
  "getNativeBalances": [],
  "triggers": [],
  "abi": [
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "internalType": "address",
          "name": "owner",
          "type": "address",
          "abi.1.inputs.0.type": "address",
          "abi.1.inputs.0.name": "owner",
          "abi.1.inputs.0.internalType": "address"
        },
        {
          "indexed": true,
          "internalType": "address",
          "name": "approved",
          "type": "address",
          "abi.1.inputs.1.type": "address",
          "abi.1.inputs.1.name": "approved",
          "abi.1.inputs.1.internalType": "address"
        },
        {
          "indexed": true,
          "internalType": "uint256",
          "name": "tokenId",
          "type": "uint256",
          "abi.1.inputs.2.type": "uint256",
          "abi.1.inputs.2.name": "tokenId",
          "abi.1.inputs.2.internalType": "uint256"
        }
      ],
      "name": "Approval",
      "type": "event",
      "abi.1.type": "event",
      "abi.1.name": "Approval"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "internalType": "address",
          "name": "owner",
          "type": "address",
          "abi.2.inputs.0.type": "address",
          "abi.2.inputs.0.name": "owner",
          "abi.2.inputs.0.internalType": "address"
        },
        {
          "indexed": true,
          "internalType": "address",
          "name": "operator",
          "type": "address",
          "abi.2.inputs.1.type": "address",
          "abi.2.inputs.1.name": "operator",
          "abi.2.inputs.1.internalType": "address"
        },
        {
          "indexed": false,
          "internalType": "bool",
          "name": "approved",
          "type": "bool",
          "abi.2.inputs.2.type": "bool",
          "abi.2.inputs.2.name": "approved",
          "abi.2.inputs.2.internalType": "bool"
        }
      ],
      "name": "ApprovalForAll",
      "type": "event",
      "abi.2.type": "event",
      "abi.2.name": "ApprovalForAll"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "internalType": "address",
          "name": "sender",
          "type": "address",
          "abi.3.inputs.0.type": "address",
          "abi.3.inputs.0.name": "sender",
          "abi.3.inputs.0.internalType": "address"
        },
        {
          "indexed": false,
          "internalType": "address",
          "name": "contractAddr",
          "type": "address",
          "abi.3.inputs.1.type": "address",
          "abi.3.inputs.1.name": "contractAddr",
          "abi.3.inputs.1.internalType": "address"
        },
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "tokenId",
          "type": "uint256",
          "abi.3.inputs.2.type": "uint256",
          "abi.3.inputs.2.name": "tokenId",
          "abi.3.inputs.2.internalType": "uint256"
        },
        {
          "indexed": false,
          "internalType": "string",
          "name": "clubURI",
          "type": "string",
          "abi.3.inputs.3.type": "string",
          "abi.3.inputs.3.name": "clubURI",
          "abi.3.inputs.3.internalType": "string"
        },
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "clubArenaSize",
          "type": "uint256",
          "abi.3.inputs.4.type": "uint256",
          "abi.3.inputs.4.name": "clubArenaSize",
          "abi.3.inputs.4.internalType": "uint256"
        },
        {
          "indexed": false,
          "internalType": "uint8",
          "name": "clubDivision",
          "type": "uint8",
          "abi.3.inputs.5.type": "uint8",
          "abi.3.inputs.5.name": "clubDivision",
          "abi.3.inputs.5.internalType": "uint8"
        },
        {
          "indexed": false,
          "internalType": "uint8",
          "name": "clubLeague",
          "type": "uint8",
          "abi.3.inputs.6.type": "uint8",
          "abi.3.inputs.6.name": "clubLeague",
          "abi.3.inputs.6.internalType": "uint8"
        }
      ],
      "name": "NewClubNFTMinted",
      "type": "event",
      "abi.3.type": "event",
      "abi.3.name": "NewClubNFTMinted"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "internalType": "address",
          "name": "previousOwner",
          "type": "address",
          "abi.4.inputs.0.type": "address",
          "abi.4.inputs.0.name": "previousOwner",
          "abi.4.inputs.0.internalType": "address"
        },
        {
          "indexed": true,
          "internalType": "address",
          "name": "newOwner",
          "type": "address",
          "abi.4.inputs.1.type": "address",
          "abi.4.inputs.1.name": "newOwner",
          "abi.4.inputs.1.internalType": "address"
        }
      ],
      "name": "OwnershipTransferred",
      "type": "event",
      "abi.4.type": "event",
      "abi.4.name": "OwnershipTransferred"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "tokenId",
          "type": "uint256",
          "abi.5.inputs.0.type": "uint256",
          "abi.5.inputs.0.name": "tokenId",
          "abi.5.inputs.0.internalType": "uint256"
        },
        {
          "components": [
            {
              "internalType": "address payable",
              "name": "account",
              "type": "address",
              "abi.5.inputs.1.components.0.type": "address",
              "abi.5.inputs.1.components.0.name": "account",
              "abi.5.inputs.1.components.0.internalType": "address payable"
            },
            {
              "internalType": "uint96",
              "name": "value",
              "type": "uint96",
              "abi.5.inputs.1.components.1.type": "uint96",
              "abi.5.inputs.1.components.1.name": "value",
              "abi.5.inputs.1.components.1.internalType": "uint96"
            }
          ],
          "indexed": false,
          "internalType": "struct LibPart.Part[]",
          "name": "royalties",
          "type": "tuple[]",
          "abi.5.inputs.1.type": "tuple[]",
          "abi.5.inputs.1.name": "royalties",
          "abi.5.inputs.1.internalType": "struct LibPart.Part[]"
        }
      ],
      "name": "RoyaltiesSet",
      "type": "event",
      "abi.5.type": "event",
      "abi.5.name": "RoyaltiesSet"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": true,
          "internalType": "address",
          "name": "from",
          "type": "address",
          "abi.6.inputs.0.type": "address",
          "abi.6.inputs.0.name": "from",
          "abi.6.inputs.0.internalType": "address"
        },
        {
          "indexed": true,
          "internalType": "address",
          "name": "to",
          "type": "address",
          "abi.6.inputs.1.type": "address",
          "abi.6.inputs.1.name": "to",
          "abi.6.inputs.1.internalType": "address"
        },
        {
          "indexed": true,
          "internalType": "uint256",
          "name": "tokenId",
          "type": "uint256",
          "abi.6.inputs.2.type": "uint256",
          "abi.6.inputs.2.name": "tokenId",
          "abi.6.inputs.2.internalType": "uint256"
        }
      ],
      "name": "Transfer",
      "type": "event",
      "abi.6.type": "event",
      "abi.6.name": "Transfer"
    }
  ],
  "advancedOptions": null,
  "chainIds": [
    "0x13881"
  ],
  "status": "active",
  "statusMessage": "Stream is active"
}

Try setting the includeNativeTxs as false.

When it is set these true you will receive a webhook for all the transactions happening on the address, even if there is no event matching the ABI. So in this case you will not receive the logs or event data.

If you set it to false you will only receive webhook when there is a matching event.

Ok thanks I will try and let you know. Any idea why for other events with the same exact setup, even with includeNativeTxs at true, we are correctly receiving Logs automatically written in the ParseDB table?

Thanks

There can be cases where wallet has both native transaction and tokens transfer event in one block.
In this you will see both the data in webhook.

If there is no token transfer event then you will only receive the native tx data in webhook

Ok clear but here the main fact is that what I expect is the table to be populated when I trigger on the contract that event as topic0 that I’m tracking with this stream, and this is actually a token transfer (or better, I’m minting a token).

So as for the other events I was expecting also the Logs table to be populated.

I try with your suggestion and let you know in case. Not sure about other cases where the Logs table in the database is not populated and I was even thinking it was a problem with the “uint8” type of the event.

1 Like

Hi @johnversus I tried disabling includeNativeTxs.

However, after calling the function, we do not get logs and the table is not populated. We have an event issued, but it appears that it was not triggered, but the transaction was successful.

This is a mirror function to another that works as expected (event logged and automatically written to the Parse table).

Any other ideas? Thanks

Hi @gerar

Can you send an email to [email protected] with your account email and the stream ID?

I will take a closer look at your streams.

1 Like