Skip to content

Commit 92a791d

Browse files
committed
fix: replace bigint exponentiation to fix Turbopack compatibility
Replace `10n ** 18n` with `BigInt(1e18)` in estimateErc20PaymasterCost. Turbopack does not yet support the `**` operator with bigint operands ("right-associative binary expression not yet implemented"). This is the same pattern already used on the adjacent line 93. Closes #499
1 parent ad0beb7 commit 92a791d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/permissionless/actions/pimlico/estimateErc20PaymasterCost.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export const estimateErc20PaymasterCost = async <
9393
const costInToken = (maxCostInWei * exchangeRate) / BigInt(1e18)
9494

9595
// represents the userOperation's max cost in usd (with 6 decimals of precision)
96-
const costInUsd = (maxCostInWei * exchangeRateNativeToUsd) / 10n ** 18n
96+
const costInUsd = (maxCostInWei * exchangeRateNativeToUsd) / BigInt(1e18)
9797

9898
return {
9999
costInToken,

0 commit comments

Comments
 (0)