diff --git a/src/actions/getMaxTimeVariation.ts b/src/actions/getMaxTimeVariation.ts index 9e6c9a5e..32b074f3 100644 --- a/src/actions/getMaxTimeVariation.ts +++ b/src/actions/getMaxTimeVariation.ts @@ -1,32 +1,35 @@ -import { Chain, GetFunctionArgs, PublicClient, ReadContractReturnType, Transport } from 'viem'; +import { Address, Chain, PublicClient, Transport } from 'viem'; import { sequencerInbox } from '../contracts'; -import { ActionParameters, WithContractAddress } from '../types/Actions'; +import { ActionParameters } from '../types/Actions'; -type Args = GetFunctionArgs; -type SequencerInboxABI = typeof sequencerInbox.abi; -type GetMaxTimeVariationParameters = WithContractAddress< - Args, - 'sequencerInbox', - Curried ->; export type GetMaxTimeVariationActionParameters = ActionParameters< - Args, + {}, 'sequencerInbox', Curried >; -export type GetMaxTimeVariationReturnType = ReadContractReturnType< - SequencerInboxABI, - 'maxTimeVariation' ->; +export type GetMaxTimeVariationReturnType = { + delayBlocks: bigint; + futureBlocks: bigint; + delaySeconds: bigint; + futureSeconds: bigint; +}; export async function getMaxTimeVariation( client: PublicClient, - args: GetMaxTimeVariationParameters, + args: { + sequencerInbox: Address; + }, ): Promise { - return client.readContract({ + const [delayBlocks, futureBlocks, delaySeconds, futureSeconds] = await client.readContract({ abi: sequencerInbox.abi, functionName: 'maxTimeVariation', address: args.sequencerInbox, }); + return { + delayBlocks, + futureBlocks, + delaySeconds, + futureSeconds, + }; } diff --git a/src/actions/isBatchPoster.ts b/src/actions/isBatchPoster.ts index 3ba862d7..bf4a24b6 100644 --- a/src/actions/isBatchPoster.ts +++ b/src/actions/isBatchPoster.ts @@ -1,8 +1,10 @@ -import { Chain, GetFunctionArgs, PublicClient, ReadContractReturnType, Transport } from 'viem'; +import { Address, Chain, PublicClient, ReadContractReturnType, Transport } from 'viem'; import { sequencerInbox } from '../contracts'; import { ActionParameters, WithContractAddress } from '../types/Actions'; -type Args = GetFunctionArgs; +type Args = { + batchPoster: Address; +}; type SequencerInboxABI = typeof sequencerInbox.abi; type IsBatchPosterParameters = WithContractAddress< Args, @@ -25,6 +27,6 @@ export async function isBatchPoster( abi: sequencerInbox.abi, functionName: 'isBatchPoster', address: args.sequencerInbox, - args: args.args, + args: [args.batchPoster], }); } diff --git a/src/actions/isValidKeysetHash.ts b/src/actions/isValidKeysetHash.ts index 6808bc2c..20360a03 100644 --- a/src/actions/isValidKeysetHash.ts +++ b/src/actions/isValidKeysetHash.ts @@ -1,8 +1,10 @@ -import { Chain, GetFunctionArgs, PublicClient, ReadContractReturnType, Transport } from 'viem'; +import { Chain, Hex, PublicClient, ReadContractReturnType, Transport } from 'viem'; import { sequencerInbox } from '../contracts'; import { ActionParameters, WithContractAddress } from '../types/Actions'; -type Args = GetFunctionArgs; +type Args = { + keysetHash: Hex; +}; type SequencerInboxABI = typeof sequencerInbox.abi; type IsValidKeysetHashParameters = WithContractAddress< Args, @@ -28,6 +30,6 @@ export async function isValidKeysetHash( abi: sequencerInbox.abi, functionName: 'isValidKeysetHash', address: args.sequencerInbox, - args: args.args, + args: [args.keysetHash], }); }