v1.8.0
🚀 Features
Indexer: add experimentalRequestDedupe option - by @songkeys (e7bc6)
import { createIndexer } from 'crossbell'
const indexer = createIndexer({
experimentalRequestDedupe: true,
})This option is used to enable the experimental request dedupe feature for performance.
When this option is enabled, the indexer client will cache the response of same requests until the promises are resolved.
For example, if you call indexer.character.getMany('0x123') many times at the same time, the indexer will only send one request to the server.
await Promise.all([
indexer.character.getMany('0x123'),
indexer.character.getMany('0x123'),
indexer.character.getMany('0x123'),
indexer.character.getMany('0xabc'),
indexer.character.getMany('0xabc'),
]) // only 2 requests will be sent to the indexer serverThis only works for GET requests.
Contract: update to viem@1.12.0
After this version, you can use getEventContract to query event logs even more convenient:
import { Abi, createContract } from 'crossbell/contract'
const contract = createContract()
const logs = await contract.publicClient.getContractEvents({
abi: Abi.entry,
eventName: 'CharacterCreated',
fromBlock: 44000000n,
toBlock: 45000000n,
})