Skip to content

Commit

Permalink
Updated PrimativeTypeMap
Browse files Browse the repository at this point in the history
  • Loading branch information
DeepDoge committed Nov 12, 2024
1 parent 6f3a597 commit 0c5bb14
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions types/ethers6.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,10 @@ import { PrimativeTypeMapBase, ToTypeTuple } from "./type"
* const balance = await erc20.balanceOf("0xYourWalletAddress");
* ```
*/
export type TypedContract<TAbi extends Abi, TMap extends PrimativeTypeMapBase = TypedContract.PrimativeTypeMap> = Contract &
FromAbi<TMap, TAbi>
export type TypedContract<
TAbi extends Abi,
TMap extends PrimativeTypeMapBase = TypedContract.PrimativeTypeMap,
> = Contract & FromAbi<TMap, TAbi>
type FromAbi<
TMap extends PrimativeTypeMapBase,
TAbi extends Abi,
Expand All @@ -66,15 +68,15 @@ type FromAbi<
>
: FromAbi<TMap, Tail, R>
: R

export namespace TypedContract {
export type PrimativeTypeMap = {
[K in `${"u" | ""}int${number | ""}` | `${"u" | ""}fixed`]: {
[K in `${"u" | ""}int${bigint | ""}` | `${"u" | ""}fixed`]: {
input: bigint
output: bigint
}
} & {
[K in `bytes${number | ""}`]: {
[K in `bytes${bigint | ""}`]: {
input: BytesLike
output: `0x${string}`
}
Expand All @@ -93,4 +95,3 @@ export namespace TypedContract {
}
}
}

0 comments on commit 0c5bb14

Please sign in to comment.