-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add EVM indexer To make indexers extractable it was separated into Indexer class which instance consumer initiaties. This allows better separation (no need for pulling deps for all networks) - everything currently is exported under either evm or starknet object, it can be extracted later (we might need to extract some common things first into other package). We also have specific types for writers for each network. This could also be useful in the future if we put multiple APIs in single instance of checkpoint, it could accept indexers instead of just single indexer. * chore: fetch events from at most 10 blocks at a time * fix: update network ID * refactor: only fetch targeted events * feat: add simple range adjustment logic * fix: use BaseIndexer instead of EvmIndexer in Checkpoint
- Loading branch information
Showing
15 changed files
with
1,139 additions
and
476 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export { EvmProvider } from './provider'; | ||
export { EvmIndexer } from './indexer'; | ||
export * from './types'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { Logger } from '../../utils/logger'; | ||
import { Instance, BaseIndexer } from '../base'; | ||
import { EvmProvider } from './provider'; | ||
import { Writer } from './types'; | ||
|
||
export class EvmIndexer extends BaseIndexer { | ||
private writers: Record<string, Writer>; | ||
|
||
constructor(writers: Record<string, Writer>) { | ||
super(); | ||
this.writers = writers; | ||
} | ||
|
||
init({ instance, log, abis }: { instance: Instance; log: Logger; abis?: Record<string, any> }) { | ||
this.provider = new EvmProvider({ instance, log, abis, writers: this.writers }); | ||
} | ||
|
||
public getHandlers(): string[] { | ||
return Object.keys(this.writers); | ||
} | ||
} |
Oops, something went wrong.