Skip to content

Commit

Permalink
Use proper case for getParentBaseFeeEstimate
Browse files Browse the repository at this point in the history
  • Loading branch information
chrstph-dvx committed Jul 9, 2024
1 parent 2c3f257 commit fe5df45
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/actions/getGasAccountingParams.ts
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
import { Chain, PublicClient, ReadContractReturnType, Transport } from 'viem';
import { Chain, PublicClient, Transport } from 'viem';
import { arbGasInfo } from '../contracts';

type ArbGasInfoABI = typeof arbGasInfo.abi;
export type GetGasAccountingParamsParameters = void;

export type GetGasAccountingParamsReturnType = ReadContractReturnType<
ArbGasInfoABI,
'getGasAccountingParams'
>;
export type GetGasAccountingParamsReturnType = {
speedLimitPerSecond: bigint;
gasPoolMax: bigint;
maxTxGasLimit: bigint;
};

export async function getGasAccountingParams<TChain extends Chain | undefined>(
client: PublicClient<Transport, TChain>,
): Promise<GetGasAccountingParamsReturnType> {
return client.readContract({
const [speedLimitPerSecond, gasPoolMax, maxTxGasLimit] = await client.readContract({
abi: arbGasInfo.abi,
functionName: 'getGasAccountingParams',
address: arbGasInfo.address,
});
return {
speedLimitPerSecond,
gasPoolMax,
maxTxGasLimit,
};
}

0 comments on commit fe5df45

Please sign in to comment.