Skip to content

Commit

Permalink
Fix typing
Browse files Browse the repository at this point in the history
  • Loading branch information
chrstph-dvx committed Jun 10, 2024
1 parent 46e8453 commit a83b53f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/actions/addSequencerL2Batch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ import {
} from 'viem';
import { sequencerInbox } from '../contracts';
import { WithContractAddress, ActionParameters, WithAccount } from '../types/Actions';
import { Prettify } from '../types/utils';

type Args = GetFunctionArgs<SequencerInboxABI, 'addSequencerL2Batch'>;
type SequencerInboxABI = typeof sequencerInbox.abi;
type BuildAddSequencerL2BatchParameters<Curried extends boolean = false> = WithAccount<
WithContractAddress<Args, 'sequencerInbox', Curried>
type BuildAddSequencerL2BatchParameters<Curried extends boolean = false> = Prettify<
WithAccount<WithContractAddress<Args, 'sequencerInbox', Curried>>
>;
export type BuildAddSequencerL2BatchActionParameters<Curried extends boolean> = WithAccount<
ActionParameters<Args, 'sequencerInbox', Curried>
export type BuildAddSequencerL2BatchActionParameters<Curried extends boolean> = Prettify<
WithAccount<ActionParameters<Args, 'sequencerInbox', Curried>>
>;

export type BuildAddSequencerL2BatchReturnType = PrepareTransactionRequestReturnType;
Expand Down
4 changes: 4 additions & 0 deletions src/types/Actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,7 @@ export type ActionParameters<Args, ContractName extends string, Curried extends
[key in ContractName]?: Address;
}
>;

export type WithAccount<Args> = Args & {
account: Address;
};

0 comments on commit a83b53f

Please sign in to comment.