Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
spsjvc committed Dec 18, 2023
1 parent 4c01a3c commit cb34091
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions src/types/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Abi } from 'viem';
import { arbOwner } from '../contracts';

// https://twitter.com/mattpocockuk/status/1622730173446557697
export type Prettify<T> = {
Expand All @@ -10,16 +9,3 @@ export type GetFunctionName<TAbi extends Abi> = Extract<
TAbi[number],
{ type: 'function' }
>['name'];

export type ExtractReadFunctionsFromAbi<TAbi extends Abi> = Extract<
TAbi[number],
{ type: 'function'; stateMutability: 'view' | 'pure' }
>[];

export type ExtractWriteFunctionsFromAbi<TAbi extends Abi> = Extract<
TAbi[number],
{ type: 'function'; stateMutability: 'nonpayable' | 'payable' }
>[];

type X = GetFunctionName<ExtractReadFunctionsFromAbi<typeof arbOwner.abi>>;
type Y = GetFunctionName<ExtractWriteFunctionsFromAbi<typeof arbOwner.abi>>;

0 comments on commit cb34091

Please sign in to comment.