Skip to content

Commit

Permalink
nice
Browse files Browse the repository at this point in the history
  • Loading branch information
spsjvc committed Oct 8, 2024
1 parent 6e17a34 commit 4629f0f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/getDefaultConfirmPeriodBlocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,14 @@ import { base, baseSepolia } from './chains';
export function getDefaultConfirmPeriodBlocks<TChain extends Chain | undefined>(
parentChainIdOrClient: ParentChainId | Client<Transport, TChain>,
): bigint {
const { chainId: parentChainId } = validateParentChain(parentChainIdOrClient, { custom: false });
const { chainId: parentChainId, isCustom: parentChainIsCustom } =
validateParentChain(parentChainIdOrClient);

if (parentChainIsCustom) {
throw new Error(
`[getDefaultConfirmPeriodBlocks] can't provide defaults for custom parent chain with id ${parentChainId}`,
);
}

const isMainnet = parentChainIsMainnet(parentChainId);
const confirmPeriodBlocks = isMainnet ? 45_818n : 150n;
Expand Down

0 comments on commit 4629f0f

Please sign in to comment.