Ich versuche, einige Protokolle von Ropsten zu erhalten, und hier ist mein Code:
web3.eth.getPastLogs(
{
address: '0x3b873a919aa0512d5a0f09e6dcceaa4a6727fafe',
fromBlock: 3292448,
toBlock: 3292448,
},
).then(console.log).catch(e => console.log(e));
was zu einem Fehler führt:
Error: Returned error: invalid argument 0: hex string without 0x prefix
Was mache ich falsch?
Konvertieren Sie es in Hex:
fromBlock: web3.utils.toHex(3292448)
toBlock: web3.utils.toHex(3292448)