-
Notifications
You must be signed in to change notification settings - Fork 409
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[TOOL-2917]: fix useReadContract type hinting (#5888)
- Loading branch information
1 parent
b058f68
commit c06ecda
Showing
4 changed files
with
110 additions
and
74 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,8 @@ | ||
import type { Abi, AbiFunction } from "abitype"; | ||
import type { ThirdwebContract } from "./contract.js"; | ||
|
||
export type AbiOfLength<TLength> = { length: TLength }; | ||
|
||
export type AsyncGetAbiFunctionFromContract<TAbi extends Abi> = ( | ||
contract: ThirdwebContract<TAbi>, | ||
) => Promise<AbiFunction>; |
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,6 @@ | ||
import type { Abi } from "abitype"; | ||
import type { BaseTransactionOptions } from "../transaction/types.js"; | ||
|
||
export type Extension<TAbi extends Abi, TParams extends object, TResult> = ( | ||
options: BaseTransactionOptions<TParams, TAbi>, | ||
) => Promise<TResult>; |
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,13 @@ | ||
import type { Prettify } from "../../../utils/type-utils.js"; | ||
|
||
type BasePickedQueryOptions<T = object> = T & { | ||
enabled?: boolean; | ||
}; | ||
|
||
export type PickedOnceQueryOptions = Prettify< | ||
BasePickedQueryOptions & { refetchInterval?: number; retry?: number } | ||
>; | ||
|
||
export type WithPickedOnceQueryOptions<T> = T & { | ||
queryOptions?: PickedOnceQueryOptions; | ||
}; |