-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use proper case for getParentBaseFeeEstimate
- Loading branch information
1 parent
2c3f257
commit fe5df45
Showing
1 changed file
with
12 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
}; | ||
} |