-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added `GetEventParams` type and its `defaultEventParams` const. _fromBlock_ is set to "latest" by default, we need to fetch all the events so set it to "earliest".
- Loading branch information
Showing
5 changed files
with
31 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import type { EventParams } from "../types/contract.js"; | ||
|
||
export const defaultEventParams: EventParams = { | ||
fromBlock: "earliest", | ||
toBlock: "latest", | ||
strict: true, | ||
}; |
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 |
---|---|---|
@@ -1,6 +1,17 @@ | ||
import type { Abi, GetContractReturnType, Client } from "viem"; | ||
import type { | ||
Abi, | ||
GetContractReturnType, | ||
Client, | ||
GetContractEventsParameters, | ||
} from "viem"; | ||
|
||
type OmitWrite<T> = Omit<T, "write">; | ||
export type GetReadContractReturnType<TAbi extends Abi> = OmitWrite< | ||
GetContractReturnType<TAbi, Client> | ||
>; | ||
|
||
export type EventParams = Pick< | ||
GetContractEventsParameters, | ||
"strict" | "fromBlock" | "toBlock" | ||
>; | ||
export type GetEventParams = { eventParams: EventParams }; |
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