I’m using moralis free account to test to get contract event data, the limit quota is 10 million, but now I can’t get any data after using 3 million times, and there is no error report, can anyone help me?
/{address}/events
I’m using moralis free account to test to get contract event data, the limit quota is 10 million, but now I can’t get any data after using 3 million times, and there is no error report, can anyone help me?
/{address}/events
You don’t get any errors or results? How are you making requests to /{address}/events
e.g. in code?
No, the request to /{address}/events returns results. The problem is that the contract events should have data, but the result of the request does not contain any data, and I wonder if it has something to do with the free account limit quota.
No, the request to /{address}/events returns results.
Can you post the parameters you’re using (address, chain, etc.) and what the response/result looks like.
It probably isn’t related to any limit of quota or usage if you’re not getting an error response.
The code for the following API request, I have hidden the apiKey:
curl -X 'POST' \
'https://deep-index.moralis.io/api/v2/0x3857E9Ce3f4580a30a8537c1302AF9b21d4A681F/events?chain=bsc&from_block=17368146&to_block=17368146&topic=Deposit%28uint8%2Cbytes32%2Cuint64%29' \
-H 'accept: application/json' \
-H 'X-API-Key: <web3-apis-key>' \
-H 'Content-Type: application/json' \
-d '{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint8","name":"destinationChainID","type":"uint8"},{"indexed":true,"internalType":"bytes32","name":"resourceID","type":"bytes32"},{"indexed":true,"internalType":"uint64","name":"depositNonce","type":"uint64"}],"name":"Deposit","type":"event"}'
I got returned by /{Address}/events are as follows:
{"total":0,"page":0,"page_size":100,"result":[]}
But, if the official node using bsc is the one that returns data:
res: [{"blockNumber":17368146,"blockHash":"0xdc710a6de9dc071d1fb7ea889e60ac88a5dd73c0a82957b782a98e9fedcf6498","transactionIndex":139,"removed":false,"address":"0x3857E9Ce3f4580a30a8537c1302AF9b21d4A681F","data":"0x","topics":["0xdbb69440df8433824a026ef190652f29929eb64b4d1d5d2a69be8afe3e6eaed8","0x0000000000000000000000000000000000000000000000000000000000000056","0x5600000000000000000000001d2f0da169ceb9fc7b3144628db156f3f6c60dbe","0x0000000000000000000000000000000000000000000000000000000000000014"],"transactionHash":"0x175f279fe10ca25072b7469e1513114fcb53351bb74dc5df78305c8c31bdb0a6","logIndex":351}]
The request code is:
const { ethers } = require('ethers');
const provider = new ethers.providers.JsonRpcProvider('https://bsc-dataseed.binance.org');
(async () => {
const filter = {
topics: [
ethers.utils.id("Deposit(uint8,bytes32,uint64)")
],
fromBlock: 17368146,
toBlock: 17368146,
}
const res = await provider.getLogs(filter);
console.log('res:', JSON.stringify(res));
})();
why is this?
Instead of using Deposit(uint8,bytes32,uint64)
for the topic parameter, if you use the hex signature of it or 0xdbb69440df8433824a026ef190652f29929eb64b4d1d5d2a69be8afe3e6eaed8
, it will work.
Great, the hex signature with topic really works fine.
But just about 5 days ago I was using the function string signature, which also worked fine, and then I had a problem. Was there a version update in the last few days?
Thank you so much!
We’ll have to check what changed about that topic, it was not an intentional change