Skip to content

Commit

Permalink
[SDK] Fix: allow 0 values for gasPrice (#5841)
Browse files Browse the repository at this point in the history
## Problem solved

Allow `0` value for gasPrice, important for gasless chains
Fixes TOOL-2865

<!-- start pr-codex -->

---

## PR-Codex overview
This PR modifies the conditional check for `gasPrice` in the `fee-data.ts` file to ensure it specifically checks if `gasPrice` is of type `bigint` instead of just checking its truthiness.

### Detailed summary
- Changed the condition from `if (gasPrice)` to `if (typeof gasPrice === "bigint")` in the `fee-data.ts` file.
- This ensures that only values of type `bigint` are considered valid for `gasPrice`.

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}`

<!-- end pr-codex -->
  • Loading branch information
d4mr committed Dec 27, 2024
1 parent 1556615 commit 71eaf8f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/thirdweb/src/gas/fee-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export async function getGasOverridesForTransaction(
maxPriorityFeePerGas,
};
}
if (gasPrice) {
if (typeof gasPrice === "bigint") {
return { gasPrice };
}

Expand Down

0 comments on commit 71eaf8f

Please sign in to comment.