Example of usage of Native Events Deep API

Hi @Moralis Team I try to use the Native Events Deep API as below, but got 500 error.

I use Tether Contract and its Approval topic from Etherscan.

Can you assist me what I am doing wrong here?

POST

https://deep-index.moralis.io/api/v2/0xceb0d0e13c606bb351560fe2ffff58a54709dc5b/events?chain=eth&chain_name=mainnet&topic=Approval%20(index_topic_1%20address%20owner,%20index_topic_2%20address%20spender,%20uint256%20value)

Appreciate your help, thanks.

Hey @Attila

Here is example how should a request look like:

curl -X 'POST' \
  'https://deep-index.moralis.io/api/v2/0xdAC17F958D2ee523a2206206994597C13D831ec7/events?chain=eth&topic=0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925' \
  -H 'accept: application/json' \
  -H 'X-API-Key: mykey' \
  -H 'Content-Type: application/json' \
  -d '{
    "anonymous": false,
    "inputs": [
      {
        "indexed": true,
        "name": "owner",
        "type": "address"
      },
      {
        "indexed": true,
        "name": "spender",
        "type": "address"
      },
      {
        "indexed": false,
        "name": "value",
        "type": "uint256"
      }
    ],
    "name": "Approval",
    "type": "event"
  }'

For fetching info about events of smart contracts you should provide ABI of the event.

Address - is an address of smart contract, not of user.

Thank you very much @Yomoo!

Where did you get the ABI of the Approval event of the Tether Smart Contract?

{
	"anonymous": false,
	"inputs": [
		{
			"indexed": true,
			"name": "owner",
			"type": "address"
		},
		{
			"indexed": true,
			"name": "spender",
			"type": "address"
		},
		{
			"indexed": false,
			"name": "value",
			"type": "uint256"
		}
	],
	"name": "Approval",
	"type": "event"
}

Do you have an example which return response for this Moralis Deep API?

Thanks for the collaboration.

You will get them on blockchain scanner wesbties like etherscan or bscscan. Over there you will have a Contract ABI section like this –

Please copy the entire ABI and then search for “Approval”. The JSON object that has the name “Approval” and is type “event” will be the Approval event of that contract. Similarly, you can use other events as well.

Hope this helps.

Have a wonderful day, Sir. :slight_smile:

1 Like

I get it @malik thanks for the detailed response.
Do you have any example call which returns something in Moralis?

I used latest Transfer event from Tether Contract, but still empty response:

https://deep-index.moralis.io/api/v2/0xceb0d0e13c606bb351560fe2ffff58a54709dc5b/events?chain=eth&chain_name=mainnet&topic=0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef

Thanks for a valid example.