Skip to content

Commit

Permalink
fix type issues
Browse files Browse the repository at this point in the history
  • Loading branch information
gsteenkamp89 committed Nov 26, 2024
1 parent 571938a commit 1313ed9
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/gasPriceOracle/adapters/linea-viem.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
import { createPublicClient, PublicClient } from "viem";
import { linea } from "viem/chains";
import { PublicClient } from "viem";
import { estimateGas } from "viem/linea";
import { InternalGasPriceEstimate } from "../types";

export async function eip1559(provider: PublicClient, _chainId: number): Promise<InternalGasPriceEstimate> {
const account = "0x...";
export async function eip1559(provider: PublicClient, _chainId?: number): Promise<InternalGasPriceEstimate> {
const account = "0x07ae8551be970cb1cca11dd7a11f47ae82e70e67";

const lineaClient = createPublicClient({ chain: linea, transport: provider.transport });

// @todo: Coax viem into recognising that this is a Linea-specific provider.
// https://github.com/wevm/viem/blob/main/src/linea/actions/estimateGas.ts
const { baseFeePerGas, priorityFeePerGas } = await estimateGas(lineaClient, {
const { baseFeePerGas, priorityFeePerGas } = await estimateGas(provider, {
account,
to: account,
value: BigInt(1),
Expand Down

0 comments on commit 1313ed9

Please sign in to comment.