Skip to content
This repository has been archived by the owner on Oct 30, 2024. It is now read-only.

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
impelcrypto committed Nov 30, 2023
1 parent aa32754 commit d55605f
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions packages/sdk-core/src/modules/gas-api/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@ export const getEvmGas = async (web3: Web3, selectedGasPrice: string): Promise<s
return gasPrice;
};

export const getEvmGasCost = async ({
isNativeToken,
export const getEvmGasCost = async ({ isNativeToken,
evmGasPrice,
fromAddress,
toAddress,
web3,
value,
encodedData
}: {
encodedData }: {
isNativeToken: boolean;
evmGasPrice: GasPrice;
fromAddress: string;
Expand All @@ -31,17 +29,17 @@ export const getEvmGasCost = async ({
}): Promise<GasPrice> => {
const tx: TransactionConfig = isNativeToken
? {
from: fromAddress,
to: toAddress,
value: ethers.utils.parseEther(value).toString()
}
from: fromAddress,
to: toAddress,
value: ethers.utils.parseEther(value).toString()
}
: {
nonce: await web3.eth.getTransactionCount(fromAddress),
from: fromAddress,
to: toAddress,
value,
data: encodedData
};
nonce: await web3.eth.getTransactionCount(fromAddress),
from: fromAddress,
to: toAddress,
value,
data: encodedData
};

const numEstimatedGas = await web3.eth.estimateGas(tx);
const estimatedGas = new BN(numEstimatedGas);
Expand Down

0 comments on commit d55605f

Please sign in to comment.