Blockchain Can';t使用web3检索钱包交易

Blockchain Can';t使用web3检索钱包交易,blockchain,web3,web3js,erc20,Blockchain,Web3,Web3js,Erc20,所以,是的,我试图在某个代币合同上获得钱包地址的所有交易。但它一直返回null const Web3 = require('web3') const web3 = new Web3('https://rpc-mainnet.maticvigil.com/v1/___') const abi = [contains correct abi] const contract_address = '0x----------' const wallet_address = '0x2----------

所以,是的,我试图在某个代币合同上获得钱包地址的所有交易。但它一直返回null

const Web3 = require('web3')

const web3 = new Web3('https://rpc-mainnet.maticvigil.com/v1/___')

const abi = [contains correct abi]
const contract_address = '0x----------'
const wallet_address = '0x2-----------'

var instance = new web3.eth.Contract(abi, contract_address)
instance.getPastEvents(
    "Transfer",
    {filter: {to: wallet_address }},
    { fromBlock: 0, toBlock: "latest" },
    (errors, events) => {
       if (!errors) {
            console.log(events);
       }
            console.log(errors);
       }
);
Idk它怎么了?也许我做错了?
谢谢你的帮助

没有合同地址就说不出来。但在
传输
事件中,合同可能没有
索引字段。它要么有不同的名称,要么没有索引。此外,RPC不允许一次获取超过1k个块<代码>{“error”:{“message”:“Blockheight too far in have:eth_getLogs.您的计划允许的块范围:1000”,“代码”:-32005},“jsonrpc”:“2.0”,“id”:1}